Re: [-mm PATCH] Memory controller improve user interface (v3)

2007-09-05 Thread Balbir Singh
On Sun, Sep 02, 2007 at 09:53:22PM -0700, Paul Menage wrote: > On 9/2/07, Balbir Singh <[EMAIL PROTECTED]> wrote: > > - s += sprintf(s, "%lu\n", *val); > > + if (read_strategy) > > + s += read_strategy(*val, s); > > + else > > + s += sprintf(s,

Re: [-mm PATCH] Memory controller improve user interface (v3)

2007-09-05 Thread Balbir Singh
> > But val is an unsigned long long*. So printing *val with %lu will > break (at least a warning, and maybe corruption if you had other > parameters) on 32-bit archs. > How does this look? Changelog for version 4 1. Make all resource counters members unsigned long long 2. Use documentation

Re: [-mm PATCH] Memory controller improve user interface (v3)

2007-09-05 Thread Balbir Singh
But val is an unsigned long long*. So printing *val with %lu will break (at least a warning, and maybe corruption if you had other parameters) on 32-bit archs. How does this look? Changelog for version 4 1. Make all resource counters members unsigned long long 2. Use documentation

Re: [-mm PATCH] Memory controller improve user interface (v3)

2007-09-05 Thread Balbir Singh
On Sun, Sep 02, 2007 at 09:53:22PM -0700, Paul Menage wrote: On 9/2/07, Balbir Singh [EMAIL PROTECTED] wrote: - s += sprintf(s, %lu\n, *val); + if (read_strategy) + s += read_strategy(*val, s); + else + s += sprintf(s, %lu\n, *val); This

Re: [-mm PATCH] Memory controller improve user interface (v3)

2007-09-04 Thread Dave Hansen
On Sun, 2007-09-02 at 16:20 +0530, Balbir Singh wrote: > > +Setting a limit to a number that is not a multiple of page size causes > +rounding up of the value. The user must check back to see (by reading > +memory.limit_in_bytes), to check for differences between desired values and > +committed

Re: [-mm PATCH] Memory controller improve user interface (v3)

2007-09-04 Thread Balbir Singh
Paul Menage wrote: > On 9/3/07, Balbir Singh <[EMAIL PROTECTED]> wrote: >> Paul Menage wrote: >>> On 9/2/07, Balbir Singh <[EMAIL PROTECTED]> wrote: - s += sprintf(s, "%lu\n", *val); + if (read_strategy) + s += read_strategy(*val, s); + else

Re: [-mm PATCH] Memory controller improve user interface (v3)

2007-09-04 Thread Paul Menage
On 9/3/07, Balbir Singh <[EMAIL PROTECTED]> wrote: > Paul Menage wrote: > > On 9/2/07, Balbir Singh <[EMAIL PROTECTED]> wrote: > >> - s += sprintf(s, "%lu\n", *val); > >> + if (read_strategy) > >> + s += read_strategy(*val, s); > >> + else > >> + s +=

Re: [-mm PATCH] Memory controller improve user interface (v3)

2007-09-04 Thread Paul Menage
On 9/3/07, Balbir Singh [EMAIL PROTECTED] wrote: Paul Menage wrote: On 9/2/07, Balbir Singh [EMAIL PROTECTED] wrote: - s += sprintf(s, %lu\n, *val); + if (read_strategy) + s += read_strategy(*val, s); + else + s += sprintf(s, %lu\n, *val);

Re: [-mm PATCH] Memory controller improve user interface (v3)

2007-09-04 Thread Balbir Singh
Paul Menage wrote: On 9/3/07, Balbir Singh [EMAIL PROTECTED] wrote: Paul Menage wrote: On 9/2/07, Balbir Singh [EMAIL PROTECTED] wrote: - s += sprintf(s, %lu\n, *val); + if (read_strategy) + s += read_strategy(*val, s); + else + s += sprintf(s,

Re: [-mm PATCH] Memory controller improve user interface (v3)

2007-09-04 Thread Dave Hansen
On Sun, 2007-09-02 at 16:20 +0530, Balbir Singh wrote: +Setting a limit to a number that is not a multiple of page size causes +rounding up of the value. The user must check back to see (by reading +memory.limit_in_bytes), to check for differences between desired values and +committed

Re: [-mm PATCH] Memory controller improve user interface (v3)

2007-09-03 Thread Balbir Singh
Paul Menage wrote: > On 9/2/07, Balbir Singh <[EMAIL PROTECTED]> wrote: >> - s += sprintf(s, "%lu\n", *val); >> + if (read_strategy) >> + s += read_strategy(*val, s); >> + else >> + s += sprintf(s, "%lu\n", *val); > > This would be better as %llu >

Re: [-mm PATCH] Memory controller improve user interface (v3)

2007-09-03 Thread Balbir Singh
Paul Menage wrote: > On 9/2/07, Balbir Singh <[EMAIL PROTECTED]> wrote: >> - s += sprintf(s, "%lu\n", *val); >> + if (read_strategy) >> + s += read_strategy(*val, s); >> + else >> + s += sprintf(s, "%lu\n", *val); > > This would be better as %llu >

Re: [-mm PATCH] Memory controller improve user interface (v3)

2007-09-03 Thread Balbir Singh
Paul Menage wrote: On 9/2/07, Balbir Singh [EMAIL PROTECTED] wrote: - s += sprintf(s, %lu\n, *val); + if (read_strategy) + s += read_strategy(*val, s); + else + s += sprintf(s, %lu\n, *val); This would be better as %llu + tmp

Re: [-mm PATCH] Memory controller improve user interface (v3)

2007-09-03 Thread Balbir Singh
Paul Menage wrote: On 9/2/07, Balbir Singh [EMAIL PROTECTED] wrote: - s += sprintf(s, %lu\n, *val); + if (read_strategy) + s += read_strategy(*val, s); + else + s += sprintf(s, %lu\n, *val); This would be better as %llu Hi, Paul, This does

Re: [-mm PATCH] Memory controller improve user interface (v3)

2007-09-02 Thread Paul Menage
On 9/2/07, Balbir Singh <[EMAIL PROTECTED]> wrote: > - s += sprintf(s, "%lu\n", *val); > + if (read_strategy) > + s += read_strategy(*val, s); > + else > + s += sprintf(s, "%lu\n", *val); This would be better as %llu > + tmp =

[-mm PATCH] Memory controller improve user interface (v3)

2007-09-02 Thread Balbir Singh
Changelog for version 3 1. Change memory.limit and memory.usage to memory.limit_in_bytes and memory.usage_in_bytes respectively 2. Remove "Bytes" from the output of the limit and usage counters 3. Remove spurious printk Changelog for version 2 1. Back end tracking is done in bytes, round up

Re: [-mm PATCH] Memory controller improve user interface (v3)

2007-09-02 Thread Paul Menage
On 9/2/07, Balbir Singh [EMAIL PROTECTED] wrote: - s += sprintf(s, %lu\n, *val); + if (read_strategy) + s += read_strategy(*val, s); + else + s += sprintf(s, %lu\n, *val); This would be better as %llu + tmp = simple_strtoul(buf,