diff options
author | Hugh Dickins <hughd@google.com> | 2011-08-03 19:21:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-08-03 20:25:24 -0400 |
commit | aa3b189551ad8e5cc1d9c663735c131650238278 (patch) | |
tree | c789ab5c7f890a6065811d8bba15a784caf9e859 /include | |
parent | 54af60421822bb9cb664dd5cd7aac46c01ccfcf8 (diff) |
tmpfs: convert mem_cgroup shmem to radix-swap
Remove mem_cgroup_shmem_charge_fallback(): it was only required when we
had to move swappage to filecache with GFP_NOWAIT.
Remove the GFP_NOWAIT special case from mem_cgroup_cache_charge(), by
moving its call out from shmem_add_to_page_cache() to two of thats three
callers. But leave it doing mem_cgroup_uncharge_cache_page() on error:
although asymmetrical, it's easier for all 3 callers to handle.
These two changes would also be appropriate if anyone were to start
using shmem_read_mapping_page_gfp() with GFP_NOWAIT.
Remove mem_cgroup_get_shmem_target(): mc_handle_file_pte() can test
radix_tree_exceptional_entry() to get what it needs for itself.
Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/memcontrol.h | 8 | ||||
-rw-r--r-- | include/linux/shmem_fs.h | 2 |
2 files changed, 0 insertions, 10 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index b96600786913..3b535db00a94 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -86,8 +86,6 @@ extern void mem_cgroup_uncharge_end(void); | |||
86 | 86 | ||
87 | extern void mem_cgroup_uncharge_page(struct page *page); | 87 | extern void mem_cgroup_uncharge_page(struct page *page); |
88 | extern void mem_cgroup_uncharge_cache_page(struct page *page); | 88 | extern void mem_cgroup_uncharge_cache_page(struct page *page); |
89 | extern int mem_cgroup_shmem_charge_fallback(struct page *page, | ||
90 | struct mm_struct *mm, gfp_t gfp_mask); | ||
91 | 89 | ||
92 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); | 90 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); |
93 | int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); | 91 | int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); |
@@ -225,12 +223,6 @@ static inline void mem_cgroup_uncharge_cache_page(struct page *page) | |||
225 | { | 223 | { |
226 | } | 224 | } |
227 | 225 | ||
228 | static inline int mem_cgroup_shmem_charge_fallback(struct page *page, | ||
229 | struct mm_struct *mm, gfp_t gfp_mask) | ||
230 | { | ||
231 | return 0; | ||
232 | } | ||
233 | |||
234 | static inline void mem_cgroup_add_lru_list(struct page *page, int lru) | 226 | static inline void mem_cgroup_add_lru_list(struct page *page, int lru) |
235 | { | 227 | { |
236 | } | 228 | } |
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index 3f05795dcf7b..0c8e952df594 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h | |||
@@ -57,8 +57,6 @@ extern struct page *shmem_read_mapping_page_gfp(struct address_space *mapping, | |||
57 | pgoff_t index, gfp_t gfp_mask); | 57 | pgoff_t index, gfp_t gfp_mask); |
58 | extern void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end); | 58 | extern void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end); |
59 | extern int shmem_unuse(swp_entry_t entry, struct page *page); | 59 | extern int shmem_unuse(swp_entry_t entry, struct page *page); |
60 | extern void mem_cgroup_get_shmem_target(struct inode *inode, pgoff_t pgoff, | ||
61 | struct page **pagep, swp_entry_t *ent); | ||
62 | 60 | ||
63 | static inline struct page *shmem_read_mapping_page( | 61 | static inline struct page *shmem_read_mapping_page( |
64 | struct address_space *mapping, pgoff_t index) | 62 | struct address_space *mapping, pgoff_t index) |