Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1300307
| From | Tejun Heo <tj@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] cpuset: fix cpus_allowed mask for offline/online CPUs |
| Date | 2016-01-03 15:00 +0100 |
| Message-ID | <qMRmq-69u-9@gated-at.bofh.it> (permalink) |
| References | <qM6GS-2hD-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, Jan 01, 2016 at 08:09:13PM +0800, Chen Yu wrote:
> Commit be4c9dd7aee5 ("cpuset: enable onlined cpu/node in effective masks")
> leverages cpuset's cpus_allowed and its parent's effective_cpus to calculate
> the new_cpus by:
>
> cpumask_and(&new_cpus, cs->cpus_allowed, parent_cs(cs)->effective_cpus);
>
> However cpus_allowed will also be updated after the CPU is offline, in
> hotplug_update_tasks_legacy, so when the CPU is online again, it will use
> the old cpus_allowed mask to calculate the new_cpus, thus new_cpus will get
> incorrect value after each round of offline/online.
>
> This problem is found on ubuntu 15.10 with cpuset mounted:
>
> 1. echo 0 > /sys/devices/system/cpu/cpu2/online
> 2. echo 1 > /sys/devices/system/cpu/cpu2/online
> 3. cat /sys/fs/cgroup/cpuset/cpuset.cpus
> 0-3
> 4. cat /sys/fs/cgroup/cpuset/user.slice/cpuset.cpus
> 0-1,3
> 5. taskset -c 2 ls
> taskset: failed to set pid 0's affinity: Invalid argument
>
> This patch works around this problem by introducing a new
> mask cpumask_var_t cpus_sysfs inside struct cpuset,
> which will only be updated by writing value to sysfs.cpuset.cpus,
> and CPU offline/online will use this mask to set the new cpumask
> for a cpuset.
Li?
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] cpuset: fix cpus_allowed mask for offline/online CPUs Chen Yu <yu.c.chen@intel.com> - 2016-01-01 13:10 +0100
RE: [PATCH] cpuset: fix cpus_allowed mask for offline/online CPUs "Chen, Yu C" <yu.c.chen@intel.com> - 2016-01-01 13:10 +0100
Re: [PATCH] cpuset: fix cpus_allowed mask for offline/online CPUs Tejun Heo <tj@kernel.org> - 2016-01-03 15:00 +0100
Re: [PATCH] cpuset: fix cpus_allowed mask for offline/online CPUs Zefan Li <lizefan@huawei.com> - 2016-01-04 03:00 +0100
RE: [PATCH] cpuset: fix cpus_allowed mask for offline/online CPUs "Chen, Yu C" <yu.c.chen@intel.com> - 2016-01-04 03:20 +0100
Re: [PATCH] cpuset: fix cpus_allowed mask for offline/online CPUs Zefan Li <lizefan@huawei.com> - 2016-01-04 03:30 +0100
csiph-web