Re: [PATCH 2/2] ResCounter: Use read_uint in memory controller

2008-02-23 Thread Paul Menage
On Sat, Feb 23, 2008 at 6:47 PM, Balbir Singh <[EMAIL PROTECTED]> wrote:
>  >> res_counter_read_u64() I'd also want to rename all the other
>  >> *read_uint functions/fields to *read_u64 too. Can I do that in a
>  >> separate patch?
>  >>
>  >
>  > Sounds sensible to me.
>  >
>
>  Sure, fair enough.
>

Actually, since multiple people were asking for this change I did the
search/replace and sent it out already (as a precursor of the other
patches in the series that I sent today).

Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] ResCounter: Use read_uint in memory controller

2008-02-23 Thread Balbir Singh
Andrew Morton wrote:
> On Sat, 23 Feb 2008 06:33:34 -0800 "Paul Menage" <[EMAIL PROTECTED]> wrote:
> 
>> On Thu, Feb 21, 2008 at 8:29 PM, Balbir Singh <[EMAIL PROTECTED]> wrote:
>>>  Looks good, except for the name uint(), can we make it u64(). Integers are 
>>> 32
>>>  bit on both ILP32 and LP64, but we really read/write 64 bit values.
>> Yes, that's true. But read_uint() is more consistent with all the
>> other instances in cgroups and subsystems. So if we were to call it
>> res_counter_read_u64() I'd also want to rename all the other
>> *read_uint functions/fields to *read_u64 too. Can I do that in a
>> separate patch?
>>
> 
> Sounds sensible to me.
> 

Sure, fair enough.

-- 
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] ResCounter: Use read_uint in memory controller

2008-02-23 Thread Andrew Morton
On Sat, 23 Feb 2008 06:33:34 -0800 "Paul Menage" <[EMAIL PROTECTED]> wrote:

> On Thu, Feb 21, 2008 at 8:29 PM, Balbir Singh <[EMAIL PROTECTED]> wrote:
> >
> >  Looks good, except for the name uint(), can we make it u64(). Integers are 
> > 32
> >  bit on both ILP32 and LP64, but we really read/write 64 bit values.
> 
> Yes, that's true. But read_uint() is more consistent with all the
> other instances in cgroups and subsystems. So if we were to call it
> res_counter_read_u64() I'd also want to rename all the other
> *read_uint functions/fields to *read_u64 too. Can I do that in a
> separate patch?
> 

Sounds sensible to me.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] ResCounter: Use read_uint in memory controller

2008-02-23 Thread Paul Menage
On Thu, Feb 21, 2008 at 8:29 PM, Balbir Singh <[EMAIL PROTECTED]> wrote:
>
>  Looks good, except for the name uint(), can we make it u64(). Integers are 32
>  bit on both ILP32 and LP64, but we really read/write 64 bit values.

Yes, that's true. But read_uint() is more consistent with all the
other instances in cgroups and subsystems. So if we were to call it
res_counter_read_u64() I'd also want to rename all the other
*read_uint functions/fields to *read_u64 too. Can I do that in a
separate patch?

Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] ResCounter: Use read_uint in memory controller

2008-02-23 Thread Balbir Singh
Andrew Morton wrote:
> On Fri, 22 Feb 2008 09:59:41 +0530 Balbir Singh <[EMAIL PROTECTED]> wrote:
> 
>> [EMAIL PROTECTED] wrote:
>>> Update the memory controller to use read_uint for its
>>> limit/usage/failcnt control files, calling the new
>>> res_counter_read_uint() function.
>>>
>>> Signed-off-by: Paul Menage <[EMAIL PROTECTED]>
>>>
>> Hi, Paul,
>>
>> Looks good, except for the name uint(), can we make it u64(). Integers are 32
>> bit on both ILP32 and LP64, but we really read/write 64 bit values.
>>
> 
> yup, I agree.  Even though I don't know what ILP32 and LP64 are ;)

ILP32 and LP64 are programming models. They stand for Integer, Long, Pointer 32
bit for 32 bit systems and Long, Pointer 64 bit for 64 bit systems (which
implies integers are 32 bit).

-- 
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] ResCounter: Use read_uint in memory controller

2008-02-23 Thread KOSAKI Motohiro
Hi Andrew,

> yup, I agree.  Even though I don't know what ILP32 and LP64 are ;)

ILP32: integer and long and pointer size is 32bit
LP64:  long and pointer size is 64bit, but int size is 32bit

linux 32bit kernel obey ILP32 model, 64bit kernel obey LP64.

Thanks.


- kosaki

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] ResCounter: Use read_uint in memory controller

2008-02-23 Thread Andrew Morton
On Fri, 22 Feb 2008 09:59:41 +0530 Balbir Singh <[EMAIL PROTECTED]> wrote:

> [EMAIL PROTECTED] wrote:
> > Update the memory controller to use read_uint for its
> > limit/usage/failcnt control files, calling the new
> > res_counter_read_uint() function.
> > 
> > Signed-off-by: Paul Menage <[EMAIL PROTECTED]>
> > 
> 
> Hi, Paul,
> 
> Looks good, except for the name uint(), can we make it u64(). Integers are 32
> bit on both ILP32 and LP64, but we really read/write 64 bit values.
> 

yup, I agree.  Even though I don't know what ILP32 and LP64 are ;)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] ResCounter: Use read_uint in memory controller

2008-02-23 Thread Andrew Morton
On Fri, 22 Feb 2008 09:59:41 +0530 Balbir Singh [EMAIL PROTECTED] wrote:

 [EMAIL PROTECTED] wrote:
  Update the memory controller to use read_uint for its
  limit/usage/failcnt control files, calling the new
  res_counter_read_uint() function.
  
  Signed-off-by: Paul Menage [EMAIL PROTECTED]
  
 
 Hi, Paul,
 
 Looks good, except for the name uint(), can we make it u64(). Integers are 32
 bit on both ILP32 and LP64, but we really read/write 64 bit values.
 

yup, I agree.  Even though I don't know what ILP32 and LP64 are ;)
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] ResCounter: Use read_uint in memory controller

2008-02-23 Thread KOSAKI Motohiro
Hi Andrew,

 yup, I agree.  Even though I don't know what ILP32 and LP64 are ;)

ILP32: integer and long and pointer size is 32bit
LP64:  long and pointer size is 64bit, but int size is 32bit

linux 32bit kernel obey ILP32 model, 64bit kernel obey LP64.

Thanks.


- kosaki

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] ResCounter: Use read_uint in memory controller

2008-02-23 Thread Balbir Singh
Andrew Morton wrote:
 On Fri, 22 Feb 2008 09:59:41 +0530 Balbir Singh [EMAIL PROTECTED] wrote:
 
 [EMAIL PROTECTED] wrote:
 Update the memory controller to use read_uint for its
 limit/usage/failcnt control files, calling the new
 res_counter_read_uint() function.

 Signed-off-by: Paul Menage [EMAIL PROTECTED]

 Hi, Paul,

 Looks good, except for the name uint(), can we make it u64(). Integers are 32
 bit on both ILP32 and LP64, but we really read/write 64 bit values.

 
 yup, I agree.  Even though I don't know what ILP32 and LP64 are ;)

ILP32 and LP64 are programming models. They stand for Integer, Long, Pointer 32
bit for 32 bit systems and Long, Pointer 64 bit for 64 bit systems (which
implies integers are 32 bit).

-- 
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] ResCounter: Use read_uint in memory controller

2008-02-23 Thread Paul Menage
On Thu, Feb 21, 2008 at 8:29 PM, Balbir Singh [EMAIL PROTECTED] wrote:

  Looks good, except for the name uint(), can we make it u64(). Integers are 32
  bit on both ILP32 and LP64, but we really read/write 64 bit values.

Yes, that's true. But read_uint() is more consistent with all the
other instances in cgroups and subsystems. So if we were to call it
res_counter_read_u64() I'd also want to rename all the other
*read_uint functions/fields to *read_u64 too. Can I do that in a
separate patch?

Paul
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] ResCounter: Use read_uint in memory controller

