From: KAMEZAWA Hiroyuki Date: Wed, 10 Mar 2010 23:20:38 +0000 (-0800) Subject: nommu: fix build breakage X-Git-Tag: v2.6.34-rc2~271 X-Git-Url: http://bbs.cooldavid.org/git/?a=commitdiff_plain;h=53bddb4e9f3f53df02a783751984ddeade71b085;p=net-next-2.6.git nommu: fix build breakage Commit 34e55232e59f7b19050267a05ff1226e5cd122a5 ("mm: avoid false sharing of mm_counter") added sync_mm_rss() for syncing loosely accounted rss counters. It's for CONFIG_MMU but sync_mm_rss is called even in NOMMU enviroment (kerne/exit.c, fs/exec.c). Above commit doesn't handle it well. This patch changes SPLIT_RSS_COUNTING depends on SPLIT_PTLOCKS && CONFIG_MMU And for avoid unnecessary function calls, sync_mm_rss changed to be inlined noop function in header file. Reported-by: David Howells Signed-off-by: KAMEZAWA Hiroyuki Signed-off-by: Mike Frysinger Signed-off-by: Michal Simek Signed-off-by: David Howells Cc: Greg Ungerer Cc: Geert Uytterhoeven Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/mm.h b/include/linux/mm.h index 3899395a03d..7f693b272c4 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -971,7 +971,13 @@ static inline void setmax_mm_hiwater_rss(unsigned long *maxrss, *maxrss = hiwater_rss; } +#if defined(SPLIT_RSS_COUNTING) void sync_mm_rss(struct task_struct *task, struct mm_struct *mm); +#else +static inline void sync_mm_rss(struct task_struct *task, struct mm_struct *mm) +{ +} +#endif /* * A callback you can register to apply pressure to ageable caches. diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 048b46270aa..b8bb9a6a1f3 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -203,7 +203,7 @@ enum { NR_MM_COUNTERS }; -#if USE_SPLIT_PTLOCKS +#if USE_SPLIT_PTLOCKS && defined(CONFIG_MMU) #define SPLIT_RSS_COUNTING struct mm_rss_stat { atomic_long_t count[NR_MM_COUNTERS]; diff --git a/mm/memory.c b/mm/memory.c index d1153e37e9b..3d9130bd95d 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -190,9 +190,6 @@ static void check_sync_rss_stat(struct task_struct *task) { } -void sync_mm_rss(struct task_struct *task, struct mm_struct *mm) -{ -} #endif /*