mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: liuwenfang <liuwenfang@honor.com>
To: 'Tejun Heo' <tj@kernel.org>
Cc: 'David Vernet' <void@manifault.com>,
	'Andrea Righi' <arighi@nvidia.com>,
	'Changwoo Min' <changwoo@igalia.com>,
	'Ingo Molnar' <mingo@redhat.com>,
	'Peter Zijlstra' <peterz@infradead.org>,
	'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>,
	'Valentin Schneider' <vschneid@redhat.com>,
	"'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>,
	"Kumar Kartikeya Dwivedi" <memxor@gmail.com>
Subject: Re: [PATCH] sched_ext: introduce cpu tick
Date: Wed, 11 Jun 2025 02:22:11 +0000	[thread overview]
Message-ID: <7ce25e0b235f4339893f5e74ad9c7d36@honor.com> (raw)
In-Reply-To: <aEhyZJmjhYJfVe9v@slm.duckdns.org>

Thanks for your feedback.

Another one issue is that if a runnable local SCX task has p->nr_cpus_allowed equal to 1,
and there are RT tasks on this CPU's runqueue, we need a chance to let BPF scheduler to adjust RT 
throttle param properly(or other methods), so that the local boud SCX task will be scheduled
in time. This is important for the mobile scenario to render smoothly at 120 frames per second.
scx_bpf_reenqueue_local will not work for the local SCX when p->nr_cpus_allowed == 1.

Also some tradeoff methods can be taken to balance the performance:
If the running SCX task is preempted by one short-running RT task(predicted by its history),
then it is better for the BPF scheduler to keep this SCX task on its local dsq, rather than directly calling
scx_bpf_reenqueue_local(). However, we still need protection for this situation in case the
short RT task become long-running task(perhaps due to some exception).

Any suggestions and comments are welcome!

Best regards

> 
> Hello,
> 
> On Tue, Jun 10, 2025 at 08:59:45AM +0000, liuwenfang wrote:
> > Assume one CPU is running one RT task and one runnable scx task on its
> > local dsq, the scx task cannot be scheduled until RT task enters
> > sleep, if RT task will run for 100ms, the scx task should be migrated
> > to other dsqs, then it can have a chance to be scheduled by other CPUs.
> >
> > So cpu_tick is added to notitfy BPF scheduler to check long runnable
> > scx on its local dsq, related policy can be taken to improve the
> > performance.
> 
> (cc'ing Kumar as we discussed similar issue recently)
> 
> There are some race conditions we need to address but calling
> scx_bpf_reenqueue_local() from ops.cpu_release() is the intended way of
> handling these situations. I don't think periodically polling from ticks is a good
> approach, especially given that ticks can be skipped w/ nohz_full.
> 
> Thanks.
> 
> --
> tejun

  reply	other threads:[~2025-06-11  2:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-10  8:59 liuwenfang
2025-06-10 17:59 ` 'Tejun Heo'
2025-06-11  2:22   ` liuwenfang [this message]
2025-06-11  5:47     ` Andrea Righi

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=7ce25e0b235f4339893f5e74ad9c7d36@honor.com \
    --to=liuwenfang@honor.com \
    --cc=arighi@nvidia.com \
    --cc=bsegall@google.com \
    --cc=changwoo@igalia.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=memxor@gmail.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tj@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=void@manifault.com \
    --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

all inboxes | Powered by JetHome®