MCPcopy Create free account
hub / github.com/F-Stack/f-stack / show_numa_pages

Function show_numa_pages

dpdk/usertools/dpdk-hugepages.py:77–91  ·  view source on GitHub ↗

Show huge page reservations on Numa system

()

Source from the content-addressed store, hash-verified

75
76
77def show_numa_pages():
78 '''Show huge page reservations on Numa system'''
79 print('Node Pages Size Total')
80 for numa_path in glob.glob('/sys/devices/system/node/node*'):
81 node = numa_path[29:] # slice after /sys/devices/system/node/node
82 path = numa_path + '/hugepages'
83 if not os.path.exists(path):
84 continue
85 for hdir in os.listdir(path):
86 pages = get_hugepages(path + '/' + hdir)
87 if pages > 0:
88 kb = int(hdir[10:-2]) # slice out of hugepages-NNNkB
89 print('{:<4} {:<5} {:<6} {}'.format(node, pages,
90 fmt_memsize(kb),
91 fmt_memsize(pages * kb)))
92
93
94def show_non_numa_pages():

Callers 1

show_pagesFunction · 0.85

Calls 3

get_hugepagesFunction · 0.85
fmt_memsizeFunction · 0.85
printFunction · 0.50

Tested by

no test coverage detected