[Libhugetlbfs-devel] Why I Think sexual Pleasure Should Be Btoh Ways

2009-05-11 Thread Shetrone Wechselblatt
inline: Shetrone.png--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com___
Libhugetlbfs-devel mailing list
Libhugetlbfs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel


[Libhugetlbfs-devel] [PATCH] hugeadm: Enable/Disable the use of ZONE_MOVABLE for the allocation of huge pages

2009-05-11 Thread Mel Gorman
The kernel partitions memory if kernelcore= or movablecore= is specified on
the kernel command line creating a ZONE_MOVABLE zone. This zone contains
only pages that the kernel knows it can reclaim. Unless mlock() is used,
the hugepage pool is guaranteed to be able to grow to the size of the memory
partition but the partition is not used by default as the intention of the
partition may also be to hot-remove the memory later. Whether the zone is used
or not is determined by the value in /proc/sys/vm/hugepages_treat_as_movable.

This patch adds the option to hugeadm to enable/disable the use of
ZONE_MOVABLE for the allocation of huge pages.

Signed-off-by: Mel Gorman m...@csn.ul.ie
--- 
 hugeadm.c |   33 +
 man/hugeadm.8 |   22 ++
 2 files changed, 55 insertions(+)

diff --git a/hugeadm.c b/hugeadm.c
index 0ad69cc..cb2f1dd 100644
--- a/hugeadm.c
+++ b/hugeadm.c
@@ -62,6 +62,7 @@ extern char *optarg;
 #define OPT_MAX 4096
 
 #define PROCMOUNTS /proc/mounts
+#define PROCHUGEPAGES_MOVABLE /proc/sys/vm/hugepages_treat_as_movable
 #define FS_NAME hugetlbfs
 #define MIN_COL 20
 #define MAX_SIZE_MNTENT (64 + PATH_MAX + 32 + 128 + 2 * sizeof(int))
@@ -84,6 +85,8 @@ void print_usage()
CONT(Adjust pool 'size' lower bound);
OPTION(--pool-pages-max size:[+|-]count, );
CONT(Adjust pool 'size' upper bound);
+   OPTION(--enable-zone-movable, Use ZONE_MOVABLE for huge pages);
+   OPTION(--disable-zone-movable, Do not use ZONE_MOVABLE for huge 
pages);
OPTION(--create-mounts, Creates a mount point for each available);
CONT(huge page size on this system under /var/lib/hugetlbfs);
OPTION(--create-user-mounts user, );
@@ -115,6 +118,7 @@ void print_usage()
 
 int opt_dry_run = 0;
 int opt_hard = 0;
+int opt_movable = -1;
 int verbose_level = VERBOSITY_DEFAULT;
 
 void setup_environment(char *var, char *val)
@@ -126,6 +130,18 @@ void setup_environment(char *var, char *val)
printf(%s='%s'\n, var, val);
 }
 
+/* Enable/disable allocation of hugepages from ZONE_MOVABLE */
+void setup_zone_movable(int able)
+{
+   DEBUG(Setting %s to %d\n, PROCHUGEPAGES_MOVABLE, able);
+
+   /* libhugetlbfs reports any error that occurs */
+   file_write_ulong(PROCHUGEPAGES_MOVABLE, (unsigned long)able);
+
+   if (opt_dry_run)
+   printf(echo %d  %s\n, able, PROCHUGEPAGES_MOVABLE);
+}
+
 void verbose_init(void)
 {
char *env;
@@ -178,6 +194,10 @@ void verbose_expose(void)
 #define LONG_POOL_MIN_ADJ  (LONG_POOL|'m')
 #define LONG_POOL_MAX_ADJ  (LONG_POOL|'M')
 
+#define LONG_MOVABLE   ('z'  8)
+#define LONG_MOVABLE_ENABLE(LONG_MOVABLE|'e')
+#define LONG_MOVABLE_DISABLE   (LONG_MOVABLE|'d')
+
 #define LONG_HARD  ('h'  8)
 
 #define LONG_PAGE  ('P'  8)
@@ -761,6 +781,8 @@ int main(int argc, char** argv)
{pool-list, no_argument, NULL, LONG_POOL_LIST},
{pool-pages-min, required_argument, NULL, LONG_POOL_MIN_ADJ},
{pool-pages-max, required_argument, NULL, LONG_POOL_MAX_ADJ},
+   {enable-zone-movable, no_argument, NULL, LONG_MOVABLE_ENABLE},
+   {disable-zone-movable, no_argument, NULL, 
LONG_MOVABLE_DISABLE},
{hard, no_argument, NULL, LONG_HARD},
{create-mounts, no_argument, NULL, LONG_CREATE_MOUNTS},
{create-user-mounts, required_argument, NULL, 
LONG_CREATE_USER_MOUNTS},
@@ -838,6 +860,14 @@ int main(int argc, char** argv)
opt_min_adj[minadj_count++] = optarg;
 break;
 
+   case LONG_MOVABLE_ENABLE:
+   opt_movable = 1;
+   break;
+
+   case LONG_MOVABLE_DISABLE:
+   opt_movable = 0;
+   break;
+
case LONG_CREATE_MOUNTS:
opt_create_mounts = 1;
break;
@@ -883,6 +913,9 @@ int main(int argc, char** argv)
if (opt_pool_list)
pool_list();
 
+   if (opt_movable != -1)
+   setup_zone_movable(opt_movable);
+
while (--minadj_count = 0) {
if (! kernel_has_overcommit())
pool_adjust(opt_min_adj[minadj_count], POOL_BOTH);
diff --git a/man/hugeadm.8 b/man/hugeadm.8
index 5349c26..62aff75 100644
--- a/man/hugeadm.8
+++ b/man/hugeadm.8
@@ -118,6 +118,28 @@ the number of huge pages requested by applications is 
between the Minimum and
 Maximum pool sizes.
 
 .TP
+.B --enable-zone-movable
+
+This option enables the use of the MOVABLE zone for the allocation of
+hugepages. This zone is created when kernelcore= or movablecore= are specified
+on the kernel command line but the zone is not used for the allocation of
+huge pages by default as the intended use for the zone may be to guarantee
+that memory can be off-lined and hot-removed. The kernel guarantees that

[Libhugetlbfs-devel] Tantra fjor Beginners

2009-05-11 Thread Liverance Segee
inline: Liverance.png--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com___
Libhugetlbfs-devel mailing list
Libhugetlbfs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel