diff options
author | Paul Jackson <pj@sgi.com> | 2006-03-24 06:16:04 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-24 10:33:22 -0500 |
commit | 44110fe385af23ca5eee8a6ad4ff55d50339097a (patch) | |
tree | 50ed2bfe054b8e35968d8e4a5fbe95c8b3db843b /include/linux/pagemap.h | |
parent | 825a46af5ac171f9f41f794a0a00165588ba1589 (diff) |
[PATCH] cpuset memory spread page cache implementation and hooks
Change the page cache allocation calls to support cpuset memory spreading.
See the previous patch, cpuset_mem_spread, for an explanation of cpuset memory
spreading.
On systems without cpusets configured in the kernel, this is no change.
On systems with cpusets configured in the kernel, but the "memory_spread"
cpuset option not enabled for the current tasks cpuset, this adds a call to a
cpuset routine and failed bit test of the processor state flag PF_SPREAD_PAGE.
On tasks in cpusets with "memory_spread" enabled, this adds a call to a cpuset
routine that computes which of the tasks mems_allowed nodes should be
preferred for this allocation.
If memory spreading applies to a particular allocation, then any other NUMA
mempolicy does not apply.
Signed-off-by: Paul Jackson <pj@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/pagemap.h')
-rw-r--r-- | include/linux/pagemap.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index ee700c6eb442..839f0b3c23aa 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -51,6 +51,10 @@ static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask) | |||
51 | #define page_cache_release(page) put_page(page) | 51 | #define page_cache_release(page) put_page(page) |
52 | void release_pages(struct page **pages, int nr, int cold); | 52 | void release_pages(struct page **pages, int nr, int cold); |
53 | 53 | ||
54 | #ifdef CONFIG_NUMA | ||
55 | extern struct page *page_cache_alloc(struct address_space *x); | ||
56 | extern struct page *page_cache_alloc_cold(struct address_space *x); | ||
57 | #else | ||
54 | static inline struct page *page_cache_alloc(struct address_space *x) | 58 | static inline struct page *page_cache_alloc(struct address_space *x) |
55 | { | 59 | { |
56 | return alloc_pages(mapping_gfp_mask(x), 0); | 60 | return alloc_pages(mapping_gfp_mask(x), 0); |
@@ -60,6 +64,7 @@ static inline struct page *page_cache_alloc_cold(struct address_space *x) | |||
60 | { | 64 | { |
61 | return alloc_pages(mapping_gfp_mask(x)|__GFP_COLD, 0); | 65 | return alloc_pages(mapping_gfp_mask(x)|__GFP_COLD, 0); |
62 | } | 66 | } |
67 | #endif | ||
63 | 68 | ||
64 | typedef int filler_t(void *, struct page *); | 69 | typedef int filler_t(void *, struct page *); |
65 | 70 | ||