From b25f0a7df80b620bab09dcb34bf4547d31ddede1 Mon Sep 17 00:00:00 2001 From: Sarosh Arif Date: Fri, 8 Jan 2021 14:06:27 +0500 Subject: [PATCH] usertools: show error if unable to reserve hugepages 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 requested are all successfully reserved. This patch displays an error message if the pages reserved are different from the requested pages. Signed-off-by: Sarosh Arif --- usertools/dpdk-hugepages.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usertools/dpdk-hugepages.py b/usertools/dpdk-hugepages.py index 4b6401dc2e..70432f9cd7 100755 --- a/usertools/dpdk-hugepages.py +++ b/usertools/dpdk-hugepages.py @@ -62,6 +62,8 @@ 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: + sys.exit('Unable to reserve required pages.') def show_numa_pages(): -- 2.20.1