mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: albin_yang@163.com
To: kprateek.nayak@amd.com
Cc: albin_yang@163.com, albinwyang@tencent.com, bsegall@google.com,
	chen.yu@linux.dev, dietmar.eggemann@arm.com,
	juri.lelli@redhat.com, kayracizmeci@gmail.com,
	linux-kernel@vger.kernel.org, mgorman@suse.de, mingo@redhat.com,
	peterz@infradead.org, rostedt@goodmis.org,
	vincent.guittot@linaro.org, vschneid@redhat.com
Subject: Re: [PATCH] sched/stats: Fix run_delay over-count for proxy-migrated blocked donors
Date: Mon, 26 Oct 2026 21:38:31 +0800	[thread overview]
Message-ID: <20261026133831.4111227-1-albin_yang@163.com> (raw)
In-Reply-To: <72a6eb77-0461-477b-a0e9-c06a486e3e0e@amd.com>

Hi Prateek,

Thanks - using is_blocked as the single indicator is certainly cleaner than
piling up exceptions.

I rebuilt your diff so it applies cleanly and gave it a run. I'm afraid it
does not work as-is in my testing - two problems:

1) sched_info_depart() now calls __sched_info_dequeue(), which no longer has
   the "if (!last_queued) return;" guard. A blocking task has last_queued == 0
   (sched_info_arrive() cleared it at switch-in), so delta becomes
   rq_clock(rq) - 0, i.e. the whole uptime:

     cross-cpu: blocked 169.80 ms, run_delay delta 169047.52 ms
     same-cpu:  blocked 168.70 ms, run_delay delta 185515.00 ms

   The control is affected too, so this is not proxy specific.

2) sched_info_enqueue() now arms only when t->is_blocked, leaving ordinary
   runnable tasks with no counter at all - my sanity check went from +39 ms to
   0.00 ms in every iteration, including the control. I do not think either
   polarity works: is_blocked is still set during the real wakeup enqueue
   (delayed sleeper: inside ttwu_runnable()'s is_blocked branch; donor: cleared
   only later by ttwu_do_wakeup()). So it can gate the charge side, but the
   arming side needs something already cleared at wakeup - task_is_blocked() or
   sched_delayed.

The delayed reproducer shows 0, but that is easy to misread: it measures only a
delta, and the bogus depart charge lands before the window. Its absolute
run_delay is polluted too. (The 0.00 ms sanity figure is from the proxy
reproducer, which carries that check.)

For reference, !sched_delayed && !task_is_blocked() gives 0.01 ms on the proxy
case with the sanity check intact (+39 ms), and 0/20 on the delayed reproducer.

Happy to retest whatever you come up with.

Thanks,
Wei Yang


  reply	other threads:[~2026-10-26 13:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-25 13:07 albin_yang
2026-10-25 19:28 ` Kayra Cizmeci
2026-10-26 13:53   ` albin_yang
2026-10-26 14:48     ` Kayra Cizmeci
2026-10-26  5:46 ` K Prateek Nayak
2026-10-26 13:38   ` albin_yang [this message]
2026-10-27  4:11     ` K Prateek Nayak
2026-10-27  6:11       ` Kayra Cizmeci
2026-10-27  6:24         ` K Prateek Nayak
2026-10-27  6:52           ` Kayra Cizmeci
2026-10-27  9:45             ` K Prateek Nayak
2026-10-27  9:53               ` Kayra Cizmeci
2026-10-27  9:58                 ` K Prateek Nayak
2026-10-27 12:09               ` Peter Zijlstra
2026-10-27 12:13                 ` Kayra Cizmeci
2026-10-28  3:40                   ` K Prateek Nayak
2026-10-28  9:22                     ` Peter Zijlstra
2026-11-01 14:31                     ` albin_yang
2026-11-01 15:19                       ` Kayra Cizmeci
2026-11-02 13:15                         ` albin_yang

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=20261026133831.4111227-1-albin_yang@163.com \
    --to=albin_yang@163.com \
    --cc=albinwyang@tencent.com \
    --cc=bsegall@google.com \
    --cc=chen.yu@linux.dev \
    --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®