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,
>
> 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
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
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
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
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 +=
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);
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,
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
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
>
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
>
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
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
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 =
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
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,
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)
> > +{
> > +
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
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 printing
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)
+{
+ return sprintf(buf,
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
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 David Rientjes, Andrew Morton and Herbert Poetzl
Tested on
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
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 ? (too big
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 David Rientjes, Andrew Morton and Herbert Poetzl
Tested on
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
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
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
>>
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
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.
>
>
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
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
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(>ref_cnt);
>> - res_counter_uncharge(>res, 1);
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(>ref_cnt);
> - res_counter_uncharge(>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
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
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
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 David Rientjes, Andrew Morton and Herbert Poetzl
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 David Rientjes, Andrew Morton and Herbert Poetzl
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 David
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 desired.
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 that? Is it because
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);
+
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-res, 1);
+
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 allow
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 be
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
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.
True, but
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
quote
Reporting tools could run getpagesize() and do the arithmetic, but we
generally try to avoid exposing
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 confuse the
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
quote
Reporting tools could run getpagesize() and do the arithmetic, but we
generally try
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 rounding
55 matches
Mail list logo