From: Zefan Li <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: Chen Yu <yu.c.chen-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Vlastimil Babka <vbabka-AlSwsSmVLrQ@public.gmane.org>,
Rik van Riel <riel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Joonsoo Kim <iamjoonsoo.kim-Hm3cg6mZ9cc@public.gmane.org>,
David Rientjes <rientjes-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Vishnu Pratap Singh
<vishnu.ps-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
Pintu Kumar <pintu.k-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
Michal Nazarewicz
<mina86-deATy8a+UHjQT0dZR+AlfA@public.gmane.org>,
Mel Gorman <mgorman-l3A5Bk7waGM@public.gmane.org>,
Paul Gortmaker
<paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>,
Peter Zijlstra <peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
Tim Chen <tim.c.chen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
Hugh Dickins <hughd-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH] cpuset: fix cpus_allowed mask for offline/online CPUs
Date: Mon, 4 Jan 2016 09:52:09 +0800 [thread overview]
Message-ID: <5689D049.4040500@huawei.com> (raw)
In-Reply-To: <2f805346f87680dddfa9253dc9031db3b6ead8ad.1451648318.git.yu.c.chen-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
On 2016/1/1 20:09, 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 is the expected behavior...In legacy hierachy onlining an offlined cpu
won't restore cpuset configurations automatically.
Commit be4c9dd7aee5 changed this behavior, but only for unified hierachy.
WARNING: multiple messages have this Message-ID (diff)
From: Zefan Li <lizefan@huawei.com>
To: Chen Yu <yu.c.chen@intel.com>, <cgroups@vger.kernel.org>
Cc: <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>, Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH] cpuset: fix cpus_allowed mask for offline/online CPUs
Date: Mon, 4 Jan 2016 09:52:09 +0800 [thread overview]
Message-ID: <5689D049.4040500@huawei.com> (raw)
In-Reply-To: <2f805346f87680dddfa9253dc9031db3b6ead8ad.1451648318.git.yu.c.chen@intel.com>
On 2016/1/1 20:09, 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 is the expected behavior...In legacy hierachy onlining an offlined cpu
won't restore cpuset configurations automatically.
Commit be4c9dd7aee5 changed this behavior, but only for unified hierachy.
next prev parent reply other threads:[~2016-01-04 1:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-01 12:09 [PATCH] cpuset: fix cpus_allowed mask for offline/online CPUs Chen Yu
2016-01-01 12:09 ` Chen Yu
2016-01-01 12:08 ` Chen, Yu C
[not found] ` <2f805346f87680dddfa9253dc9031db3b6ead8ad.1451648318.git.yu.c.chen-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-01-03 13:59 ` Tejun Heo
2016-01-03 13:59 ` Tejun Heo
2016-01-04 1:52 ` Zefan Li [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=5689D049.4040500@huawei.com \
--to=lizefan-hv44wf8li93qt0dzr+alfa@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=hughd-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=iamjoonsoo.kim-Hm3cg6mZ9cc@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mgorman-l3A5Bk7waGM@public.gmane.org \
--cc=mina86-deATy8a+UHjQT0dZR+AlfA@public.gmane.org \
--cc=paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org \
--cc=peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=pintu.k-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=riel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=rientjes-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=tim.c.chen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=vbabka-AlSwsSmVLrQ@public.gmane.org \
--cc=vishnu.ps-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=yu.c.chen-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.