• Tejun Heo's avatar
    cpuset: migrate memory only for threadgroup leaders · 3df9ca0a
    Tejun Heo authored
    If memory_migrate flag is set, cpuset migrates memory according to the
    destnation css's nodemask.  The current implementation migrates memory
    whenever any thread of a process is migrated making the behavior
    somewhat arbitrary.  Let's tie memory operations to the threadgroup
    leader so that memory is migrated only when the leader is migrated.
    
    While this is a behavior change, given the inherent fuziness, this
    change is not too likely to be noticed and allows us to clearly define
    who owns the memory (always the leader) and helps the planned atomic
    multi-process migration.
    
    Note that we're currently migrating memory in migration path proper
    while holding all the locks.  In the long term, this should be moved
    out to an async work item.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Acked-by: default avatarZefan Li <lizefan@huawei.com>
    3df9ca0a
cpuset.c 75.3 KB