linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: "Michal Koutný" <mkoutny@suse.com>
Cc: Tejun Heo <tj@kernel.org>, Zefan Li <lizefan.x@bytedance.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Shuah Khan <shuah@kernel.org>,
	cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, Will Deacon <will@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>
Subject: Re: [PATCH v2 3/4] cgroup/cpuset: Include offline CPUs when tasks' cpumasks in top_cpuset are updated
Date: Fri, 17 Mar 2023 14:05:32 -0400	[thread overview]
Message-ID: <11b5454b-42c7-fb0d-f071-c46712f76f3b@redhat.com> (raw)
In-Reply-To: <20230317180157.uqlleobldg53pgj6@blackpad>


On 3/17/23 14:01, Michal Koutný wrote:
> Hello.
>
> On Fri, Mar 17, 2023 at 11:15:07AM -0400, Waiman Long <longman@redhat.com> wrote:
>>    * Iterate through each task of @cs updating its cpus_allowed to the
>>    * effective cpuset's.  As this function is called with cpuset_rwsem held,
>> - * cpuset membership stays stable.
>> + * cpuset membership stays stable. For top_cpuset, task_cpu_possible_mask()
>> + * is used instead of effective_cpus to make sure all offline CPUs are also
>> + * included as hotplug code won't update cpumasks for tasks in top_cpuset.
>>    */
> On Wed, Mar 15, 2023 at 11:06:20AM +0100, Michal Koutný <mkoutny@suse.com> wrote:
>> I see now that it returns offlined cpus to top cpuset's tasks.
> I considered only the "base" set change cs->effective_cpus ->
> possible_mask. (Apologies for that mistake.)
>
> However, I now read the note about subparts_cpus
>
>>          * effective_cpus contains only onlined CPUs, but subparts_cpus
>>          * may have offlined ones.
> So if subpart_cpus keeps offlined CPUs, they will be subtracted from
> possible_mask and absent in the resulting new_cpus, i.e. undesirable for
> the tasks in that cpuset :-/

A cpu will be in the subparts_cpus only if it has been given to the 
child partition. So when it becomes online, it will become part of the 
scheduling domain that child partition. Only the tasks in that child 
partition will get their cpumasks updated to use it, not those in the 
top cpuset.

Cheers,
Longman


  reply	other threads:[~2023-03-17 18:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-17 15:15 [PATCH v2 0/4] cgroup/cpuset: Miscellaneous updates Waiman Long
2023-03-17 15:15 ` [PATCH v2 1/4] cgroup/cpuset: Fix partition root's cpuset.cpus update bug Waiman Long
2023-03-29 18:37   ` Tejun Heo
2023-03-17 15:15 ` [PATCH v2 2/4] cgroup/cpuset: Skip task update if hotplug doesn't affect current cpuset Waiman Long
2023-03-17 15:15 ` [PATCH v2 3/4] cgroup/cpuset: Include offline CPUs when tasks' cpumasks in top_cpuset are updated Waiman Long
2023-03-17 18:01   ` Michal Koutný
2023-03-17 18:05     ` Waiman Long [this message]
2023-03-20 15:04       ` Michal Koutný
2023-03-17 15:15 ` [PATCH v2 4/4] cgroup/cpuset: Minor updates to test_cpuset_prs.sh Waiman Long
2023-03-29 18:43   ` Tejun Heo
2023-03-28 13:40 ` [PATCH v2 0/4] cgroup/cpuset: Miscellaneous updates Will Deacon
2023-03-29  1:15   ` Waiman Long

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=11b5454b-42c7-fb0d-f071-c46712f76f3b@redhat.com \
    --to=longman@redhat.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=mkoutny@suse.com \
    --cc=peterz@infradead.org \
    --cc=shuah@kernel.org \
    --cc=tj@kernel.org \
    --cc=will@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).