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 <sarosh.arif@emumba.com>
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():