[lkml]   [2008]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[PATCH] Make CONFIG_MIGRATION available for s390
    On Mon, 2008-07-07 at 19:24 +0900, Yasunori Goto wrote:
    > > include/linux/mempolicy.h already has a !NUMA section could we not just
    > > define policy_zone as 0 in that and leave this code unconditionally
    > > compiled? Perhaps also adding a NUMA_BUILD && to this 'if' should that
    > > be clearer.
    > >
    > Ah, yes. It's better. :-)

    ok, the new patch below defines policy_zone as 0 in the !NUMA section. The
    compiler will automatically omit the if statement w/o NUMA in this case.

    > > But this does make me feel uneasy. Are we really saying all memory on
    > > an s390 is migratable. That seems unlikely. As I understand the NUMA
    > > case, we only allow migration of memory in the last zone (last two if we
    > > have a MOVABLE zone) why are things different just because we have a
    > > single 'node'. Hmmm. I suspect strongly that something is missnamed
    > > more than there is a problem.
    > If my understanding is correct, even if this policy_zone check is removed,
    > page isolation will just fail due to some busy pages.
    > In hotplug case, it means giving up of hotremoving,
    > and kernel must be rollback to make same condition of previous
    > starting offline_pages().
    > This check means just "early" check, but not so effective for hotremoving,
    > I think....

    It seems to me that this policy_zone check in vma_migratable() is not
    called at all for the offline_pages() case, only for some NUMA system calls
    that we don't support on s390. As Yasunori Goto said, page isolation checks
    should do the job for memory hotremove via offline_pages(), independent from
    any policy_zone setting. Any more thoughts on this?


    Subject: [PATCH] Make CONFIG_MIGRATION available for s390

    From: Gerald Schaefer <>

    We'd like to support CONFIG_MEMORY_HOTREMOVE on s390, which depends on
    CONFIG_MIGRATION. So far, CONFIG_MIGRATION is only available with NUMA

    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,
    policy_zone is defined as 0 for !NUMA, and the vm_ops migrate() definition
    is moved from '#ifdef CONFIG_NUMA' to '#ifdef CONFIG_MIGRATION'.

    Signed-off-by: Gerald Schaefer <>

    include/linux/mempolicy.h | 1 +
    include/linux/mm.h | 2 ++
    mm/Kconfig | 2 +-
    3 files changed, 4 insertions(+), 1 deletion(-)

    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);
    int (*migrate)(struct vm_area_struct *vma, const nodemask_t *from,
    const nodemask_t *to, unsigned long flags);
    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
    Allows the migration of the physical location of pages of processes
    while the virtual addresses are not changed. This is useful for
    Index: linux-2.6/include/linux/mempolicy.h
    --- linux-2.6.orig/include/linux/mempolicy.h
    +++ linux-2.6/include/linux/mempolicy.h
    @@ -222,6 +222,7 @@ extern int mpol_to_str(char *buffer, int

    +#define policy_zone 0
    struct mempolicy {};

    static inline int mpol_equal(struct mempolicy *a, struct mempolicy *b)

     \ /
      Last update: 2008-07-07 18:45    [W:0.029 / U:0.224 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site