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",
>
> 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 c
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 va
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
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 += s
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
>
H
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
>
>>
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_str
On 9/1/07, Andrew Morton <[EMAIL PROTECTED]> wrote:
> On Fri, 31 Aug 2007 00:22:46 +0530
> Balbir Singh <[EMAIL PROTECTED]> wrote:
>
> > +/*
> > + * Strategy routines for formating read/write data
> > + */
> > +int mem_container_read_strategy(unsigned long long val, char *buf)
> > +{
> > + retu
On Fri, 31 Aug 2007 00:22:46 +0530
Balbir Singh <[EMAIL PROTECTED]> wrote:
> +/*
> + * Strategy routines for formating read/write data
> + */
> +int mem_container_read_strategy(unsigned long long val, char *buf)
> +{
> + return sprintf(buf, "%llu Bytes\n", val);
> +}
It's a bit cheesy to be p
Balbir Singh wrote:
> Change the interface to use kilobytes instead of pages. Page sizes can vary
> across platforms and configurations. A new strategy routine has been added
> to the resource counters infrastructure to format the data as desired.
>
Typo, the description should be
Changelog for
KAMEZAWA Hiroyuki wrote:
> On Thu, 30 Aug 2007 04:07:11 +0530
> Balbir Singh <[EMAIL PROTECTED]> wrote:
>> 1. Several people recommended it
>> 2. Herbert mentioned that they've moved to that interface and it
>>was working fine for them.
>>
>
> I have no strong opinion. But how about Mega bytes
On Thu, 30 Aug 2007 04:07:11 +0530
Balbir Singh <[EMAIL PROTECTED]> wrote:
> 1. Several people recommended it
> 2. Herbert mentioned that they've moved to that interface and it
>was working fine for them.
>
I have no strong opinion. But how about Mega bytes ? (too big ?)
There will be no roun
Dave Hansen wrote:
> On Thu, 2007-08-30 at 03:57 +0530, Balbir Singh wrote:
>> True, mmap() is a good example of such an interface for developers, I
>> am not sure about system admins though.
>>
>> To quote Andrew
>>
>> Reporting tools could run getpagesize() and do the arithmetic, but we
>> gener
Dave Hansen wrote:
> On Wed, 2007-08-29 at 15:20 -0700, Paul Menage wrote:
>> I'd argue that having the user's specified limit be truncated to the
>> page size is less confusing than giving an EINVAL if it's not page
>> aligned.
>
> Do we truncate mmap() values to the nearest page so to not confus
On Thu, 2007-08-30 at 03:57 +0530, Balbir Singh wrote:
> True, mmap() is a good example of such an interface for developers, I
> am not sure about system admins though.
>
> To quote Andrew
>
> Reporting tools could run getpagesize() and do the arithmetic, but we
> generally try to avoid exposing
Dave Hansen wrote:
> On Thu, 2007-08-30 at 03:34 +0530, Balbir Singh wrote:
>> I've thought about this before. The problem is that a user could
>> set his limit to 1 bytes, but would then see the usage and
>> limit round to the closest page boundary. This can be confusing
>> to a user.
>
> Tr
On Wed, 2007-08-29 at 15:20 -0700, Paul Menage wrote:
>
> I'd argue that having the user's specified limit be truncated to the
> page size is less confusing than giving an EINVAL if it's not page
> aligned.
Do we truncate mmap() values to the nearest page so to not confuse the
user? ;)
Imagine a
On 8/29/07, Dave Hansen <[EMAIL PROTECTED]> wrote:
> On Thu, 2007-08-30 at 03:34 +0530, Balbir Singh wrote:
> > I've thought about this before. The problem is that a user could
> > set his limit to 1 bytes, but would then see the usage and
> > limit round to the closest page boundary. This can
On Thu, 2007-08-30 at 03:34 +0530, Balbir Singh wrote:
> I've thought about this before. The problem is that a user could
> set his limit to 1 bytes, but would then see the usage and
> limit round to the closest page boundary. This can be confusing
> to a user.
True, but we're lying if we all
Dave Hansen wrote:
> On Wed, 2007-08-29 at 16:40 +0530, Balbir Singh wrote:
>>
>> @@ -352,7 +353,7 @@ int mem_container_charge(struct page *pa
>> kfree(pc);
>> pc = race_pc;
>> atomic_inc(&pc->ref_cnt);
>> - res_counter_uncharge(&mem->re
On Wed, 2007-08-29 at 16:40 +0530, Balbir Singh wrote:
>
>
> @@ -352,7 +353,7 @@ int mem_container_charge(struct page *pa
> kfree(pc);
> pc = race_pc;
> atomic_inc(&pc->ref_cnt);
> - res_counter_uncharge(&mem->res, 1);
> +
On 8/29/07, Balbir Singh <[EMAIL PROTECTED]> wrote:
> >
> > This seems a bit inconsistent - if you write a value to a limit file,
> > then the value that you read back is reduced by a factor of 1024?
> > Having the "(kB)" suffix isn't really a big help to automated
> > middleware.
> >
>
> Why is th
Paul Menage wrote:
> On 8/29/07, Balbir Singh <[EMAIL PROTECTED]> wrote:
>> Change the interface to use kilobytes instead of pages. Page sizes can vary
>> across platforms and configurations. A new strategy routine has been added
>> to the resource counters infrastructure to format the data as desi
On 8/29/07, Balbir Singh <[EMAIL PROTECTED]> wrote:
>
> Change the interface to use kilobytes instead of pages. Page sizes can vary
> across platforms and configurations. A new strategy routine has been added
> to the resource counters infrastructure to format the data as desired.
>
> Suggested by
25 matches
Mail list logo