* [PATCH] Make CONFIG_MIGRATION available for s390, [PATCH] Make CONFIG_MIGRATION available for s390
@ 2008-07-04 14:58 Gerald Schaefer
2008-07-05 4:02 ` KAMEZAWA Hiroyuki
0 siblings, 1 reply; 5+ messages in thread
From: Gerald Schaefer @ 2008-07-04 14:58 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-kernel, linux-mm, schwidefsky, heiko.carstens,
KAMEZAWA Hiroyuki, Yasunori Goto, Dave Hansen, Andy Whitcroft
From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
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 s390. When MIGRATION
is enabled w/o NUMA, the kernel won't compile because of a missing
"migrate" member in vm_operations_struct and a missing "policy_zone"
definition. To avoid this, those are moved from an "#ifdef CONFIG_NUMA"
section to "#ifdef CONFIG_MIGRATION".
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
---
include/linux/mempolicy.h | 6 ++++--
include/linux/mm.h | 2 ++
mm/Kconfig | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)
Index: mylinux-git/include/linux/mempolicy.h
===================================================================
--- mylinux-git.orig/include/linux/mempolicy.h
+++ mylinux-git/include/linux/mempolicy.h
@@ -62,6 +62,10 @@ enum {
struct mm_struct;
+#ifdef CONFIG_MIGRATION
+extern enum zone_type policy_zone;
+#endif
+
#ifdef CONFIG_NUMA
/*
@@ -202,8 +206,6 @@ extern struct zonelist *huge_zonelist(st
struct mempolicy **mpol, nodemask_t **nodemask);
extern unsigned slab_node(struct mempolicy *policy);
-extern enum zone_type policy_zone;
-
static inline void check_highest_zone(enum zone_type k)
{
if (k > policy_zone && k != ZONE_MOVABLE)
Index: mylinux-git/include/linux/mm.h
===================================================================
--- mylinux-git.orig/include/linux/mm.h
+++ mylinux-git/include/linux/mm.h
@@ -193,6 +193,8 @@ struct vm_operations_struct {
*/
struct mempolicy *(*get_policy)(struct vm_area_struct *vma,
unsigned long addr);
+#endif
+#ifdef CONFIG_MIGRATION
int (*migrate)(struct vm_area_struct *vma, const nodemask_t *from,
const nodemask_t *to, unsigned long flags);
#endif
Index: mylinux-git/mm/Kconfig
===================================================================
--- mylinux-git.orig/mm/Kconfig
+++ mylinux-git/mm/Kconfig
@@ -174,7 +174,7 @@ config SPLIT_PTLOCK_CPUS
config MIGRATION
bool "Page migration"
def_bool y
- depends on NUMA
+ depends on NUMA || S390
help
Allows the migration of the physical location of pages of processes
while the virtual addresses are not changed. This is useful for
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] Make CONFIG_MIGRATION available for s390
2008-07-04 14:58 [PATCH] Make CONFIG_MIGRATION available for s390, [PATCH] Make CONFIG_MIGRATION available for s390 Gerald Schaefer
@ 2008-07-05 4:02 ` KAMEZAWA Hiroyuki
2008-07-05 6:14 ` Yasunori Goto
0 siblings, 1 reply; 5+ messages in thread
From: KAMEZAWA Hiroyuki @ 2008-07-05 4:02 UTC (permalink / raw)
To: Gerald Schaefer
Cc: Andrew Morton, linux-kernel, linux-mm, schwidefsky,
heiko.carstens, Yasunori Goto, Dave Hansen, Andy Whitcroft
On Fri, 04 Jul 2008 16:58:59 +0200
Gerald Schaefer <gerald.schaefer@de.ibm.com> wrote:
> Subject: [PATCH] Make CONFIG_MIGRATION available for s390
>
> From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
>
> 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 s390. When MIGRATION
> is enabled w/o NUMA, the kernel won't compile because of a missing
> "migrate" member in vm_operations_struct and a missing "policy_zone"
> definition. To avoid this, those are moved from an "#ifdef CONFIG_NUMA"
> section to "#ifdef CONFIG_MIGRATION".
>
> Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
> ---
Maybe make sense
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>
> include/linux/mempolicy.h | 6 ++++--
> include/linux/mm.h | 2 ++
> mm/Kconfig | 2 +-
> 3 files changed, 7 insertions(+), 3 deletions(-)
>
> Index: mylinux-git/include/linux/mempolicy.h
> ===================================================================
> --- mylinux-git.orig/include/linux/mempolicy.h
> +++ mylinux-git/include/linux/mempolicy.h
> @@ -62,6 +62,10 @@ enum {
>
> struct mm_struct;
>
> +#ifdef CONFIG_MIGRATION
> +extern enum zone_type policy_zone;
> +#endif
> +
> #ifdef CONFIG_NUMA
>
> /*
> @@ -202,8 +206,6 @@ extern struct zonelist *huge_zonelist(st
> struct mempolicy **mpol, nodemask_t **nodemask);
> extern unsigned slab_node(struct mempolicy *policy);
>
> -extern enum zone_type policy_zone;
> -
> static inline void check_highest_zone(enum zone_type k)
> {
> if (k > policy_zone && k != ZONE_MOVABLE)
> Index: mylinux-git/include/linux/mm.h
> ===================================================================
> --- mylinux-git.orig/include/linux/mm.h
> +++ mylinux-git/include/linux/mm.h
> @@ -193,6 +193,8 @@ struct vm_operations_struct {
> */
> struct mempolicy *(*get_policy)(struct vm_area_struct *vma,
> unsigned long addr);
> +#endif
> +#ifdef CONFIG_MIGRATION
> int (*migrate)(struct vm_area_struct *vma, const nodemask_t *from,
> const nodemask_t *to, unsigned long flags);
> #endif
> Index: mylinux-git/mm/Kconfig
> ===================================================================
> --- mylinux-git.orig/mm/Kconfig
> +++ mylinux-git/mm/Kconfig
> @@ -174,7 +174,7 @@ config SPLIT_PTLOCK_CPUS
> config MIGRATION
> bool "Page migration"
> def_bool y
> - depends on NUMA
> + depends on NUMA || S390
> help
> Allows the migration of the physical location of pages of processes
> while the virtual addresses are not changed. This is useful for
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] Make CONFIG_MIGRATION available for s390
2008-07-05 4:02 ` KAMEZAWA Hiroyuki
@ 2008-07-05 6:14 ` Yasunori Goto
2008-07-06 14:30 ` Gerald Schaefer
0 siblings, 1 reply; 5+ messages in thread
From: Yasunori Goto @ 2008-07-05 6:14 UTC (permalink / raw)
To: Gerald Schaefer
Cc: Andrew Morton, linux-kernel, linux-mm, schwidefsky,
heiko.carstens, Dave Hansen, Andy Whitcroft, KAMEZAWA Hiroyuki
> > config MIGRATION
> > bool "Page migration"
> > def_bool y
> > - depends on NUMA
> > + depends on NUMA || S390
Hmm. I think ARCH_ENABLE_MEMORY_HOTREMOVE is better than S390.
Bye.
--
Yasunori Goto
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Make CONFIG_MIGRATION available for s390
2008-07-05 6:14 ` Yasunori Goto
@ 2008-07-06 14:30 ` Gerald Schaefer
0 siblings, 0 replies; 5+ messages in thread
From: Gerald Schaefer @ 2008-07-06 14:30 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-kernel, linux-mm, schwidefsky, heiko.carstens, Dave Hansen,
Andy Whitcroft, KAMEZAWA Hiroyuki, Yasunori Goto
On Sat, 2008-07-05 at 15:14 +0900, Yasunori Goto wrote:
> > > config MIGRATION
> > > bool "Page migration"
> > > def_bool y
> > > - depends on NUMA
> > > + depends on NUMA || S390
>
> Hmm. I think ARCH_ENABLE_MEMORY_HOTREMOVE is better than S390.
Right, that makes more sense. I also noticed that my patch will produce
a compile error when CONFIG_NUMA is set but CONFIG_MIGRATION is not,
because policy_zone is missing in that case. Since policy_zone is only
used for NUMA, a better solution would be to use an "#ifdef CONFIG_NUMA"
within vma_migratable(). I will send a new version of the patch.
Thanks,
Gerald
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] Make CONFIG_MIGRATION available for s390, [PATCH] Make CONFIG_MIGRATION available for s390
@ 2008-07-06 14:35 Gerald Schaefer
0 siblings, 0 replies; 5+ messages in thread
From: Gerald Schaefer @ 2008-07-06 14:35 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-kernel, linux-mm, schwidefsky, heiko.carstens,
KAMEZAWA Hiroyuki, Yasunori Goto, Dave Hansen, Andy Whitcroft
From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
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 of a missing migrate() function in vm_operations_struct
and a missing policy_zone reference in vma_migratable(). To avoid this,
"#ifdef CONFIG_NUMA" is added to vma_migratable() and the vm_ops migrate()
definition is moved from "#ifdef CONFIG_NUMA" to "#ifdef CONFIG_MIGRATION".
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
---
include/linux/migrate.h | 2 ++
include/linux/mm.h | 2 ++
mm/Kconfig | 2 +-
3 files changed, 5 insertions(+), 1 deletion(-)
Index: linux-2.6/include/linux/migrate.h
===================================================================
--- linux-2.6.orig/include/linux/migrate.h
+++ linux-2.6/include/linux/migrate.h
@@ -13,6 +13,7 @@ static inline int vma_migratable(struct
{
if (vma->vm_flags & (VM_IO|VM_HUGETLB|VM_PFNMAP|VM_RESERVED))
return 0;
+#ifdef CONFIG_NUMA
/*
* Migration allocates pages in the highest zone. If we cannot
* do so then migration (at least from node to node) is not
@@ -22,6 +23,7 @@ static inline int vma_migratable(struct
gfp_zone(mapping_gfp_mask(vma->vm_file->f_mapping))
< policy_zone)
return 0;
+#endif
return 1;
}
Index: linux-2.6/include/linux/mm.h
===================================================================
--- linux-2.6.orig/include/linux/mm.h
+++ linux-2.6/include/linux/mm.h
@@ -193,6 +193,8 @@ struct vm_operations_struct {
*/
struct mempolicy *(*get_policy)(struct vm_area_struct *vma,
unsigned long addr);
+#endif
+#ifdef CONFIG_MIGRATION
int (*migrate)(struct vm_area_struct *vma, const nodemask_t *from,
const nodemask_t *to, unsigned long flags);
#endif
Index: linux-2.6/mm/Kconfig
===================================================================
--- linux-2.6.orig/mm/Kconfig
+++ linux-2.6/mm/Kconfig
@@ -174,7 +174,7 @@ config SPLIT_PTLOCK_CPUS
config MIGRATION
bool "Page migration"
def_bool y
- depends on NUMA
+ depends on NUMA || ARCH_ENABLE_MEMORY_HOTREMOVE
help
Allows the migration of the physical location of pages of processes
while the virtual addresses are not changed. This is useful for
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-07-06 14:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-04 14:58 [PATCH] Make CONFIG_MIGRATION available for s390, [PATCH] Make CONFIG_MIGRATION available for s390 Gerald Schaefer
2008-07-05 4:02 ` KAMEZAWA Hiroyuki
2008-07-05 6:14 ` Yasunori Goto
2008-07-06 14:30 ` Gerald Schaefer
2008-07-06 14:35 [PATCH] Make CONFIG_MIGRATION available for s390, " Gerald Schaefer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox