mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Xin Zhao <jackzxcui1989@163.com>
To: vincent.guittot@linaro.org
Cc: bsegall@google.com, dietmar.eggemann@arm.com,
	jackzxcui1989@163.com, juri.lelli@redhat.com,
	kprateek.nayak@amd.com, linux-kernel@vger.kernel.org,
	mgorman@suse.de, mingo@redhat.com, peterz@infradead.org,
	rostedt@goodmis.org, vschneid@redhat.com
Subject: Re: [RFC PATCH RESEND 05/10] sched/fair: Introduce select_task_rq_fair_thin() to select rq when LB_PROMOTE
Date: Sat, 12 Sep 2026 12:08:04 +0800	[thread overview]
Message-ID: <20260912040804.3391229-1-jackzxcui1989@163.com> (raw)
In-Reply-To: <CAKfTPtCQUndM7NfMYpz8S6vXhwbwrOYALr9dNb+971XgZ9GqnA@mail.gmail.com>

On Fri, 11 Sep 2026 14:27:04 +0200 Vincent Guittot <vincent.guittot@linaro.org> wrote:

> > I did overlook the detail regarding the SD_BALANCE_WAKE flag; our project did
> > not change the default state of the SD_BALANCE_WAKE flag, which is set to 0
> > Moreover, as far as I know, most embedded Linux projects have real-time
> > requirements and generally do not modify this SD_BALANCE_WAKE flag
> 
> But if you have real-time requirements, why don't you use the
> real-time scheduler ?

Due to fair scheduling, especially in a 250Hz system, we often experience significant
scheduling delays. Therefore, we have already converted many critical tasks to real-time
in our projecct. Currently, there are already a considerable number of real-time tasks
running on our system. The following is the data on our system:

CPU ID | Total Tasks | Real-time Tasks
------------------------------------------
0 | 369          | 197
1 | 293          | 132
2 | 166          | 53
3 | 103          | 27
4 | 89          | 26
5 | 63          | 29
6 | 173          | 61
7 | 215          | 39
8 | 181          | 53
9 | 77          | 21
10 | 90          | 47
11 | 119          | 63
12 | 55          | 23
13 | 50          | 27
14 | 85          | 33
15 | 143          | 50
16 | 156          | 40
17 | 159          | 44


The RT tasks/total tasks percent is already very high. It is no longer feasible to expand
the scope of real-time tasks, including tasks like kworker, ksoftirqd, and kswap, which
are not suitable for real-time scheduling, right? In particular, within kworker and
ksoftirqd, there are still many scenarios where insufficient scheduling timeliness leads
to increased processing delays in the entire pipeline.

The LB_PROM feature and its associated series of patches are specifically designed to
address this issue. One of the most significant core changes is patch 10; you may want to
take a look at it first. The remaining patches (patch 5, this patch, patch7, patch 8, and
patch 9) all contribute to improving fair scheduling delays.


> > Given this situation, is it necessary to create a new branch for such a "_thin"
> > select_task_rq_fair() variant when enabling LB_PROMOTE?
> 
> At now, I don't see a need for a new branch nor a LB_PROMOTE. You
> failed to describe your problem and came up with thos
> platform-specific solution instead of fixing current code. Putting it
> behind LB_PROMOTE, doesn't make it better.

I took a closer look at the implementation of sched_balance_find_dst_cpu and believe that
this function already meets the requirements. I'm wondering if it would be possible to add
the SD_BALANCE_WAKE flag to the scheduling domains (sd) of each CPU when the LB_PROMOTE
feature is enabled, and then revert it back to 0 after the LB_PROMOTE feature is disabled.
Would that be feasible?


--
Xin Zhao


  reply	other threads:[~2026-09-12  4:09 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-10  4:29 [RFC PATCH RESEND 00/10] sched/fair: A series of load balance patches to improve real-time performance of CFS tasks Xin Zhao
2026-09-10  4:29 ` [RFC PATCH RESEND 01/10] sched/fair: Do not set_rd_overloaded() if rd->online != env->cpus Xin Zhao
2026-09-10  8:30   ` K Prateek Nayak
2026-09-10 13:45     ` Vincent Guittot
2026-09-11  1:06     ` Xin Zhao
2026-09-11  6:21       ` K Prateek Nayak
2026-09-12  1:46         ` Xin Zhao
2026-09-12  1:53         ` Xin Zhao
2026-09-10  4:29 ` [RFC PATCH RESEND 02/10] scbed/fair: Remove duplicate check for busiest_cpu in active_load_balance_cpu_stop() Xin Zhao
2026-09-10 11:41   ` Kayra Cizmeci
2026-09-11  0:22     ` Xin Zhao
2026-09-11  9:20       ` Kayra Cizmeci
2026-09-10  4:29 ` [RFC PATCH RESEND 03/10] sched/fair: Clear active_balance at the end of active_load_balance_cpu_stop() Xin Zhao
2026-09-10  8:09   ` K Prateek Nayak
2026-09-10 14:15     ` Xin Zhao
2026-09-10  4:29 ` [RFC PATCH RESEND 04/10] sched/fair: Add LB_PROMOTE feature to enhance real-time performance of fair tasks Xin Zhao
2026-09-11 12:32   ` Vincent Guittot
2026-09-12  4:28     ` Xin Zhao
2026-09-10  4:29 ` [RFC PATCH RESEND 05/10] sched/fair: Introduce select_task_rq_fair_thin() to select rq when LB_PROMOTE Xin Zhao
2026-09-10  8:19   ` Vincent Guittot
2026-09-10 14:39     ` Xin Zhao
2026-09-10 15:31       ` Vincent Guittot
2026-09-10 15:56         ` Xin Zhao
2026-09-11 12:27           ` Vincent Guittot
2026-09-12  4:08             ` Xin Zhao [this message]
2026-09-15 11:56               ` Vincent Guittot
2026-09-15 21:43                 ` Kayra Cizmeci
2026-09-10 12:00   ` Kayra Cizmeci
2026-09-10 14:56     ` Xin Zhao
2026-09-15 18:19       ` Kayra Cizmeci
2026-09-10  4:29 ` [RFC PATCH RESEND 06/10] sched/fair: Modify active_load_balance_cpu_stop() to accommodate more scenarios Xin Zhao
2026-09-10  4:29 ` [RFC PATCH RESEND 07/10] sched/fair: Trigger active balance if a CFS task is preempted when LB_PROMOTE Xin Zhao
2026-09-10  4:29 ` [RFC PATCH RESEND 08/10] sched/fair: Do not check avg_idle to prematurely exit newly idle " Xin Zhao
2026-09-10  4:29 ` [RFC PATCH RESEND 09/10] sched/fair: Not goto more_balance if newly idle and has pending task when LBF_NEED_BREAK Xin Zhao
2026-09-10  4:29 ` [RFC PATCH RESEND 10/10] sched/fair: Strive to find a task to migrate if newly idle when LB_PROMOTE Xin Zhao

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=20260912040804.3391229-1-jackzxcui1989@163.com \
    --to=jackzxcui1989@163.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@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

all inboxes | Powered by JetHome®