2008-02-23 Thread Andrew Morton
On Sat, 23 Feb 2008 06:33:34 -0800 Paul Menage [EMAIL PROTECTED] wrote:

 On Thu, Feb 21, 2008 at 8:29 PM, Balbir Singh [EMAIL PROTECTED] wrote:
 
   Looks good, except for the name uint(), can we make it u64(). Integers are 
  32
   bit on both ILP32 and LP64, but we really read/write 64 bit values.
 
 Yes, that's true. But read_uint() is more consistent with all the
 other instances in cgroups and subsystems. So if we were to call it
 res_counter_read_u64() I'd also want to rename all the other
 *read_uint functions/fields to *read_u64 too. Can I do that in a
 separate patch?
 

Sounds sensible to me.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] ResCounter: Use read_uint in memory controller

2008-02-23 Thread Balbir Singh
Andrew Morton wrote:
 On Sat, 23 Feb 2008 06:33:34 -0800 Paul Menage [EMAIL PROTECTED] wrote:
 
 On Thu, Feb 21, 2008 at 8:29 PM, Balbir Singh [EMAIL PROTECTED] wrote:
  Looks good, except for the name uint(), can we make it u64(). Integers are 
 32
  bit on both ILP32 and LP64, but we really read/write 64 bit values.
 Yes, that's true. But read_uint() is more consistent with all the
 other instances in cgroups and subsystems. So if we were to call it
 res_counter_read_u64() I'd also want to rename all the other
 *read_uint functions/fields to *read_u64 too. Can I do that in a
 separate patch?

 
 Sounds sensible to me.
 

Sure, fair enough.

-- 
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] ResCounter: Use read_uint in memory controller

2008-02-23 Thread Paul Menage
On Sat, Feb 23, 2008 at 6:47 PM, Balbir Singh [EMAIL PROTECTED] wrote:
   res_counter_read_u64() I'd also want to rename all the other
   *read_uint functions/fields to *read_u64 too. Can I do that in a
   separate patch?
  
  
   Sounds sensible to me.
  

  Sure, fair enough.


Actually, since multiple people were asking for this change I did the
search/replace and sent it out already (as a precursor of the other
patches in the series that I sent today).

Paul
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] ResCounter: Use read_uint in memory controller

2008-02-21 Thread Pavel Emelyanov
[EMAIL PROTECTED] wrote:
> Update the memory controller to use read_uint for its
> limit/usage/failcnt control files, calling the new
> res_counter_read_uint() function.
> 
> Signed-off-by: Paul Menage <[EMAIL PROTECTED]>

Acked-by: Pavel Emelyanov <[EMAIL PROTECTED]>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] ResCounter: Use read_uint in memory controller

2008-02-21 Thread Balbir Singh
[EMAIL PROTECTED] wrote:
> Update the memory controller to use read_uint for its
> limit/usage/failcnt control files, calling the new
> res_counter_read_uint() function.
> 
> Signed-off-by: Paul Menage <[EMAIL PROTECTED]>
> 

Hi, Paul,

Looks good, except for the name uint(), can we make it u64(). Integers are 32
bit on both ILP32 and LP64, but we really read/write 64 bit values.

-- 
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] ResCounter: Use read_uint in memory controller

2008-02-21 Thread menage
Update the memory controller to use read_uint for its
limit/usage/failcnt control files, calling the new
res_counter_read_uint() function.

Signed-off-by: Paul Menage <[EMAIL PROTECTED]>

---
 mm/memcontrol.c |   15 ++-
 1 file changed, 6 insertions(+), 9 deletions(-)

Index: rescounter-2.6.25-rc2-mm1/mm/memcontrol.c
===
--- rescounter-2.6.25-rc2-mm1.orig/mm/memcontrol.c
+++ rescounter-2.6.25-rc2-mm1/mm/memcontrol.c
@@ -922,13 +922,10 @@ int mem_cgroup_write_strategy(char *buf,
return 0;
 }
 
