diff options
author | Gerald Schaefer <gerald.schaefer@de.ibm.com> | 2008-07-24 00:28:22 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-24 13:47:21 -0400 |
commit | 83d1674a946141c3c59d430e96c224f7937e6158 (patch) | |
tree | 03420c9fdf56ad35de685b7c0b48899d886bd7ff /include/linux/mempolicy.h | |
parent | 9ca908f47bc784c90e17a553ce33e756c73feac4 (diff) |
mm: make CONFIG_MIGRATION available w/o CONFIG_NUMA
We'd like to support CONFIG_MEMORY_HOTREMOVE on s390, which depends on
CONFIG_MIGRATION. So far, CONFIG_MIGRATION is only available with NUMA
support.
This patch makes CONFIG_MIGRATION selectable for architectures that define
ARCH_ENABLE_MEMORY_HOTREMOVE. When MIGRATION is enabled w/o NUMA, the
kernel won't compile because migrate_vmas() does not know about
vm_ops->migrate() and vma_migratable() does not know about policy_zone.
To fix this, those two functions can be restricted to '#ifdef CONFIG_NUMA'
because they are not being used w/o NUMA. vma_migratable() is moved over
from migrate.h to mempolicy.h.
[kosaki.motohiro@jp.fujitsu.com: build fix]
Acked-by: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: KOSAKI Motorhiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/mempolicy.h')
-rw-r--r-- | include/linux/mempolicy.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 3a39570b81b8..085c903fe0f1 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
@@ -59,6 +59,7 @@ enum { | |||
59 | #include <linux/rbtree.h> | 59 | #include <linux/rbtree.h> |
60 | #include <linux/spinlock.h> | 60 | #include <linux/spinlock.h> |
61 | #include <linux/nodemask.h> | 61 | #include <linux/nodemask.h> |
62 | #include <linux/pagemap.h> | ||
62 | 63 | ||
63 | struct mm_struct; | 64 | struct mm_struct; |
64 | 65 | ||
@@ -220,6 +221,24 @@ extern int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context); | |||
220 | extern int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, | 221 | extern int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, |
221 | int no_context); | 222 | int no_context); |
222 | #endif | 223 | #endif |
224 | |||
225 | /* Check if a vma is migratable */ | ||
226 | static inline int vma_migratable(struct vm_area_struct *vma) | ||
227 | { | ||
228 | if (vma->vm_flags & (VM_IO|VM_HUGETLB|VM_PFNMAP|VM_RESERVED)) | ||
229 | return 0; | ||
230 | /* | ||
231 | * Migration allocates pages in the highest zone. If we cannot | ||
232 | * do so then migration (at least from node to node) is not | ||
233 | * possible. | ||
234 | */ | ||
235 | if (vma->vm_file && | ||
236 | gfp_zone(mapping_gfp_mask(vma->vm_file->f_mapping)) | ||
237 | < policy_zone) | ||
238 | return 0; | ||
239 | return 1; | ||
240 | } | ||
241 | |||
223 | #else | 242 | #else |
224 | 243 | ||
225 | struct mempolicy {}; | 244 | struct mempolicy {}; |