* [dpdk-dev] [PATCH 1/1] usertools: show hugepages on POWER systems
@ 2020-12-02 18:19 David Christensen
2020-12-02 18:32 ` Stephen Hemminger
2020-12-02 20:57 ` [dpdk-dev] [PATCH v2] " David Christensen
0 siblings, 2 replies; 4+ messages in thread
From: David Christensen @ 2020-12-02 18:19 UTC (permalink / raw)
To: dev, stephen; +Cc: David Christensen
The IBM PowerNV systems include NUMA nodes that don't have associated
CPUs or hugepage memory. Here is an example on an IBM AC922 system:
$ lscpu
...
NUMA node0 CPU(s): 0-63
NUMA node8 CPU(s): 64-127
NUMA node252 CPU(s):
...
$ numastat -m
...
Node 0 Node 8 Node 252
--------------- --------------- ---------------
MemTotal 126763.19 130785.06 0.00
MemFree 119513.38 125294.44 0.00
MemUsed 7249.81 5490.62 0.00
...
HugePages_Total 4.00 1734.00 0.00
HugePages_Free 0.00 4.00 0.00
HugePages_Surp 4.00 1730.00 0.00
...
Modify dpdk-hugepages.py to test for the ../hugepages directory before
attempting to parse the hugepage entries.
Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
---
usertools/dpdk-hugepages.py | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/usertools/dpdk-hugepages.py b/usertools/dpdk-hugepages.py
index 1be100ca3..89945f187 100755
--- a/usertools/dpdk-hugepages.py
+++ b/usertools/dpdk-hugepages.py
@@ -70,13 +70,14 @@ def show_numa_pages():
for numa_path in glob.glob('/sys/devices/system/node/node*'):
node = numa_path[29:] # slice after /sys/devices/system/node/node
path = numa_path + '/hugepages'
- for hdir in os.listdir(path):
- pages = get_hugepages(path + '/' + hdir)
- if pages > 0:
- kb = int(hdir[10:-2]) # slice out of hugepages-NNNkB
- print('{:<4} {:<5} {:<6} {}'.format(node, pages,
- fmt_memsize(kb),
- fmt_memsize(pages * kb)))
+ if os.path.exists(path):
+ for hdir in os.listdir(path):
+ pages = get_hugepages(path + '/' + hdir)
+ if pages > 0:
+ kb = int(hdir[10:-2]) # slice out of hugepages-NNNkB
+ print('{:<4} {:<5} {:<6} {}'.format(node, pages,
+ fmt_memsize(kb),
+ fmt_memsize(pages * kb)))
def show_non_numa_pages():
--
2.27.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH 1/1] usertools: show hugepages on POWER systems
2020-12-02 18:19 [dpdk-dev] [PATCH 1/1] usertools: show hugepages on POWER systems David Christensen
@ 2020-12-02 18:32 ` Stephen Hemminger
2020-12-02 20:57 ` [dpdk-dev] [PATCH v2] " David Christensen
1 sibling, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2020-12-02 18:32 UTC (permalink / raw)
To: David Christensen; +Cc: dev
On Wed, 2 Dec 2020 10:19:59 -0800
David Christensen <drc@linux.vnet.ibm.com> wrote:
> The IBM PowerNV systems include NUMA nodes that don't have associated
> CPUs or hugepage memory. Here is an example on an IBM AC922 system:
>
> $ lscpu
> ...
> NUMA node0 CPU(s): 0-63
> NUMA node8 CPU(s): 64-127
> NUMA node252 CPU(s):
> ...
>
> $ numastat -m
> ...
> Node 0 Node 8 Node 252
> --------------- --------------- ---------------
> MemTotal 126763.19 130785.06 0.00
> MemFree 119513.38 125294.44 0.00
> MemUsed 7249.81 5490.62 0.00
> ...
> HugePages_Total 4.00 1734.00 0.00
> HugePages_Free 0.00 4.00 0.00
> HugePages_Surp 4.00 1730.00 0.00
> ...
>
> Modify dpdk-hugepages.py to test for the ../hugepages directory before
> attempting to parse the hugepage entries.
>
> Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Ok, but using continue avoids having to do so much indentation.
if not os.path.exists(path):
continue
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH v2] usertools: show hugepages on POWER systems
2020-12-02 18:19 [dpdk-dev] [PATCH 1/1] usertools: show hugepages on POWER systems David Christensen
2020-12-02 18:32 ` Stephen Hemminger
@ 2020-12-02 20:57 ` David Christensen
2021-02-05 17:57 ` Thomas Monjalon
1 sibling, 1 reply; 4+ messages in thread
From: David Christensen @ 2020-12-02 20:57 UTC (permalink / raw)
To: dev, stephen; +Cc: David Christensen
The IBM PowerNV systems include NUMA nodes that don't have associated
CPUs or hugepage memory. Here is an example on an IBM AC922 system:
$ lscpu
...
NUMA node0 CPU(s): 0-63
NUMA node8 CPU(s): 64-127
NUMA node252 CPU(s):
...
$ numastat -m
...
Node 0 Node 8 Node 252
--------------- --------------- ---------------
MemTotal 126763.19 130785.06 0.00
MemFree 119513.38 125294.44 0.00
MemUsed 7249.81 5490.62 0.00
...
HugePages_Total 4.00 1734.00 0.00
HugePages_Free 0.00 4.00 0.00
HugePages_Surp 4.00 1730.00 0.00
...
Modify dpdk-hugepages.py to test for the ../hugepages directory before
attempting to parse the hugepage entries.
Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
---
v2:
- reduce indentation and use continue to skip non-existent paths
---
usertools/dpdk-hugepages.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/usertools/dpdk-hugepages.py b/usertools/dpdk-hugepages.py
index 1be100ca3..4b6401dc2 100755
--- a/usertools/dpdk-hugepages.py
+++ b/usertools/dpdk-hugepages.py
@@ -70,6 +70,8 @@ def show_numa_pages():
for numa_path in glob.glob('/sys/devices/system/node/node*'):
node = numa_path[29:] # slice after /sys/devices/system/node/node
path = numa_path + '/hugepages'
+ if not os.path.exists(path):
+ continue
for hdir in os.listdir(path):
pages = get_hugepages(path + '/' + hdir)
if pages > 0:
--
2.27.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH v2] usertools: show hugepages on POWER systems
2020-12-02 20:57 ` [dpdk-dev] [PATCH v2] " David Christensen
@ 2021-02-05 17:57 ` Thomas Monjalon
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2021-02-05 17:57 UTC (permalink / raw)
To: David Christensen; +Cc: dev, stephen
02/12/2020 21:57, David Christensen:
> The IBM PowerNV systems include NUMA nodes that don't have associated
> CPUs or hugepage memory. Here is an example on an IBM AC922 system:
>
> $ lscpu
> ...
> NUMA node0 CPU(s): 0-63
> NUMA node8 CPU(s): 64-127
> NUMA node252 CPU(s):
> ...
>
> $ numastat -m
> ...
> Node 0 Node 8 Node 252
> --------------- --------------- ---------------
> MemTotal 126763.19 130785.06 0.00
> MemFree 119513.38 125294.44 0.00
> MemUsed 7249.81 5490.62 0.00
> ...
> HugePages_Total 4.00 1734.00 0.00
> HugePages_Free 0.00 4.00 0.00
> HugePages_Surp 4.00 1730.00 0.00
> ...
>
> Modify dpdk-hugepages.py to test for the ../hugepages directory before
> attempting to parse the hugepage entries.
>
> Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Applied, thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-02-05 17:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-02 18:19 [dpdk-dev] [PATCH 1/1] usertools: show hugepages on POWER systems David Christensen
2020-12-02 18:32 ` Stephen Hemminger
2020-12-02 20:57 ` [dpdk-dev] [PATCH v2] " David Christensen
2021-02-05 17:57 ` Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).