Bug 484552

Summary: libnuma: Warning: /sys not mounted or no numa system. Assuming one node: No such file or directory
Product: [Fedora] Fedora Reporter: Mark McLoughlin <markmc>
Component: numactlAssignee: Neil Horman <nhorman>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: berrange, clalance, crobinso, michael.monreal, mmilgram, nhorman, veillard, virt-maint, yaneti
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 545170 (view as bug list) Environment:
Last Closed: 2009-03-25 15:10:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 545170    
Attachments:
Description Flags
patch to change numa warning conditions none

Description Mark McLoughlin 2009-02-08 09:32:22 UTC
With libvirt-0.6.0-2.fc10.i386:

$> virsh list --all
libnuma: Warning: /sys not mounted or no numa system. Assuming one node: No such file or directory

Pretty sure this is new with 0.6.0

Comment 1 Daniel Berrangé 2009-02-09 08:58:27 UTC
This messages comes from  libnuma.so, in libnuma.c, the method

static void
set_configured_nodes(void)
{
        DIR *d;
        struct dirent *de;

        d = opendir("/sys/devices/system/node");
        if (!d) {
                numa_warn(W_nosysfs,
                   "/sys not mounted or no numa system. Assuming one node: %s",
                        strerror(errno));
                maxconfigurednode = 0;
...


The 'set_configured_nodes' call is done from

static void
set_sizes(void)
{
        sizes_set++;
        set_configured_nodes(); /* configured nodes listed in /sys */
....


Which is in turn called from:

/*
 * There are two special functions, _init(void) and _fini(void), which
 * are called automatically by the dynamic loader whenever a library is loaded.
 *
 * The v1 library depends upon nodemask_t's of all nodes and no nodes.
 */
void
numa_init(void)
{
        int max,i;

        set_sizes();
....



So this function is triggered the momment libnuma.so is loaded by the linker, and libvirt has no way to make it STFU :-(

The reason you won't have seen it with previous libvirt build in F10 is that the libvirt RPM (and numa build) was buggy and thus not actually enabling NUMA  on F10 when it should have been.

We need to fix libnuma so it doesn't print this junk to stderr/out. It should be upto apps using libnuma to decide whether to print a warning, not have it foisted on them at library load time.

Comment 2 Neil Horman 2009-02-09 12:09:41 UTC
Actually, it seems like the right fix would be to understand why /sys isn't mounted at the time that this initalization routine is called.  To do anything else will keep numa from getting initalized.  At what point during the boot is this happening?

Comment 3 Daniel Berrangé 2009-02-09 12:23:26 UTC
I don't think its a missing /sys that's the problem here, but rather the sub-directory. The warning is triggered by:

        d = opendir("/sys/devices/system/node");


This can occurr if /sys is mounted, but /sys/devices/system/node does not exist. The kernel does not appear to create the trailing 'node' directory on machines which aren't NUMA. For example, it is not present on my laptop

# ls /sys/devices/system
clocksource  cpu  i8237  i8259  ioapic  irqrouter  kvm  lapic  timekeeping
# ls /sys/devices/system/node
ls: cannot access /sys/devices/system/node: No such file or directory

Comment 4 Mark McLoughlin 2009-02-09 12:26:14 UTC
(In reply to comment #3)
> The kernel does not appear to create the trailing 'node' directory on
> machines which aren't NUMA. For example, it is not present on my laptop

Right, that's the case here too

Comment 5 Neil Horman 2009-02-09 16:14:21 UTC
ah, my bad, didn't realize that we didn't create that node on non-numa systems.  I'll put together a patch for this shortly.

Comment 6 Neil Horman 2009-02-09 16:29:20 UTC
Created attachment 331331 [details]
patch to change numa warning conditions

here you go, give this a try please.  I figure we still need to warn in the event that /sys isn't mounted (because then we can't tell if a system is numa or not), but just runniing libnuma on a non-numa system probably doesn't warrant a warning.

Comment 7 Mark McLoughlin 2009-02-09 16:47:17 UTC
Yeah, seems to work fine

Comment 8 Neil Horman 2009-02-09 20:39:29 UTC
fixed in -3.fc10

Comment 9 Yanko Kaneti 2009-03-05 13:27:21 UTC
F10 is all set but rawhide is still waiting for this fix.

Comment 10 Michael Monreal 2009-03-16 17:32:45 UTC
Is this just a "harmless" warning or does it break libvirt? (having problems with virt-manager on RawHide where this is still not fixed and try to figure out what causes them)

Comment 11 Mark McLoughlin 2009-03-25 10:56:10 UTC
Sure enough, it's not fixed in rawhide

Comment 12 Neil Horman 2009-03-25 11:07:30 UTC
Its not fixed yet, the fix is upstream, in release 2.0.3 (which has rc2 released at the moment, I've been planning to do a wholesale update to that release as soon as its pushed, at which point this bug will get fixed.

Comment 13 Mark McLoughlin 2009-03-25 13:01:28 UTC
Mind if I just go ahead and copy the fix from F10 in the mean time? The warning is fairly annoying for virt users

Comment 14 Neil Horman 2009-03-25 13:35:50 UTC
If you like, sure, you can also just remove the warning entirely, as that appears to be the upstream fix.

Comment 15 Mark McLoughlin 2009-03-25 15:10:20 UTC
Thanks

* Wed Mar 25 2009 Mark McLoughlin <markmc> - 2.0.2-4
- Remove warning from libnuma (bz 484552)

Comment 16 Marc Milgram 2009-12-07 18:45:30 UTC
Comment on attachment 331331 [details]
patch to change numa warning conditions

fstat was used incorrectly in this patch.  A different fix was actually used.