Re: [PATCH] mm counter operations through macros

From: Andrew Morton
Date: Tue Mar 15 2005 - 00:50:38 EST


Christoph Lameter <clameter@xxxxxxx> 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 MM_COUNTER_T macro adds much, really. How about this?

--- 25/include/linux/sched.h~mm-counter-operations-through-macros-tidy 2005-03-14 21:43:00.000000000 -0800
+++ 25-akpm/include/linux/sched.h 2005-03-14 21:43:00.000000000 -0800
@@ -210,7 +210,6 @@ extern void arch_unmap_area_topdown(stru
#define inc_mm_counter(mm, member) (mm)->_##member++
#define dec_mm_counter(mm, member) (mm)->_##member--
typedef unsigned long mm_counter_t;
-#define MM_COUNTER_T(member) mm_counter_t _##member

struct mm_struct {
struct vm_area_struct * mmap; /* list of VMAs */
@@ -241,8 +240,8 @@ struct mm_struct {
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);
+ mm_counter_t _rss;
+ mm_counter_t _anon_rss;

unsigned long saved_auxv[42]; /* for /proc/PID/auxv */

_

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