Re: [PATCH] Make CONFIG_MIGRATION available for s390

From: Christoph Lameter
Date: Mon Jul 07 2008 - 11:12:18 EST


Gerald Schaefer wrote:

> 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;
> }

This will extend the number of pages that are migratable and lead to strange
semantics in the NUMA case. There suddenly vma_is migratable will forbid hotplug
to migrate certain pages.

I think we need two functions:

vma_migratable() General migratability

vma_policy_migratable() Migratable under NUMA policies.


> 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

That wont work since the migrate function takes a nodemask! The point of
the function is to move memory from node to node which is something that you
*cannot* do in a non NUMA configuration. So leave this chunk out.


> 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

Hmmm... Okay. I tried to make MIGRATION as independent of CONFIG_NUMA as possible so hopefully this will work.



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/