DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] usertools: show an error message if unable to reserve requested hugepages
@ 2020-11-30 12:45 Sarosh Arif
  2020-11-30 16:43 ` Stephen Hemminger
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Sarosh Arif @ 2020-11-30 12:45 UTC (permalink / raw)
  To: sthemmin; +Cc: dev, Sarosh Arif

Sometimes the system is unable to reserve the requested hugepages because
enough space is not available in the RAM. In that case, currently the
script displays no error message hence the user can be under the delusion
that the hugepages he requested are all successfully reserved. This patch
displays an error message if the pages reserved are different from the
requested pages and shows the actual pages reserved.

Signed-off-by: Sarosh Arif <sarosh.arif@emumba.com>
---
 usertools/dpdk-hugepages.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/usertools/dpdk-hugepages.py b/usertools/dpdk-hugepages.py
index 1be100ca3..3f6e62c8f 100755
--- a/usertools/dpdk-hugepages.py
+++ b/usertools/dpdk-hugepages.py
@@ -62,7 +62,10 @@ def set_hugepages(path, pages):
         filename = os.path.basename(path)
         size = filename[10:]
         sys.exit('{} is not a valid system huge page size'.format(size))
-
+    if get_hugepages(path) != pages:
+        print("Unable to reserve required pages. The pages reserved are:")
+        show_pages()
+        args.show = False

 def show_numa_pages():
     '''Show huge page reservations on Numa system'''
@@ -232,6 +235,8 @@ def main():
         '--setup',
         metavar='SIZE',
         help='setup huge pages by doing clear, unmount, reserve and mount')
+
+    global args
     args = parser.parse_args()
 
     if args.setup:
-- 
2.25.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-02-05 18:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-30 12:45 [dpdk-dev] [PATCH] usertools: show an error message if unable to reserve requested hugepages Sarosh Arif
2020-11-30 16:43 ` Stephen Hemminger
2020-12-17 11:16 ` [dpdk-dev] [v2 PATCH] " Sarosh Arif
2020-12-17 18:15   ` Stephen Hemminger
2021-01-07  8:06     ` Sarosh Arif
2021-01-07 15:37       ` Stephen Hemminger
2021-01-08  9:06 ` [dpdk-dev] [v3 " Sarosh Arif
2021-02-05 18:24   ` 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).