mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Li kunyu <likunyu@open-hieco.net>
To: Kayra Cizmeci <kayracizmeci@gmail.com>
Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
	vschneid@redhat.com, kprateek.nayak@amd.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched/fair: Distribute burst-woken tasks when rq depth reaches 3x average
Date: Fri, 6 Nov 2026 09:58:38 +0800	[thread overview]
Message-ID: <94de48b0-dede-0338-ddfc-0c5076221e78@open-hieco.net> (raw)
In-Reply-To: <auypmYsIO08V3avZ@scheduler.schedules>



On 2026/11/6 0:46, Kayra Cizmeci wrote:
>> Here, the existing logic is reused, with new_cpu used as the final return value.
> It's not used as the final return value. We return dist_cpu not new_cpu.
> Look below :-).

The latest code now calls reset_periodic_lb_interval(dist_cpu);. Yesterday's
testing indicated that this change could be further optimized and did not have a
significant impact. The implementation of reset_periodic_lb_interval() has now
been modified as follows:

+static inline void reset_periodic_lb_interval(struct rq *rq)
+{
+       unsigned long now = jiffies;
+
+       if (time_after(READ_ONCE(rq->next_balance), now))
+               WRITE_ONCE(rq->next_balance, now);
+}


>> It remains unclear whether this approach is appropriate. If it causes no
>> practical impact, it seems reasonable to keep it unchanged.
>>
>>>> +			return dist_cpu;
>>>> +		}
>>>> +	}
>>>>  
> 
> Well, if we chose dist_cpu instead of new_cpu why we are calling
> reset_periodic_lb_interval() thingie for new_cpu?
> 
> Even calling it for dist_cpu is questionable.
> 
> 
> Because:
> 
> sched_balance_domains() gets the interval value from
> get_sd_balance_interval(). get_sd_balance_interval() reads the value
> from sd->balance_interval (The value we are resetting) and multiplies it
> by busy_factor if the cpu_busy bool parameter is true.
> 
> sched_balance_domains() calls sched_balance_rq() if jiffies is bigger or equal to
> last_balance + interval.
> 
> Now as you can see, we make the interval value bigger when the CPU is
> busy. In your path, if the new_cpu is not the picked CPU calling this
> makes no sense. Because if we didn't picked it, it already means that
> it's busy or atleast worse than the other options.
> 
> sched_balance_rq() already tries to pull the tasks to the given CPU at
> first place.
> 
> 
> If we really wanna do that, atleast call it for dist_cpu (the returned CPU) not
> for the CPU that lost.
> 
> Or am I getting something wrong?


Should the assignment to sd->balance_interval from the previous version still be
kept? It has been removed in the current test version.

-- 
thanks,
kunyu

  reply	other threads:[~2026-11-06  1:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04  9:18 Li kunyu
2026-11-04  9:34 ` Li kunyu
2026-11-04 18:10 ` Kayra Cizmeci
2026-11-05  1:43   ` Li kunyu
2026-11-05 16:46     ` Kayra Cizmeci
2026-11-06  1:58       ` Li kunyu [this message]
2026-11-05  3:44 ` K Prateek Nayak
2026-11-05 11:24   ` Li kunyu

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=94de48b0-dede-0338-ddfc-0c5076221e78@open-hieco.net \
    --to=likunyu@open-hieco.net \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=kayracizmeci@gmail.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®