Re: [PATCH] mm counter operations through macros

2005-03-14 Thread Christoph Lameter
On Mon, 14 Mar 2005, Andrew Morton wrote: > > Then you wont be able to get rid of the counters by > > > > #define MM_COUNTER(xx) > > > > anymore. > > Why would we want to do that? If counters are calculated on demand then no counter is necessary. - To unsubscribe from this list: send the

Re: [PATCH] mm counter operations through macros

2005-03-14 Thread Andrew Morton
Christoph Lameter <[EMAIL PROTECTED]> wrote: > > On Mon, 14 Mar 2005, Andrew Morton wrote: > > > I don't think the MM_COUNTER_T macro adds much, really. How about this? > > Then you wont be able to get rid of the counters by > > #define MM_COUNTER(xx) > > anymore. Why would we want to do

Re: [PATCH] mm counter operations through macros

2005-03-14 Thread Christoph Lameter
On Mon, 14 Mar 2005, Andrew Morton wrote: > I don't think the MM_COUNTER_T macro adds much, really. How about this? Then you wont be able to get rid of the counters by #define MM_COUNTER(xx) anymore. > > --- 25/include/linux/sched.h~mm-counter-operations-through-macros-tidy >

Re: [PATCH] mm counter operations through macros

2005-03-14 Thread Andrew Morton
Christoph Lameter <[EMAIL PROTECTED]> wrote: > > This patch extracts all the operations on counters protected by the > page table lock (currently rss and anon_rss) into definitions in > include/linux/sched.h. All rss operations are performed through > the following macros: I don't think the

Re: [PATCH] mm counter operations through macros

2005-03-14 Thread Christoph Lameter
Ok. Here is an updated patch: This patch extracts all the operations on counters protected by the page table lock (currently rss and anon_rss) into definitions in include/linux/sched.h. All rss operations are performed through the following macros: get_mm_counter(mm, member) ->

Re: [PATCH] mm counter operations through macros

2005-03-14 Thread Christoph Lameter
Ok. Here is an updated patch: This patch extracts all the operations on counters protected by the page table lock (currently rss and anon_rss) into definitions in include/linux/sched.h. All rss operations are performed through the following macros: get_mm_counter(mm, member) -

Re: [PATCH] mm counter operations through macros

2005-03-14 Thread Andrew Morton
Christoph Lameter [EMAIL PROTECTED] wrote: This patch extracts all the operations on counters protected by the page table lock (currently rss and anon_rss) into definitions in include/linux/sched.h. All rss operations are performed through the following macros: I don't think the

Re: [PATCH] mm counter operations through macros

2005-03-14 Thread Christoph Lameter
On Mon, 14 Mar 2005, Andrew Morton wrote: I don't think the MM_COUNTER_T macro adds much, really. How about this? Then you wont be able to get rid of the counters by #define MM_COUNTER(xx) anymore. --- 25/include/linux/sched.h~mm-counter-operations-through-macros-tidy 2005-03-14

Re: [PATCH] mm counter operations through macros

2005-03-14 Thread Andrew Morton
Christoph Lameter [EMAIL PROTECTED] wrote: On Mon, 14 Mar 2005, Andrew Morton wrote: I don't think the MM_COUNTER_T macro adds much, really. How about this? Then you wont be able to get rid of the counters by #define MM_COUNTER(xx) anymore. Why would we want to do that? - To

Re: [PATCH] mm counter operations through macros

2005-03-14 Thread Christoph Lameter
On Mon, 14 Mar 2005, Andrew Morton wrote: Then you wont be able to get rid of the counters by #define MM_COUNTER(xx) anymore. Why would we want to do that? If counters are calculated on demand then no counter is necessary. - To unsubscribe from this list: send the line

Re: [PATCH] mm counter operations through macros

2005-03-12 Thread Nikita Danilov
Christoph Lameter writes: > On Fri, 11 Mar 2005, Dave Jones wrote: > > > Splitting this last one into inc_mm_counter() and dec_mm_counter() > > means you can kill off the last argument, and get some of the > > readability back. As it stands, I think this patch adds a bunch > > of

