It was not possible to choose the required amount of memory
for hugepages due to wrong comparison logic. We do want compare
MiB with MiB to make it work.
   
   Problem was discovered by CAI Qian.

Reported-by: CAI Qian <[email protected]>
Signed-off-by: Anton Arapov <[email protected]>
---
 huge_page_setup_helper.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/huge_page_setup_helper.py b/huge_page_setup_helper.py
index 737b3d9..b8545ed 100755
--- a/huge_page_setup_helper.py
+++ b/huge_page_setup_helper.py
@@ -109,7 +109,7 @@ while not userIn:
         if userHugePageReqMB > (memTotal - 128):
             userIn = None
             print "Refusing to allocate %d, you must leave at least 128MB for 
the system" % userHugePageReqMB
-        elif userHugePageReqMB < (hugePageSize / 1024):
+        elif userHugePageReqMB < (hugePageSize / (1024 * 1024)):
             userIn = None
             print "Sorry, allocation must be at least a page's worth!"
         else:
-- 
1.7.1



------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Libhugetlbfs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel

Reply via email to