[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEXW_YSiKrT50mTR1a4tB5x_jQzZKnuAo6JY-Vc5w7r=XLv+OA@mail.gmail.com>
Date: Wed, 18 Mar 2020 20:47:18 -0400
From: Joel Fernandes <joel@...lfernandes.org>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: "Paul E. McKenney" <paulmck@...nel.org>,
Josh Triplett <josh@...htriplett.org>,
Steven Rostedt <rostedt@...dmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Lai Jiangshan <jiangshanlai@...il.com>,
Thomas Glexiner <tglx@...utronix.de>,
Scott Wood <swood@...hat.com>,
Clark Williams <williams@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>,
linux-rt-users@...r.kernel.org, rcu <rcu@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>
Subject: Re: RCU use of swait
On Thu, Mar 5, 2020 at 3:11 AM Sebastian Andrzej Siewior
<bigeasy@...utronix.de> wrote:
>
> On 2020-03-04 16:35:26 [-0800], Paul E. McKenney wrote:
> > Hello!
> Hi Paul,
>
> > Or is there some other reason why {S,}RCU needs to use swait that I
> > am forgetting?
>
> swait can be used in hardirq-context (on RT) that is in a section within
> local_irq_save() / raw_spin_lock() and so.
> wait on the hand uses spinlock_t which can not be used in this context.
> So if you have no users which fall into that category then you could
> move back to wait.h.
In RCU, there are some truly-atomic code sections containing an
swake_upXX() call, which would be considered atomic also on
PREEMPT_RT, one example is:
rcu_core() contains an local_irq_{save,restore}() section.
/* No grace period and unregistered callbacks? */
if (!rcu_gp_in_progress() &&
rcu_segcblist_is_enabled(&rdp->cblist) && !offloaded) {
local_irq_save(flags);
if (!rcu_segcblist_restempty(&rdp->cblist, RCU_NEXT_READY_TAIL))
rcu_accelerate_cbs_unlocked(rnp, rdp);
local_irq_restore(flags);
}
And rcu_accelerate_cbs_unlocked(rnp, rdp) calls rcu_gp_kthread_wake()
which does an swake_up_one(), so I think we will have to leave it as
swake_up() the way it is.
thanks,
- Joel
Powered by blists - more mailing lists