Re: [PATCH] mm counter operations through macros

2005-03-12 Thread Nikita Danilov
Christoph Lameter writes: On Fri, 11 Mar 2005, Dave Jones wrote: Splitting this last one into inc_mm_counter() and dec_mm_counter() means you can kill off the last argument, and get some of the readability back. As it stands, I think this patch adds a bunch of obfuscation for no

Re: [PATCH] mm counter operations through macros

2005-03-11 Thread Christoph Lameter
On Fri, 11 Mar 2005, Andrew Morton wrote: > > +#define set_mm_counter(mm, member, value) (mm)->member = (value) > > +#define get_mm_counter(mm, member) ((mm)->member) > > +#define update_mm_counter(mm, member, value) (mm)->member += (value) > > +#define inc_mm_counter(mm, member) (mm)->member++ >

Re: [PATCH] mm counter operations through macros

2005-03-11 Thread Andrew Morton
Christoph Lameter <[EMAIL PROTECTED]> wrote: > > This patch extracts all the operations on counters protected by the > page table lock (currently rss and anon_rss) into definitions in > include/linux/sched.h. All rss operations are performed through > the following macros: > > get_mm_counter(mm,

Re: [PATCH] mm counter operations through macros

2005-03-11 Thread Christoph Lameter
On Fri, 11 Mar 2005, Dave Jones wrote: > Splitting this last one into inc_mm_counter() and dec_mm_counter() > means you can kill off the last argument, and get some of the > readability back. As it stands, I think this patch adds a bunch > of obfuscation for no clear benefit. Ok.

Re: [PATCH] mm counter operations through macros

2005-03-11 Thread Dave Jones
On Fri, Mar 11, 2005 at 04:23:21AM -0800, Christoph Lameter wrote: > This patch extracts all the operations on counters protected by the > page table lock (currently rss and anon_rss) into definitions in > include/linux/sched.h. All rss operations are performed through > the following three

[PATCH] mm counter operations through macros

2005-03-11 Thread Christoph Lameter
This patch extracts all the operations on counters protected by the page table lock (currently rss and anon_rss) into definitions in include/linux/sched.h. All rss operations are performed through the following three macros: get_mm_counter(mm, member) -> Obtain the value of a counter

[PATCH] mm counter operations through macros

2005-03-11 Thread Christoph Lameter
This patch extracts all the operations on counters protected by the page table lock (currently rss and anon_rss) into definitions in include/linux/sched.h. All rss operations are performed through the following three macros: get_mm_counter(mm, member) - Obtain the value of a counter

Re: [PATCH] mm counter operations through macros

2005-03-11 Thread Dave Jones
On Fri, Mar 11, 2005 at 04:23:21AM -0800, Christoph Lameter wrote: This patch extracts all the operations on counters protected by the page table lock (currently rss and anon_rss) into definitions in include/linux/sched.h. All rss operations are performed through the following three

Re: [PATCH] mm counter operations through macros

2005-03-11 Thread Christoph Lameter
On Fri, 11 Mar 2005, Dave Jones wrote: Splitting this last one into inc_mm_counter() and dec_mm_counter() means you can kill off the last argument, and get some of the readability back. As it stands, I think this patch adds a bunch of obfuscation for no clear benefit. Ok.

Re: [PATCH] mm counter operations through macros

2005-03-11 Thread Andrew Morton
Christoph Lameter [EMAIL PROTECTED] wrote: This patch extracts all the operations on counters protected by the page table lock (currently rss and anon_rss) into definitions in include/linux/sched.h. All rss operations are performed through the following macros: get_mm_counter(mm, member)

Re: [PATCH] mm counter operations through macros

2005-03-11 Thread Christoph Lameter
On Fri, 11 Mar 2005, Andrew Morton wrote: +#define set_mm_counter(mm, member, value) (mm)-member = (value) +#define get_mm_counter(mm, member) ((mm)-member) +#define update_mm_counter(mm, member, value) (mm)-member += (value) +#define inc_mm_counter(mm, member) (mm)-member++ +#define