• Paul Jackson's avatar
    [PATCH] cpuset: migrate all tasks in cpuset at once · 04c19fa6
    Paul Jackson authored
    Given the mechanism in the previous patch to handle rebinding the per-vma
    mempolicies of all tasks in a cpuset that changes its memory placement, it is
    now easier to handle the page migration requirements of such tasks at the same
    time.
    
    The previous code didn't actually attempt to migrate the pages of the tasks in
    a cpuset whose memory placement changed until the next time each such task
    tried to allocate memory.  This was undesirable, as users invoking memory page
    migration exected to happen when the placement changed, not some unspecified
    time later when the task needed more memory.
    
    It is now trivial to handle the page migration at the same time as the per-vma
    rebinding is done.
    
    The routine cpuset.c:update_nodemask(), which handles changing a cpusets
    memory placement ('mems') now checks for the special case of being asked to
    write a placement that is the same as before.  It was harmless enough before
    to just recompute everything again, even though nothing had changed.  But page
    migration is a heavy weight operation - moving pages about.  So now it is
    worth avoiding that if asked to move a cpuset to its current location.
    Signed-off-by: default avatarPaul Jackson <pj@sgi.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    04c19fa6
cpuset.c 63 KB