DPDK patches and discussions
 help / color / mirror / Atom feed
From: bugzilla@dpdk.org
To: dev@dpdk.org
Subject: [dpdk-dev] [Bug 725] hugepages.py script broken
Date: Thu, 03 Jun 2021 15:08:52 +0000	[thread overview]
Message-ID: <bug-725-3@http.bugs.dpdk.org/> (raw)

https://bugs.dpdk.org/show_bug.cgi?id=725

            Bug ID: 725
           Summary: hugepages.py script broken
           Product: DPDK
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: other
          Assignee: dev@dpdk.org
          Reporter: harry.van.haaren@intel.com
  Target Milestone: ---

Hi Folks,

It seems like the usertools/dpdk-hugepages.py script has changed/broken for
certain systems. I've applied the below patch to see why it was calling
"sys.exit()", which provides the following output;

$ usertools/dpdk-hugepages.py -p1G --setup 2G
num pages 0 and pages 0
num pages 1 and pages 0
Unable to reserve required pages.
num pages 0 and pages 0
num pages 2 and pages 0
Unable to reserve required pages.
num pages 4 and pages 2
Unable to reserve required pages.
num pages 2 and pages 2

As we can see, it attempts multiple things, and then succeeds (DPDK runs and
allocs hugepages as required after this).

Today the behavior will "fail" on the first "unable to reserve required pages"
as 1 != 0, and does *not* continue attempting other pages sizes/things.

This check and "sys.exit()" was introduce in this commit:
b25f0a7df80b620bab09dcb34bf4547d31ddede1

I'm not familiar with this script/hugepage reservation, so don't know what's a
good fix. No owner of this script in MAINTAINERS either.


diff --git a/usertools/dpdk-hugepages.py b/usertools/dpdk-hugepages.py
index fb368b6933..0ef667c5f9 100755
--- a/usertools/dpdk-hugepages.py
+++ b/usertools/dpdk-hugepages.py
@@ -68,8 +68,10 @@ def set_hugepages(path, pages):
     except FileNotFoundError:
         sys.exit("Invalid page size. Valid page sizes: {}".format(
                  get_valid_page_sizes(path)))
-    if get_hugepages(path) != pages:
-        sys.exit('Unable to reserve required pages.')
+    num_pages = get_hugepages(path)
+    print("num pages {0} and pages {1}".format(num_pages, pages))
+    if num_pages != pages:
+        print('Unable to reserve required pages.')

-- 
You are receiving this mail because:
You are the assignee for the bug.

             reply	other threads:[~2021-06-03 15:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-03 15:08 bugzilla [this message]
2021-06-03 19:36 ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-725-3@http.bugs.dpdk.org/ \
    --to=bugzilla@dpdk.org \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).