From: Kayra Cizmeci <kayracizmeci@gmail.com>
To: Li kunyu <likunyu@open-hieco.net>
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: Simplify pref_llc_queued handling in account_llc_enqueue()
Date: Fri, 27 Nov 2026 12:33:01 +0300 [thread overview]
Message-ID: <awlMqTZK8_0gmSMC@scheduler.schedules> (raw)
In-Reply-To: <20261127091146.3504-1-likunyu@open-hieco.net>
Hi,
On Fri, Nov 27, 2026 at 05:11:46PM +0800, Li kunyu wrote:
> pref_llc_queued is only used once. Assign p->pref_llc_queued directly
> at the original sampling point instead of caching the value in a local
> variable.
>
> Suggested-by: Kayra Cizmeci <kayracizmeci@gmail.com>
> Link: https://lore.kernel.org/all/awhlwJTOLPeNqFW8@scheduler.schedules/
I didn't really suggest anything. I don't know which part of my mail
was a suggestion to you? Maybe below code is correct but I didn't
suggest it. So please remove my tag from the patch.
> Signed-off-by: Li kunyu <likunyu@open-hieco.net>
> ---
> kernel/sched/fair.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index da0d9e19c457..4efc5ed5e79f 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -1521,16 +1521,13 @@ static void pref_llc_running_dec(struct rq *rq, struct task_struct *p)
>
> static void account_llc_enqueue(struct rq *rq, struct task_struct *p)
> {
> - int pref_llc, pref_llc_queued;
> + int pref_llc;
> struct sched_domain *sd;
>
> pref_llc = p->preferred_llc;
> if (pref_llc < 0)
> return;
>
> - pref_llc_queued = (pref_llc == task_llc(p));
> - rq->nr_llc_running++;
> -
> /*
> * Record whether p is enqueued on its preferred
> * LLC, in order to pair with account_llc_dequeue()
> @@ -1545,7 +1542,8 @@ static void account_llc_enqueue(struct rq *rq, struct task_struct *p)
> * p->pref_llc_queued in account_llc_dequeue() would
> * be reliable.
> */
> - p->pref_llc_queued = pref_llc_queued;
> + p->pref_llc_queued = (pref_llc == task_llc(p));
> + rq->nr_llc_running++;
>
> /* Skipped while delayed; clear_delayed() adds it back on wake. */
> pref_llc_running_inc(rq, p);
> --
> 2.47.3
>
Thanks,
Kayra
next prev parent reply other threads:[~2026-11-27 9:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 9:11 Li kunyu
2026-11-27 9:33 ` Kayra Cizmeci [this message]
2026-11-27 9:47 ` Li kunyu
2026-11-27 10:22 ` Kayra Cizmeci
2026-11-27 10:40 ` Li kunyu
2026-11-27 11:00 ` [PATCH v2] " 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=awlMqTZK8_0gmSMC@scheduler.schedules \
--to=kayracizmeci@gmail.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=kprateek.nayak@amd.com \
--cc=likunyu@open-hieco.net \
--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®