[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 1 Jan 2023 01:20:01 -0500
From: Joel Fernandes <joel@...lfernandes.org>
To: linux-kernel@...r.kernel.org
Cc: Paul McKenney <paulmck@...nel.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Zhouyi Zhou <zhouzhouyi@...il.com>, stable@...r.kernel.org,
Davidlohr Bueso <dave@...olabs.net>,
Josh Triplett <josh@...htriplett.org>
Subject: Re: [PATCH] torture: Fix hang during kthread shutdown phase
On Sun, Jan 1, 2023 at 1:16 AM Joel Fernandes (Google)
<joel@...lfernandes.org> wrote:
>
> During shutdown of rcutorture, the shutdown thread in
> rcu_torture_cleanup() calls torture_cleanup_begin() which sets fullstop
> to FULLSTOP_RMMOD. This is enough to cause the rcutorture threads for
> readers and fakewriters to breakout of their main while loop and start
> shutting down.
>
> Once out of their main loop, they then call torture_kthread_stopping()
> which in turn waits for kthread_stop() to be called, however
> rcu_torture_cleanup() has not even called kthread_stop() on those
> threads yet, it does that a bit later. However, before it gets a chance
> to do so, torture_kthread_stopping() calls
> schedule_timeout_interruptible(1) in a tight loop. Tracing confirmed
> this makes the timer softirq constantly execute timer callbacks, while
> never returning back to the softirq exit path and is essentially "locked
> up" because of that. If the softirq preempts the shutdown thread,
> kthread_stop() may never be called.
>
> This commit improves the situation dramatically, by increasing timeout
> passed to schedule_timeout_interruptible() 1/20th of a second. This
> causes the timer softirq to not lock up a CPU and everything works fine.
> Testing has shown 100 runs of TREE07 passing reliably, which was not the
> case before because of RCU stalls.
>
> Cc: Paul McKenney <paulmck@...nel.org>
> Cc: Frederic Weisbecker <fweisbec@...il.com>
> Cc: Zhouyi Zhou <zhouzhouyi@...il.com>
> Cc: <stable@...r.kernel.org> # 6.0.x
Question for stable maintainers:
This patch is for mainline and 6.0 stable. However, it should also go
to 6.1 stable. How do we tag it to do that? I did not know how to tag
2 stable versions. I guess the above implies > 6.0 ?
Thanks,
- Joel
Powered by blists - more mailing lists