From: Peter Zijlstra <peterz@infradead.org>
To: "Joel Fernandes (Google)" <joel@joelfernandes.org>
Cc: Nishanth Aravamudan <naravamudan@digitalocean.com>,
Julien Desfossez <jdesfossez@digitalocean.com>,
Tim Chen <tim.c.chen@linux.intel.com>,
Vineeth Pillai <viremana@linux.microsoft.com>,
Aaron Lu <aaron.lwe@gmail.com>,
Aubrey Li <aubrey.intel@gmail.com>,
tglx@linutronix.de, linux-kernel@vger.kernel.org,
mingo@kernel.org, torvalds@linux-foundation.org,
fweisbec@gmail.com, keescook@chromium.org, kerrnel@google.com,
Phil Auld <pauld@redhat.com>,
Valentin Schneider <valentin.schneider@arm.com>,
Mel Gorman <mgorman@techsingularity.net>,
Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
Paolo Bonzini <pbonzini@redhat.com>,
vineeth@bitbyteword.org, Chen Yu <yu.c.chen@intel.com>,
Christian Brauner <christian.brauner@ubuntu.com>,
Agata Gruza <agata.gruza@intel.com>,
Antonio Gomez Iglesias <antonio.gomez.iglesias@intel.com>,
graf@amazon.com, konrad.wilk@oracle.com, dfaggioli@suse.com,
pjt@google.com, rostedt@goodmis.org, derkling@google.com,
benbjiang@tencent.com,
Alexandre Chartre <alexandre.chartre@oracle.com>,
James.Bottomley@hansenpartnership.com, OWeisse@umich.edu,
Dhaval Giani <dhaval.giani@oracle.com>,
Junaid Shahid <junaids@google.com>,
jsbarnes@google.com, chris.hyser@oracle.com,
Ben Segall <bsegall@google.com>, Josh Don <joshdon@google.com>,
Hao Luo <haoluo@google.com>,
Tom Lendacky <thomas.lendacky@amd.com>
Subject: Re: [PATCH v10 2/5] sched: CGroup tagging interface for core scheduling
Date: Thu, 4 Feb 2021 14:59:58 +0100 [thread overview]
Message-ID: <YBv93iXqI8UTw9tD@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <YBrUgxLfjcpjwgo6@hirez.programming.kicks-ass.net>
On Wed, Feb 03, 2021 at 05:51:15PM +0100, Peter Zijlstra wrote:
>
> I'm slowly starting to go through this...
>
> On Fri, Jan 22, 2021 at 08:17:01PM -0500, Joel Fernandes (Google) wrote:
> > +static bool sched_core_empty(struct rq *rq)
> > +{
> > + return RB_EMPTY_ROOT(&rq->core_tree);
> > +}
> > +
> > +static struct task_struct *sched_core_first(struct rq *rq)
> > +{
> > + struct task_struct *task;
> > +
> > + task = container_of(rb_first(&rq->core_tree), struct task_struct, core_node);
> > + return task;
> > +}
>
> AFAICT you can do with:
>
> static struct task_struct *sched_core_any(struct rq *rq)
> {
> return rb_entry(rq->core_tree.rb_node, struct task_struct, code_node);
> }
>
> > +static void sched_core_flush(int cpu)
> > +{
> > + struct rq *rq = cpu_rq(cpu);
> > + struct task_struct *task;
> > +
> > + while (!sched_core_empty(rq)) {
> > + task = sched_core_first(rq);
> > + rb_erase(&task->core_node, &rq->core_tree);
> > + RB_CLEAR_NODE(&task->core_node);
> > + }
> > + rq->core->core_task_seq++;
> > +}
>
> However,
>
> > + for_each_possible_cpu(cpu) {
> > + struct rq *rq = cpu_rq(cpu);
> > +
> > + WARN_ON_ONCE(enabled == rq->core_enabled);
> > +
> > + if (!enabled || (enabled && cpumask_weight(cpu_smt_mask(cpu)) >= 2)) {
> > + /*
> > + * All active and migrating tasks will have already
> > + * been removed from core queue when we clear the
> > + * cgroup tags. However, dying tasks could still be
> > + * left in core queue. Flush them here.
> > + */
> > + if (!enabled)
> > + sched_core_flush(cpu);
> > +
> > + rq->core_enabled = enabled;
> > + }
> > + }
>
> I'm not sure I understand. Is the problem that we're still schedulable
> during do_exit() after cgroup_exit() ? It could be argued that when we
> leave the cgroup there, we should definitely leave the tag group too.
That is, did you forget to implement cpu_cgroup_exit()?
next prev parent reply other threads:[~2021-02-04 14:04 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-23 1:16 [PATCH v10 0/5] Core scheduling remaining patches Joel Fernandes (Google)
2021-01-23 1:17 ` [PATCH v10 1/5] sched: migration changes for core scheduling Joel Fernandes (Google)
2021-01-23 1:17 ` [PATCH v10 2/5] sched: CGroup tagging interface " Joel Fernandes (Google)
2021-02-03 16:51 ` Peter Zijlstra
2021-02-04 13:59 ` Peter Zijlstra [this message]
2021-02-05 16:42 ` Joel Fernandes
2021-02-04 13:54 ` Peter Zijlstra
2021-02-05 3:45 ` Josh Don
2021-02-04 13:57 ` Peter Zijlstra
2021-02-04 20:52 ` Chris Hyser
2021-02-05 10:43 ` Peter Zijlstra
2021-02-05 22:19 ` Chris Hyser
2021-02-04 14:01 ` Peter Zijlstra
2021-02-05 3:55 ` Josh Don
2021-02-04 14:35 ` Peter Zijlstra
2021-02-05 4:07 ` Josh Don
2021-02-04 14:52 ` Peter Zijlstra
2021-02-05 16:37 ` Joel Fernandes
2021-02-05 11:41 ` Peter Zijlstra
2021-02-05 11:52 ` Peter Zijlstra
2021-02-06 1:15 ` Josh Don
2021-02-05 12:00 ` Peter Zijlstra
2021-02-23 4:00 ` Chris Hyser
2021-02-23 9:05 ` Peter Zijlstra
2021-02-23 19:25 ` Chris Hyser
2021-02-24 5:15 ` Josh Don
2021-02-24 13:02 ` Chris Hyser
2021-02-24 13:52 ` chris hyser
2021-02-24 15:47 ` chris hyser
2021-02-26 20:07 ` Chris Hyser
2021-03-01 21:01 ` Josh Don
2021-01-23 1:17 ` [PATCH v10 3/5] kselftest: Add tests for core-sched interface Joel Fernandes (Google)
2021-01-23 1:17 ` [PATCH v10 4/5] Documentation: Add core scheduling documentation Joel Fernandes (Google)
2021-01-23 1:17 ` [PATCH v10 5/5] sched: Debug bits Joel Fernandes (Google)
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=YBv93iXqI8UTw9tD@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=James.Bottomley@hansenpartnership.com \
--cc=OWeisse@umich.edu \
--cc=aaron.lwe@gmail.com \
--cc=agata.gruza@intel.com \
--cc=alexandre.chartre@oracle.com \
--cc=antonio.gomez.iglesias@intel.com \
--cc=aubrey.intel@gmail.com \
--cc=benbjiang@tencent.com \
--cc=bsegall@google.com \
--cc=chris.hyser@oracle.com \
--cc=christian.brauner@ubuntu.com \
--cc=derkling@google.com \
--cc=dfaggioli@suse.com \
--cc=dhaval.giani@oracle.com \
--cc=fweisbec@gmail.com \
--cc=graf@amazon.com \
--cc=haoluo@google.com \
--cc=jdesfossez@digitalocean.com \
--cc=joel@joelfernandes.org \
--cc=joshdon@google.com \
--cc=jsbarnes@google.com \
--cc=junaids@google.com \
--cc=keescook@chromium.org \
--cc=kerrnel@google.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@techsingularity.net \
--cc=mingo@kernel.org \
--cc=naravamudan@digitalocean.com \
--cc=pauld@redhat.com \
--cc=pawan.kumar.gupta@linux.intel.com \
--cc=pbonzini@redhat.com \
--cc=pjt@google.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--cc=tim.c.chen@linux.intel.com \
--cc=torvalds@linux-foundation.org \
--cc=valentin.schneider@arm.com \
--cc=vineeth@bitbyteword.org \
--cc=viremana@linux.microsoft.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;
as well as URLs for NNTP newsgroup(s).