linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qais Yousef <qais.yousef@arm.com>
To: David Laight <David.Laight@ACULAB.COM>
Cc: Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"juri.lelli@redhat.com" <juri.lelli@redhat.com>,
	"rostedt@goodmis.org" <rostedt@goodmis.org>,
	"bsegall@google.com" <bsegall@google.com>,
	"mgorman@suse.de" <mgorman@suse.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"parth@linux.ibm.com" <parth@linux.ibm.com>,
	"chris.hyser@oracle.com" <chris.hyser@oracle.com>,
	"pkondeti@codeaurora.org" <pkondeti@codeaurora.org>,
	"Valentin.Schneider@arm.com" <Valentin.Schneider@arm.com>,
	"patrick.bellasi@matbug.net" <patrick.bellasi@matbug.net>,
	"pjt@google.com" <pjt@google.com>, "pavel@ucw.cz" <pavel@ucw.cz>,
	"tj@kernel.org" <tj@kernel.org>,
	"qperret@google.com" <qperret@google.com>,
	"tim.c.chen@linux.intel.com" <tim.c.chen@linux.intel.com>,
	Wei Wang <wvw@google.com>
Subject: Re: Scheduling tasks on idle cpu
Date: Tue, 12 Apr 2022 00:34:47 +0100	[thread overview]
Message-ID: <20220411233447.rcencjivkhyltyxm@airbuntu> (raw)
In-Reply-To: <030aacb0c1304e43ab917924dcf4f138@AcuMS.aculab.com>

On 04/11/22 08:26, David Laight wrote:
> From: Qais Yousef
> > Sent: 09 April 2022 18:09
> ...
> > RT scheduler will push/pull tasks to ensure the task will get to run ASAP if
> > there's another cpu at lower priority is available
> 
> Does that actually happen?

For RT tasks, yes. They should get distributed.

> I've seen the following:
>   34533 [017]: sys_futex(uaddr: 1049104, op: 85, val: 1, utime: 1, uaddr2: 1049100, val3: 4000001)
>   34533 [017]: sched_migrate_task: pid=34512 prio=120 orig_cpu=14 dest_cpu=17
>   34533 [017]: sched_wakeup: pid=34512 prio=120 success=1 target_cpu=017

prio=120 is a CFS task, no?

> and pid 34512 doesn't get scheduled until pid 34533 finally sleeps.
> This is in spite of there being 5 idle cpu.
> cpu 14 is busy running a RT thread, but migrating to cpu 17 seems wrong.
> 
> This is on a RHEL7 kernel, I've not replicated it on anything recent.
> But I've very much like a RT thread to be able to schedule a non-RT
> thread to run on an idle cpu.

Oh, you want CFS to avoid CPUs that are running RT tasks.

We had a proposal in the past, but it wasn't good enough

	https://lore.kernel.org/lkml/1567048502-6064-1-git-send-email-jing-ting.wu@mediatek.com/

The approach in that patch modified RT to avoid CFS actually.

Can you verify whether the RT task woke up after task 34512 was migrated to CPU
17? Looking at the definition of available_idle_cpu() we should have avoided
that CPU if the RT task was already running. Both waking up at the same time
would explain what you see. Otherwise I'm not sure why it picked CPU 17.

Thanks

--
Qais Yousef

  parent reply	other threads:[~2022-04-11 23:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-11  8:26 Scheduling tasks on idle cpu David Laight
2022-04-11  9:26 ` Steven Rostedt
2022-04-11  9:57   ` David Laight
2022-04-11 23:34 ` Qais Yousef [this message]
2022-04-12  8:39   ` David Laight
2022-04-12  9:07     ` Vincent Guittot
2022-04-13 23:57       ` Qais Yousef
2022-04-14  7:54         ` Vincent Guittot
2022-04-14  8:35           ` David Laight
2022-04-14 10:16             ` Vincent Guittot
2022-04-14 14:14               ` David Laight
2022-04-15  7:15                 ` Vincent Guittot
2022-04-13 23:51     ` Qais Yousef
2022-04-14  6:09       ` David Laight
2022-04-14 22:26         ` Qais Yousef

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=20220411233447.rcencjivkhyltyxm@airbuntu \
    --to=qais.yousef@arm.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=Valentin.Schneider@arm.com \
    --cc=bsegall@google.com \
    --cc=chris.hyser@oracle.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=parth@linux.ibm.com \
    --cc=patrick.bellasi@matbug.net \
    --cc=pavel@ucw.cz \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=pkondeti@codeaurora.org \
    --cc=qperret@google.com \
    --cc=rostedt@goodmis.org \
    --cc=tim.c.chen@linux.intel.com \
    --cc=tj@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=wvw@google.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).