linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	Valentin Schneider <vschneid@redhat.com>,
	linux-kernel@vger.kernel.org, Phil Auld <pauld@redhat.com>,
	Brent Rowsell <browsell@redhat.com>,
	Peter Hunt <pehunt@redhat.com>
Subject: Re: [PATCH] sched/core: Use empty mask to reset cpumasks in sched_setaffinity()
Date: Wed, 5 Jul 2023 10:07:34 -0400	[thread overview]
Message-ID: <244e207a-95d5-2ff3-d0ec-c974538032af@redhat.com> (raw)
In-Reply-To: <20230705093752.GW4253@hirez.programming.kicks-ass.net>


On 7/5/23 05:37, Peter Zijlstra wrote:
> On Mon, Jul 03, 2023 at 10:55:02AM -0400, Waiman Long wrote:
>
>> Our OpenShift team has actually hit a problem with the recent persistent
>> user provided cpu affinity change because they are relying on the fact that
>> moving a task to a different cpuset will reset cpu affinity to the cpuset
>> default which is no longer true. That is the main reason behind this patch
>> to provide a way to reset cpu affinity to the cpuset default.
> Where is the sched_setaffinity() in that story?
>
> So somewhere this thing did a sched_setaffinity() and then starts
> playing with cpusets. Instead of adding more sched_setaffinity() calls,
> can't it just remove some?

I don't know the full picture. From what I understand, there is a master 
control process that limit its cpu affinity to just a limited set of 
housekeeping CPUs. It then spawn child processes to be run in different 
containers. The control process doesn't need to change its cpu affinity.

In the past, putting the child processes in a different container 
(cpuset) will reset its affinity to that of the cpuset. That is not true 
anymore because user_cpus_ptr is inherited in the forked child process. 
I have thought about 2 ways to address that. Either we introduce a new 
clone flag to disable the inheritance of users_cpu_ptr or a way to reset 
the cpu affinity to the default which is what this patch does.

Cheers,
Longman



  reply	other threads:[~2023-07-05 14:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-28 21:16 [PATCH] sched/core: Use empty mask to reset cpumasks in sched_setaffinity() Waiman Long
2023-07-03 10:26 ` Peter Zijlstra
2023-07-03 14:55   ` Waiman Long
2023-07-05  9:37     ` Peter Zijlstra
2023-07-05 14:07       ` Waiman Long [this message]
2023-07-17  7:43 ` kernel test robot
2023-07-17 14:41   ` [LTP] " Cyril Hrubis
2023-07-21  2:13     ` 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=244e207a-95d5-2ff3-d0ec-c974538032af@redhat.com \
    --to=longman@redhat.com \
    --cc=bristot@redhat.com \
    --cc=browsell@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=pauld@redhat.com \
    --cc=pehunt@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.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;
as well as URLs for NNTP newsgroup(s).