diff options
| author | Christoph Lameter <clameter@sgi.com> | 2005-03-28 03:19:14 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-03-28 03:19:14 -0800 |
| commit | 9b65d113fe1cd4961ce94127584413cefd49aaed (patch) | |
| tree | eb716c7d5fb899ee2160d199cb7a5366e8314ac3 /fs/proc/array.c | |
| parent | ae102ac599f557ea3544875957dda84ed5bb020e (diff) | |
[PATCH] mm counter operations through macros
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) -> Obtain the value of a counter
set_mm_counter(mm, member, value) -> Set the value of a counter
update_mm_counter(mm, member, value) -> Add to a counter
inc_mm_counter(mm, member) -> Increment a counter
dec_mm_counter(mm, member) -> Decrement a counter
With this patch it becomes easier to add new counters and it is possible to
redefine the method of counter handling. The counters are an issue for
scalability since they are used in frequently used code paths and may cause
cache line bouncing.
F.e. One may not use counters at all and count the pages when needed, switch
to atomic operations if the mm_struct locking changes or split the rss
into counters that can be locally incremented.
The relevant fields of the task_struct are renamed with a leading underscore
to catch out people who are not using the acceessor macros.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/proc/array.c')
| -rw-r--r-- | fs/proc/array.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c index 254a8eb6df15..37668fe998ad 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -432,7 +432,7 @@ static int do_task_stat(struct task_struct *task, char * buffer, int whole) jiffies_to_clock_t(it_real_value), start_time, vsize, - mm ? mm->rss : 0, /* you might want to shift this left 3 */ + mm ? get_mm_counter(mm, rss) : 0, /* you might want to shift this left 3 */ rsslim, mm ? mm->start_code : 0, mm ? mm->end_code : 0, |
