From: Tejun Heo <tj@kernel.org>
To: Chen Yu <yu.c.chen@intel.com>
Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
Vlastimil Babka <vbabka@suse.cz>, Rik van Riel <riel@redhat.com>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
David Rientjes <rientjes@google.com>,
Vishnu Pratap Singh <vishnu.ps@samsung.com>,
Pintu Kumar <pintu.k@samsung.com>,
Michal Nazarewicz <mina86@mina86.com>,
Mel Gorman <mgorman@suse.de>,
Paul Gortmaker <paul.gortmaker@windriver.com>,
Peter Zijlstra <peterz@infradead.org>,
Tim Chen <tim.c.chen@linux.intel.com>,
Hugh Dickins <hughd@google.com>, Li Zefan <lizefan@huawei.com>
Subject: Re: [PATCH] cpuset: fix cpus_allowed mask for offline/online CPUs
Date: Sun, 3 Jan 2016 08:59:11 -0500 [thread overview]
Message-ID: <20160103135911.GG3660@htj.duckdns.org> (raw)
In-Reply-To: <2f805346f87680dddfa9253dc9031db3b6ead8ad.1451648318.git.yu.c.chen@intel.com>
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
next prev parent reply other threads:[~2016-01-03 13:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-01 12:09 Chen Yu
2016-01-01 12:08 ` Chen, Yu C
2016-01-03 13:59 ` Tejun Heo [this message]
2016-01-04 1:52 ` Zefan Li
2016-01-04 2:13 ` Chen, Yu C
2016-01-04 2:20 ` Zefan Li
-- strict thread matches above, loose matches on Subject: below --
2015-12-27 18:58 Chen Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160103135911.GG3660@htj.duckdns.org \
--to=tj@kernel.org \
--cc=cgroups@vger.kernel.org \
--cc=hughd@google.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=mgorman@suse.de \
--cc=mina86@mina86.com \
--cc=paul.gortmaker@windriver.com \
--cc=peterz@infradead.org \
--cc=pintu.k@samsung.com \
--cc=riel@redhat.com \
--cc=rientjes@google.com \
--cc=tim.c.chen@linux.intel.com \
--cc=vbabka@suse.cz \
--cc=vishnu.ps@samsung.com \
--cc=yu.c.chen@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome