mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: David Vernet <void@manifault.com>
Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com,
	sched-ext@meta.com, Andrea Righi <arighi@nvidia.com>,
	Changwoo Min <multics69@gmail.com>
Subject: Re: [PATCH sched_ext/for-6.13 1/2] sched_ext: Avoid live-locking bypass mode switching
Date: Tue, 5 Nov 2024 13:02:33 -1000	[thread overview]
Message-ID: <ZyqkCbC9NPBxsPU1@slm.duckdns.org> (raw)
In-Reply-To: <20241105220346.GA64119@maniforge>

Hello,

On Tue, Nov 05, 2024 at 04:03:46PM -0600, David Vernet wrote:
> On Tue, Nov 05, 2024 at 11:48:11AM -1000, Tejun Heo wrote:
> 
> [...]
> 
> >  static bool consume_dispatch_q(struct rq *rq, struct scx_dispatch_q *dsq)
> >  {
> >  	struct task_struct *p;
> >  retry:
> >  	/*
> > +	 * This retry loop can repeatedly race against scx_ops_bypass()
> > +	 * dequeueing tasks from @dsq trying to put the system into the bypass
> > +	 * mode. On some multi-socket machines (e.g. 2x Intel 8480c), this can
> > +	 * live-lock the machine into soft lockups. Give a breather.
> > +	 */
> > +	scx_ops_breather(rq);
> 
> Should we move this to after the list_empty() check? Or before the goto retry
> below so we can avoid having to do the atomic read on the typical hotpath?

I don't think there's going to be a measurable difference in terms of
overhead. It's going to be a cached unlikely jump in most cases and there's
value in catching the CPUs in the breather as soon as possible in case even
if the DSQ currently targeted is empty as it's difficult to reliably predict
the different lockup scenarios.

Thanks.

-- 
tejun

  reply	other threads:[~2024-11-05 23:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-05 21:48 Tejun Heo
2024-11-05 21:49 ` [PATCH sched_ext/for-6.13 2/2] sched_ext: Enable the ops breather and eject BPF scheduler on softlockup Tejun Heo
2024-11-06 21:32   ` Doug Anderson
2024-11-06 22:08     ` Tejun Heo
2024-11-06 23:02       ` Doug Anderson
2024-11-06 23:07         ` Tejun Heo
2024-11-06 23:20           ` Doug Anderson
2024-11-07 19:31             ` Tejun Heo
2024-11-08 20:38   ` Tejun Heo
2024-11-05 22:03 ` [PATCH sched_ext/for-6.13 1/2] sched_ext: Avoid live-locking bypass mode switching David Vernet
2024-11-05 23:02   ` Tejun Heo [this message]
2024-11-05 23:57 ` Andrea Righi
2024-11-06  0:26   ` Tejun Heo
2024-11-06  0:33     ` Andrea Righi

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=ZyqkCbC9NPBxsPU1@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=arighi@nvidia.com \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=multics69@gmail.com \
    --cc=sched-ext@meta.com \
    --cc=void@manifault.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®