I appreciate any comments!
thank you,
Avantika
Add the --hard flag to hugeadm that is set with --pool-pages-(min|max). When
the flag is set, try multiple times adjust the pool size to the count
specified.
Signed-off-by: Avantika Mathur <mat...@us.ibm.com>
---
Index: libhugetlbfs/hugeadm.c
===================================================================
--- libhugetlbfs.orig/hugeadm.c 2009-03-19 20:52:23.000000000 -0700
+++ libhugetlbfs/hugeadm.c 2009-03-19 21:46:54.000000000 -0700
@@ -1,3 +1,4 @@
+
/***************************************************************************
* User front end for using huge pages Copyright (C) 2008, IBM *
* *
@@ -67,6 +68,9 @@
OPTION("--list-all-mounts", "List all current hugetlbfs mount points");
OPTION("--pool-list", "List all pools");
+ OPTION("--hard", "specified before --pool-pages-min to make");
+ CONT("multiple attempts at adjusting the pool size to the");
+ CONT("specified count");
OPTION("--pool-pages-min <size>:[+|-]<count>", "");
CONT("Adjust pool 'size' lower bound");
OPTION("--pool-pages-max <size>:[+|-]<count>", "");
@@ -97,6 +101,7 @@
}
int opt_dry_run = 0;
+int opt_hard = 0;
/*
* getopts return values for options which are long only.
@@ -518,16 +523,23 @@
INFO("setting HUGEPAGES_OC to %ld\n", (max - min));
set_huge_page_counter(page_size, HUGEPAGES_OC, (max - min));
}
- if (pools[pos].minimum != min) {
+
+ if (opt_hard)
+ cnt = 5;
+ else
+ cnt = 1;
+
+ while ((pools[pos].minimum != min) && (cnt > 0)) {
INFO("setting HUGEPAGES_TOTAL to %ld\n", min);
set_huge_page_counter(page_size, HUGEPAGES_TOTAL, min);
+ get_pool_size(page_size, &pools[pos]);
+ cnt--;
}
/*
* HUGEPAGES_TOTAL is not guarenteed to check to exactly the figure
* requested should there be insufficient pages. Check the new
* value and adjust HUGEPAGES_OC accordingly.
*/
- get_pool_size(page_size, &pools[pos]);
if (pools[pos].minimum != min) {
WARNING("failed to set pool minimum to %ld became %ld\n",
min, pools[pos].minimum);
@@ -582,6 +594,7 @@
{"page-sizes", no_argument, NULL, LONG_PAGE_SIZES},
{"page-sizes-all", no_argument, NULL, LONG_PAGE_AVAIL},
{"dry-run", no_argument, NULL, 'd'},
+ {"hard", no_argument, NULL, 'r'},
{0},
};
@@ -619,6 +632,10 @@
case -1:
break;
+ case 'r':
+ opt_hard = 1;
+ continue;
+
case LONG_LIST_ALL_MOUNTS:
mounts_list_all();
break;
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Libhugetlbfs-devel mailing list
Libhugetlbfs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel