mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Roy Hopkins <rhopkins@suse.de>,
	Joel Fernandes <joel@joelfernandes.org>,
	Pavel Machek <pavel@denx.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, patches@lists.linux.dev,
	linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
	akpm@linux-foundation.org, shuah@kernel.org,
	patches@kernelci.org, lkft-triage@lists.linaro.org,
	jonathanh@nvidia.com, f.fainelli@gmail.com,
	sudipm.mukherjee@gmail.com, srw@sladewatkins.net, rwarsow@gmx.de,
	conor@kernel.org, rcu@vger.kernel.org,
	Ingo Molnar <mingo@kernel.org>
Subject: Re: scheduler problems in -next (was: Re: [PATCH 6.4 000/227] 6.4.7-rc1 review)
Date: Tue, 1 Aug 2023 12:14:30 -0700	[thread overview]
Message-ID: <aec97d62-a07d-45f3-9cf8-5a7ad0e98e47@paulmck-laptop> (raw)
In-Reply-To: <8215f037-63e9-4e92-8403-c5431ada9cc9@paulmck-laptop>

On Tue, Aug 01, 2023 at 12:11:04PM -0700, Paul E. McKenney wrote:
> On Tue, Aug 01, 2023 at 10:32:45AM -0700, Guenter Roeck wrote:
> > On 7/31/23 14:15, Peter Zijlstra wrote:
> > > On Mon, Jul 31, 2023 at 09:34:29AM -0700, Guenter Roeck wrote:
> > > > > Ha!, I was poking around the same thing. My hack below seems to (so far,
> > > > > <20 boots) help things.
> > > > > 
> > > > 
> > > > So, dumb question:
> > > > How comes this bisects to "sched/fair: Remove sched_feat(START_DEBIT)" ?
> > > 
> > > That commit changes the timings of things; dumb luck otherwise.
> > 
> > Kind of scary. So I only experienced the problem because the START_DEBIT patch
> > happened to be queued roughly at the same time, and it might otherwise have
> > found its way unnoticed into the upstream kernel.

And just to set the record straight, this bug has been in mainline for
about a year, since v5.19.

							Thanx, Paul

> >                                                   That makes me wonder if this
> > or other similar patches may uncover similar problems elsewhere in the kernel
> > (i.e., either hide new or existing race conditions or expose existing ones).
> > 
> > This in turn makes me wonder if it would be possible to define a test which
> > would uncover such problems without the START_DEBIT patch. Any idea ?
> 
> Thank you all for tracking this down!
> 
> One way is to put a schedule_timeout_idle(100) right before the call to
> rcu_tasks_one_gp() from synchronize_rcu_tasks_generic().  That is quite
> specific to this particular issue, but it does have the virtue of making
> it actually happen in my testing.
> 
> There have been a few academic projects that inject delays at points
> chosen by various heuristics plus some randomness.  But this would be
> a bit of a challenge to those because each kernel only passes through
> this window once at boot time.
> 
> Please see below for my preferred fix.  Does this work for you guys?
> 
> Back to figuring out why recent kernels occasionally to blow up all
> rcutorture guest OSes...
> 
> 							Thanx, Paul
> 
> ------------------------------------------------------------------------
> 
> diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h
> index 7294be62727b..2d5b8385c357 100644
> --- a/kernel/rcu/tasks.h
> +++ b/kernel/rcu/tasks.h
> @@ -570,10 +570,12 @@ static void rcu_tasks_one_gp(struct rcu_tasks *rtp, bool midboot)
>  	if (unlikely(midboot)) {
>  		needgpcb = 0x2;
>  	} else {
> +		mutex_unlock(&rtp->tasks_gp_mutex);
>  		set_tasks_gp_state(rtp, RTGS_WAIT_CBS);
>  		rcuwait_wait_event(&rtp->cbs_wait,
>  				   (needgpcb = rcu_tasks_need_gpcb(rtp)),
>  				   TASK_IDLE);
> +		mutex_lock(&rtp->tasks_gp_mutex);
>  	}
>  
>  	if (needgpcb & 0x2) {

  reply	other threads:[~2023-08-01 19:14 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-25 10:42 [PATCH 6.4 000/227] 6.4.7-rc1 review Greg Kroah-Hartman
2023-07-25 16:27 ` Jon Hunter
2023-07-25 18:12 ` SeongJae Park
2023-07-25 20:14 ` Shuah Khan
2023-07-25 23:05 ` Florian Fainelli
2023-07-26  6:14 ` Bagas Sanjaya
2023-07-26  9:29 ` Conor Dooley
2023-07-26  9:34 ` Ron Economos
2023-07-26 10:11 ` Naresh Kamboju
2023-07-27  0:03 ` Guenter Roeck
2023-07-27  3:58 ` Joel Fernandes
2023-07-27 11:35   ` Pavel Machek
2023-07-27 13:26     ` Joel Fernandes
2023-07-27 14:06       ` Paul E. McKenney
2023-07-27 14:39         ` Guenter Roeck
2023-07-27 16:07           ` Paul E. McKenney
2023-07-27 17:39             ` Guenter Roeck
2023-07-27 20:33               ` Paul E. McKenney
2023-07-27 23:18                 ` Joel Fernandes
     [not found]                   ` <99B56FC7-9474-4968-B1DD-5862572FD0BA@joelfernandes.org>
2023-07-28 22:58                     ` Paul E. McKenney
2023-07-29  1:25                       ` Joel Fernandes
2023-07-29  5:50                         ` Paul E. McKenney
2023-07-30  4:00                   ` scheduler problems in -next (was: Re: [PATCH 6.4 000/227] 6.4.7-rc1 review) Guenter Roeck
2023-07-31 14:19                     ` Peter Zijlstra
2023-07-31 14:35                       ` Guenter Roeck
2023-07-31 14:47                         ` Peter Zijlstra
2023-07-31 15:03                           ` Guenter Roeck
2023-07-31 14:39                       ` Peter Zijlstra
2023-07-31 14:48                         ` Guenter Roeck
2023-07-31 14:52                           ` Peter Zijlstra
2023-07-31 16:08                             ` Roy Hopkins
2023-07-31 16:14                               ` Peter Zijlstra
2023-07-31 16:30                                 ` Roy Hopkins
2023-07-31 16:34                                 ` Guenter Roeck
2023-07-31 21:15                                   ` Peter Zijlstra
2023-08-01 17:32                                     ` Guenter Roeck
2023-08-01 19:08                                       ` Peter Zijlstra
2023-08-01 21:32                                         ` Paul E. McKenney
2023-08-01 19:11                                       ` Paul E. McKenney
2023-08-01 19:14                                         ` Paul E. McKenney [this message]
2023-08-02 13:57                                         ` Roy Hopkins
2023-08-02 15:05                                           ` Paul E. McKenney
2023-08-02 15:31                                             ` Roy Hopkins
2023-08-02 16:51                                               ` Paul E. McKenney
2023-08-02 15:45                                             ` Guenter Roeck
2023-08-02 17:20                                               ` Paul E. McKenney
2023-08-02 17:14                                         ` Linus Torvalds
2023-08-02 17:48                                           ` Paul E. McKenney
2023-07-28  4:22                 ` [PATCH 6.4 000/227] 6.4.7-rc1 review Guenter Roeck
2023-07-31  3:54                   ` Paul E. McKenney
2023-07-31  3:56                     ` Paul E. McKenney
2023-07-31  4:16                     ` Guenter Roeck

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=aec97d62-a07d-45f3-9cf8-5a7ad0e98e47@paulmck-laptop \
    --to=paulmck@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=conor@kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=joel@joelfernandes.org \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=lkft-triage@lists.linaro.org \
    --cc=mingo@kernel.org \
    --cc=patches@kernelci.org \
    --cc=patches@lists.linux.dev \
    --cc=pavel@denx.de \
    --cc=peterz@infradead.org \
    --cc=rcu@vger.kernel.org \
    --cc=rhopkins@suse.de \
    --cc=rwarsow@gmx.de \
    --cc=shuah@kernel.org \
    --cc=srw@sladewatkins.net \
    --cc=stable@vger.kernel.org \
    --cc=sudipm.mukherjee@gmail.com \
    --cc=torvalds@linux-foundation.org \
    /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®