Bug 49661 - Cpuset doesn't work?
Summary: Cpuset doesn't work?
Status: NEW
Alias: None
Product: Process Management
Classification: Unclassified
Component: Scheduler (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Ingo Molnar
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-28 11:55 UTC by liranbx
Modified: 2018-09-05 23:45 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.32, 3.2.0
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description liranbx 2012-10-28 11:55:43 UTC
Cpusets handling:
  I've defined two cpuset groups: "cpuset_0" which has only one task, and
  "cpuset_1" which is for all the other tasks in my system. "cpuset_0" has
  cpus="0", cpu_exclusive="1" and only the one task assigned to it.
  "cpuset_1" has cpus="1-3", cpu_exclusive="0" and all the tasks I could move as
  root from the root cpuset.

  Both cpusets has mems="0". The problem is that for some reason I see tasks
  which assigned to "cpuset_1" which are running on the exclusive cpu "cpuset_0"

  For example running ps H -eo tid,psr,cgroup,cmd gives me:
  2199 0 6:cpuset:/cpuset_1?5:freeze /usr/lib/chromium-browser/chromium-browser
  among other processes which shouldn't be running on cpu 0.
  Running: "grep Cpus_allowed_list /proc/2190/task/2199/status" outputs
  Cpus_allowed_list:	1-3

  This happens *not* only for cpu=0.


steps to reprouduce:
1) mkdir /dev/cpuset
2) mount -t cpuset cpuset /dev/cpuset
3) mkdir /dev/cpuset/cpuset_0
4) /bin/echo "0" > /dev/cpuset/cpuset_0/cpus
5) /bin/echo "0" > /dev/cpuset/cpuset_0/mems
6) /bin/echo "1" > /dev/cpuset/cpuset_0/cpu_exclusive
7) mkdir /dev/cpuset/cpuset_1
8) /bin/echo "1-3" > /dev/cpuset/cpuset_1/cpus
9) /bin/echo "0" > /dev/cpuset/cpuset_1/mems
10) /bin/echo "0" > /dev/cpuset/cpuset_1/cpu_exclusive
11) /bin/echo <task pid> > /dev/cpuset/cpuset_0/tasks
12) for t in $(cat /dev/cpuset/tasks); do /bin/echo $t > /dev/cpuset/cpuset_1/tasks; done

I've also tried:
$ sudo cset shield -c 3
cset: --> activating shielding:
cset: moving 411 tasks from root into system cpuset...
[==================================================]%
cset: "system" cpuset of CPUSPEC(0-2) with 411 tasks running
cset: "user" cpuset of CPUSPEC(3) with 0 tasks running
$ ps -Leo pid,tid,psr,comm | awk '{if($3==3) print $0}' | wc -l
105

Note You need to log in before you can comment on or make changes to this bug.