diff options
| author | Michal Hocko <mhocko@suse.cz> | 2012-04-05 17:25:16 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-05 18:25:51 -0400 |
| commit | dac23b0d0513916498d40412818bd2c581b365f7 (patch) | |
| tree | e758624d444ab8d93f5f38cbcc34de5a8b77248d /include/linux | |
| parent | 6ede3d832aaa038e7465e677569f7acc96b4dcdf (diff) | |
memcg swap: use mem_cgroup_uncharge_swap fix
Although mem_cgroup_uncharge_swap has an empty placeholder for
!CONFIG_CGROUP_MEM_RES_CTLR_SWAP the definition is placed in the
CONFIG_SWAP ifdef block so we are missing the same definition for
!CONFIG_SWAP which implies !CONFIG_CGROUP_MEM_RES_CTLR_SWAP.
This has not been an issue before, because mem_cgroup_uncharge_swap was
not called from !CONFIG_SWAP context. But Hugh Dickins has a cleanup
patch to call __mem_cgroup_commit_charge_swapin which is defined also
for !CONFIG_SWAP.
Let's move both the empty definition and declaration outside of the
CONFIG_SWAP block to avoid the following compilation error:
mm/memcontrol.c: In function '__mem_cgroup_commit_charge_swapin':
mm/memcontrol.c:2837: error: implicit declaration of function 'mem_cgroup_uncharge_swap'
if CONFIG_SWAP is disabled.
Reported-by: David Rientjes <rientjes@google.com>
Signed-off-by: Michal Hocko <mhocko@suse.cz>
Cc: Hugh Dickins <hughd@google.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/swap.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h index 8dc0ea7caf02..b1fd5c7925fe 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
| @@ -305,6 +305,13 @@ static inline int mem_cgroup_swappiness(struct mem_cgroup *mem) | |||
| 305 | return vm_swappiness; | 305 | return vm_swappiness; |
| 306 | } | 306 | } |
| 307 | #endif | 307 | #endif |
| 308 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP | ||
| 309 | extern void mem_cgroup_uncharge_swap(swp_entry_t ent); | ||
| 310 | #else | ||
| 311 | static inline void mem_cgroup_uncharge_swap(swp_entry_t ent) | ||
| 312 | { | ||
| 313 | } | ||
| 314 | #endif | ||
| 308 | #ifdef CONFIG_SWAP | 315 | #ifdef CONFIG_SWAP |
| 309 | /* linux/mm/page_io.c */ | 316 | /* linux/mm/page_io.c */ |
| 310 | extern int swap_readpage(struct page *); | 317 | extern int swap_readpage(struct page *); |
| @@ -375,13 +382,6 @@ mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout) | |||
| 375 | { | 382 | { |
| 376 | } | 383 | } |
| 377 | #endif | 384 | #endif |
| 378 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP | ||
| 379 | extern void mem_cgroup_uncharge_swap(swp_entry_t ent); | ||
| 380 | #else | ||
| 381 | static inline void mem_cgroup_uncharge_swap(swp_entry_t ent) | ||
| 382 | { | ||
| 383 | } | ||
| 384 | #endif | ||
| 385 | 385 | ||
| 386 | #else /* CONFIG_SWAP */ | 386 | #else /* CONFIG_SWAP */ |
| 387 | 387 | ||