-static ssize_t mem_cgroup_read(struct cgroup *cont,
-   struct cftype *cft, struct file *file,
-   char __user *userbuf, size_t nbytes, loff_t *ppos)
+static u64 mem_cgroup_read(struct cgroup *cont, struct cftype *cft)
 {
-   return res_counter_read(_cgroup_from_cont(cont)->res,
-   cft->private, userbuf, nbytes, ppos,
-   NULL);
+   return res_counter_read_uint(_cgroup_from_cont(cont)->res,
+cft->private);
 }
 
 static ssize_t mem_cgroup_write(struct cgroup *cont, struct cftype *cft,
@@ -1024,18 +1021,18 @@ static struct cftype mem_cgroup_files[] 
{
.name = "usage_in_bytes",
.private = RES_USAGE,
-   .read = mem_cgroup_read,
+   .read_uint = mem_cgroup_read,
},
{
.name = "limit_in_bytes",
.private = RES_LIMIT,
.write = mem_cgroup_write,
-   .read = mem_cgroup_read,
+   .read_uint = mem_cgroup_read,
},
{
.name = "failcnt",
.private = RES_FAILCNT,
-   .read = mem_cgroup_read,
+   .read_uint = mem_cgroup_read,
},
{
.name = "force_empty",

--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] ResCounter: Use read_uint in memory controller

2008-02-21 Thread menage
Update the memory controller to use read_uint for its
limit/usage/failcnt control files, calling the new
res_counter_read_uint() function.

Signed-off-by: Paul Menage [EMAIL PROTECTED]

---
 mm/memcontrol.c |   15 ++-
 1 file changed, 6 insertions(+), 9 deletions(-)

Index: rescounter-2.6.25-rc2-mm1/mm/memcontrol.c
===
--- rescounter-2.6.25-rc2-mm1.orig/mm/memcontrol.c
+++ rescounter-2.6.25-rc2-mm1/mm/memcontrol.c
@@ -922,13 +922,10 @@ int mem_cgroup_write_strategy(char *buf,
return 0;
 }
 
-static ssize_t mem_cgroup_read(struct cgroup *cont,
-   struct cftype *cft, struct file *file,
-   char __user *userbuf, size_t nbytes, loff_t *ppos)
+static u64 mem_cgroup_read(struct cgroup *cont, struct cftype *cft)
 {
-   return res_counter_read(mem_cgroup_from_cont(cont)-res,
-   cft-private, userbuf, nbytes, ppos,
-   NULL);
+   return res_counter_read_uint(mem_cgroup_from_cont(cont)-res,
+cft-private);
 }
 
 static ssize_t mem_cgroup_write(struct cgroup *cont, struct cftype *cft,
@@ -1024,18 +1021,18 @@ static struct cftype mem_cgroup_files[] 
{
.name = usage_in_bytes,
.private = RES_USAGE,
-   .read = mem_cgroup_read,
+   .read_uint = mem_cgroup_read,
},
{
.name = limit_in_bytes,
.private = RES_LIMIT,
.write = mem_cgroup_write,
-   .read = mem_cgroup_read,
+   .read_uint = mem_cgroup_read,
},
{
.name = failcnt,
.private = RES_FAILCNT,
-   .read = mem_cgroup_read,
+   .read_uint = mem_cgroup_read,
},
{
.name = force_empty,

--
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] ResCounter: Use read_uint in memory controller

2008-02-21 Thread Balbir Singh
[EMAIL PROTECTED] wrote:
 Update the memory controller to use read_uint for its
 limit/usage/failcnt control files, calling the new
 res_counter_read_uint() function.
 
 Signed-off-by: Paul Menage [EMAIL PROTECTED]
 

Hi, Paul,

Looks good, except for the name uint(), can we make it u64(). Integers are 32
bit on both ILP32 and LP64, but we really read/write 64 bit values.

-- 
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] ResCounter: Use read_uint in memory controller

2008-02-21 Thread Pavel Emelyanov
[EMAIL PROTECTED] wrote:
 Update the memory controller to use read_uint for its
 limit/usage/failcnt control files, calling the new
 res_counter_read_uint() function.
 
 Signed-off-by: Paul Menage [EMAIL PROTECTED]

Acked-by: Pavel Emelyanov [EMAIL PROTECTED]

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/