History

cpuset: initialize effective masks when clone_children is enabled

If clone_children is enabled, effective masks won't be initialized due to the bug: # mount -t cgroup -o cpuset xxx /mnt # echo 1 > cgroup.clone_children # mkdir /mnt/tmp # cat /mnt/tmp/ # cat cpuset.effective_cpus # cat cpuset.cpus 0-15 And then this cpuset won't constrain the tasks in it. Either the bug or the fix has no effect on unified hierarchy, as there's no clone_chidren flag there any more.

Zefan Li committed 11 years ago

Commit 790317e1 parent c517d831 file · +2 −0Browse files

Unified · Split

kernel/cpuset.c+2−0
@@ -1979,7 +1979,9 @@ static int cpuset_css_online(struct cgroup_subsys_state *css) · 1978 unmodified lines
1979 1979
1980 spin_lock_irq(&callback_lock);1980 spin_lock_irq(&callback_lock);
1981 cs->mems_allowed = parent->mems_allowed;1981 cs->mems_allowed = parent->mems_allowed;
1982 cs->effective_mems = parent->mems_allowed;
1982 cpumask_copy(cs->cpus_allowed, parent->cpus_allowed);1983 cpumask_copy(cs->cpus_allowed, parent->cpus_allowed);
1984 cpumask_copy(cs->effective_cpus, parent->cpus_allowed);
1983 spin_unlock_irq(&callback_lock);1985 spin_unlock_irq(&callback_lock);
1984out_unlock:1986out_unlock:
1985 mutex_unlock(&cpuset_mutex);1987 mutex_unlock(&cpuset_mutex);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t