I did some tests to be sure:
/sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages : 0
/sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages : 5
/sys/devices/system/node/node0/hugepages/hugepages-1048576kB/nr_hugepages : 0
/sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages : 2
/sys/devices/system/node/node1/hugepages/hugepages-1048576kB/nr_hugepages : 0
/sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages : 3
That shows that /sys/kernel/mm/hugepages/* always holds the global aggregated view.
This avoids some hazzle in !numa systems where /sys/devices/system/node doesn't even exists e.g. i386
I did some tests to be sure: mm/hugepages/ hugepages- 1048576kB/ nr_hugepages : 0 mm/hugepages/ hugepages- 2048kB/ nr_hugepages : 5 system/ node/node0/ hugepages/ hugepages- 1048576kB/ nr_hugepages : 0 system/ node/node0/ hugepages/ hugepages- 2048kB/ nr_hugepages : 2 system/ node/node1/ hugepages/ hugepages- 1048576kB/ nr_hugepages : 0 system/ node/node1/ hugepages/ hugepages- 2048kB/ nr_hugepages : 3
/sys/kernel/
/sys/kernel/
/sys/devices/
/sys/devices/
/sys/devices/
/sys/devices/
That shows that /sys/kernel/ mm/hugepages/ * always holds the global aggregated view. system/ node doesn't even exists e.g. i386
This avoids some hazzle in !numa systems where /sys/devices/