KAMEZAWA Hiroyuki 34e55232e5 mm: avoid false sharing of mm_counter
Considering the nature of per mm stats, it's the shared object among
threads and can be a cache-miss point in the page fault path.

This patch adds per-thread cache for mm_counter.  RSS value will be
counted into a struct in task_struct and synchronized with mm's one at
events.

Now, in this patch, the event is the number of calls to handle_mm_fault.
Per-thread value is added to mm at each 64 calls.

 rough estimation with small benchmark on parallel thread (2threads) shows
 [before]
     4.5 cache-miss/faults
 [after]
     4.0 cache-miss/faults
 Anyway, the most contended object is mmap_sem if the number of threads grows.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-03-06 11:26:24 -08:00
..
2009-09-21 14:29:21 +02:00
2009-12-15 08:53:10 -08:00
2010-03-03 14:07:57 -05:00
2010-02-25 12:02:13 +01:00
2009-12-06 21:10:56 +01:00
2010-02-03 10:21:57 +11:00
2010-03-06 11:26:24 -08:00
2010-03-06 11:26:23 -08:00
2009-12-14 23:55:34 +01:00
2010-01-21 13:40:18 +01:00
2010-02-02 14:38:15 +09:00
2009-12-31 19:45:04 +00:00
2010-03-01 09:36:31 +11:00
2010-02-10 17:47:17 -08:00
2010-02-26 08:20:46 +01:00
2009-12-09 10:03:07 +01:00
2010-02-18 14:30:18 -08:00
2009-12-22 14:10:37 -08:00
2010-03-06 11:26:23 -08:00
2009-09-23 18:13:10 -07:00
2010-01-21 13:40:18 +01:00