hugepages.py script broken
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: [email protected]
Reporter: [email protected]
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.
usertools/dpdk-hugepages.py +4 -3
@@ -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.
Quoted 51 lines · On Thu, 03 Jun 2021 15:08:52 +0000 [email protected] wrote:
https://bugs.dpdk.org/show_bug.cgi?id=725
Bug ID: 725
Summary:hugepages.pyscript broken
Product: DPDK
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: other
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---Hi Folks,
It seems like the
usertools/dpdk-hugepages.pyscript 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 2As 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:b25f0a7df80b620bab09dcb34bf4547d31ddede1I'm not familiar with this script/hugepage reservation, so don't know what's a good fix. No owner of this script in
MAINTAINERSeither.usertools/dpdk-hugepages.py +0
-0
usertools/dpdk-hugepages.py def set_hugepages(path, pages): · line 74
Quoted 9 lines
usertools/dpdk-hugepages.py +4
-2@@ -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.')
If the number of hugepages is incorrect, please keep the exit call. It is not correct to return success if there is an error in setup.