mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhan Xusheng <zhanxusheng1024@gmail.com>
To: tim.c.chen@linux.intel.com
Cc: yu.c.chen@intel.com, peterz@infradead.org, mingo@redhat.com,
	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,
	zhanxusheng@xiaomi.com
Subject: Re: [PATCH] sched/cache: Keep nr_pref_llc_running in the runnable domain
Date: Fri, 28 Aug 2026 10:20:12 +0800	[thread overview]
Message-ID: <20260828022012.936112-1-zhanxusheng1024@gmail.com> (raw)
In-Reply-To: <59e2b8265fc650266b93d8f523c366edfa912428.camel@linux.intel.com>

From: Zhan Xusheng <zhanxusheng@xiaomi.com>

The ordering the skip depends on is not visible in the diff, so for the
record: dequeue_hierarchy() at fair.c:8148 reaches account_llc_dequeue()
through dequeue_entity(), and clear_delayed() runs only afterwards at
8164, so se->sched_delayed is still set when account_llc_dequeue() tests
it.

The sequences balance:

  enqueue, dequeue                   +1, -1
  enqueue, sleep, wake, dequeue      +1, -1 set_delayed,
                                     +1 clear_delayed, -1
  enqueue, sleep, real dequeue       +1, -1, skip, no re-add
  load balance moves a delayed task  source unchanged, destination +1
                                     with sched_delayed already clear

requeue_delayed_entity() does not reach account_entity_enqueue(), doing
only __enqueue_entity() and clear_delayed(), so the wake path cannot
double count.  account_mm_sched() cannot see a delayed task either, since
task_running_on_cpu() at fair.c:12245 requires task_on_rq_queued() on the
current cpu and the caller is update_curr().

sd->llc_counts is right to stay on queued semantics: both readers compare
it against another llc_counts value, at fair.c:11895 and 13228, so delayed
tasks shift both sides alike.

Reviewed-by: Zhan Xusheng <zhanxusheng@xiaomi.com>

Thanks,
Zhan Xusheng

  reply	other threads:[~2026-08-28  2:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-27 13:50 sched/fair: which tasks should nr_pref_llc_running be compared against? Zhan Xusheng
2026-08-27 20:57 ` Tim Chen
2026-08-28  2:20   ` Zhan Xusheng [this message]
2026-08-28 17:08     ` [PATCH] sched/cache: Keep nr_pref_llc_running in the runnable domain Tim Chen

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=20260828022012.936112-1-zhanxusheng1024@gmail.com \
    --to=zhanxusheng1024@gmail.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=tim.c.chen@linux.intel.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=yu.c.chen@intel.com \
    --cc=zhanxusheng@xiaomi.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®