Skip to content
  • Li Zefan's avatar
    cpuset: enable onlined cpu/node in effective masks · be4c9dd7
    Li Zefan authored
    
    
    Firstly offline cpu1:
    
      # echo 0-1 > cpuset.cpus
      # echo 0 > /sys/devices/system/cpu/cpu1/online
      # cat cpuset.cpus
      0-1
      # cat cpuset.effective_cpus
      0
    
    Then online it:
    
      # echo 1 > /sys/devices/system/cpu/cpu1/online
      # cat cpuset.cpus
      0-1
      # cat cpuset.effective_cpus
      0-1
    
    And cpuset will bring it back to the effective mask.
    
    The implementation is quite straightforward. Instead of calculating the
    offlined cpus/mems and do updates, we just set the new effective_mask
    to online_mask & congifured_mask.
    
    This is a behavior change for default hierarchy, so legacy hierarchy
    won't be affected.
    
    v2:
    - make refactoring of cpuset_hotplug_update_tasks() as seperate patch,
      suggested by Tejun.
    - make hotplug_update_tasks_insane() use @new_cpus and @new_mems as
      hotplug_update_tasks_sane() does.
    
    Signed-off-by: default avatarLi Zefan <lizefan@huawei.com>
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    be4c9dd7