Re: [PATCH] mm counter operations through macros
From: Christoph Lameter (clameter_at_sgi.com)
Date: 03/12/05
- Previous message: Benjamin Herrenschmidt: "Re: [Linux-fbdev-devel] Re: [ACPI] inappropriate use of in_atomic()"
- In reply to: Andrew Morton: "Re: [PATCH] mm counter operations through macros"
- Next in thread: Nikita Danilov: "Re: [PATCH] mm counter operations through macros"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 11 Mar 2005 16:35:19 -0800 (PST) To: Andrew Morton <akpm@osdl.org>
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 dec_mm_counter(mm, member) (mm)->member--
> > +#define MM_COUNTER_T unsigned long
>
> Would prefer `mm_counter_t' here.
>
> Why not a typedef?
Ok typedef it is.
> > @@ -231,9 +237,13 @@ struct mm_struct {
> > unsigned long start_code, end_code, start_data, end_data;
> > unsigned long start_brk, brk, start_stack;
> > unsigned long arg_start, arg_end, env_start, env_end;
> > - unsigned long rss, anon_rss, total_vm, locked_vm, shared_vm;
> > + unsigned long total_vm, locked_vm, shared_vm;
> > unsigned long exec_vm, stack_vm, reserved_vm, def_flags, nr_ptes;
> >
> > + /* Special counters protected by the page_table_lock */
> > + MM_COUNTER_T rss;
> > + MM_COUNTER_T anon_rss;
> > +
>
> Why were only two counters converted?
Because only these two counters are protected by the page table lock.
> Could I suggest that you rename all these counters, so that code which
> fails to use the macros won't compile?
Ok. will make them mm_xx as they were in previous patches.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Previous message: Benjamin Herrenschmidt: "Re: [Linux-fbdev-devel] Re: [ACPI] inappropriate use of in_atomic()"
- In reply to: Andrew Morton: "Re: [PATCH] mm counter operations through macros"
- Next in thread: Nikita Danilov: "Re: [PATCH] mm counter operations through macros"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|