On Fri, Oct 10, 2008 at 12:22:40PM +0100, Mel Gorman wrote:
> On (09/10/08 20:20), Andy Whitcroft didst pronounce:
> > Allow resize of specific pools via the --pool-minimum-adjust and
> > --pool-maximum-adjust commands.  The first affects the number of static
> > pages in the pool, the second affects the number of overcommit pages
> > for the pool.  These are exposed as lower and upper bound on the pool
> > to match the display in --pool-list.  Adjustments are either absolute,
> > or relative with a + or - prefix.  For exmaple the following incantion
> > increases the 2MB page pool minimum by 10 pages.
> > 
> >     --pool-minimum-adjust 2048kb:+10
> > 
> > Signed-off-by: Andy Whitcroft <[EMAIL PROTECTED]>
> > ---
> >  hpoolcfg.c |   86 
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
> >  1 files changed, 84 insertions(+), 2 deletions(-)
> > 
> > diff --git a/hpoolcfg.c b/hpoolcfg.c
> > index 9e21864..8b70389 100644
> > --- a/hpoolcfg.c
> > +++ b/hpoolcfg.c
> > @@ -35,6 +35,7 @@
> >  
> >  #define REPORT_UTIL "hpoolcfg"
> >  #include "libhugetlbfs_internal.h"
> > +#include "hugetlbfs.h"
> >  
> >  extern int optind;
> >  extern char *optarg;
> > @@ -48,6 +49,10 @@ void print_usage()
> >     fprintf(stderr, "options:\n");
> >  
> >     OPTION("--pool-list", "List all pools");
> > +   OPTION("--pool-pages-min <size>=[+|-]<count>", "");
> > +   CONT("Adjust pool 'size' lower bound");
> > +   OPTION("--pool-pages-max <size>=[+|-]<count>", "");
> > +   CONT("Adjust pool 'size' upper bound");
> >  
> 
> The options are using = when the code is using :

Yes fixed.

> Fuzzing with random input
> 
> [EMAIL PROTECTED]:~/git/emunson-libhugetlbfs$ sudo ./obj/hpoolcfg 
> --pool-pages-min 4M:13
> [EMAIL PROTECTED]:~/git/emunson-libhugetlbfs$ ./obj/hpoolcfg --pool-list
>       Size  Minimum  Current  Maximum
>    4194304       13       13       33
> [EMAIL PROTECTED]:~/git/emunson-libhugetlbfs$ sudo ./obj/hpoolcfg 
> --pool-pages-min 4M:-15
> [EMAIL PROTECTED]:~/git/emunson-libhugetlbfs$ ./obj/hpoolcfg --pool-list
>       Size  Minimum  Current  Maximum
>    4194304      299      299      319
> 
> D'OH
> 
> Valid input includes
> 
> 4M:++
> 
> 4M:+
> 
> and the like. It doesn't do anything wrong, just nothing gets printed
> 
> I haven't read the code yet, reporting this sooner rather than later

Sorted this out:

[EMAIL PROTECTED] ./obj/hpoolcfg --pool-pages-max 16M:++
hpoolcfg [brain:8772]: ERROR: ++: invalid adjustment
[EMAIL PROTECTED] ./obj/hpoolcfg --pool-pages-max 16M:+
hpoolcfg [brain:8773]: ERROR: +: invalid adjustment
[EMAIL PROTECTED] ./obj/hpoolcfg --pool-pages-max 16M:-
hpoolcfg [brain:8778]: ERROR: -: invalid adjustment
[EMAIL PROTECTED] ./obj/hpoolcfg --pool-pages-max 16M:--
hpoolcfg [brain:8786]: ERROR: --: invalid adjustment
[EMAIL PROTECTED] ./obj/hpoolcfg --pool-pages-max 16M:-10-
hpoolcfg [brain:8787]: ERROR: -10-: invalid adjustment

-apw

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Libhugetlbfs-devel mailing list
Libhugetlbfs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel

Reply via email to