Re: [PATCH tip/core/rcu 23/41] sched: Replace synchronize_sched() with synchronize_rcu()

Peter Zijlstra
2018-11-12T09:01:11Z

On Sun, Nov 11, 2018 at 06:24:55PM -0800, Paul E. McKenney wrote:

> > > There were quite a few commits involved in making this happen. Perhaps
> > > the most pertinent are these:
> > >
> > > 3e3100989869 ("rcu: Defer reporting RCU-preempt quiescent states when disabled")
> > > 45975c7d21a1 ("rcu: Define RCU-sched API in terms of RCU for Tree RCU PREEMPT builds")
> >
> > The latter; it does not mention that this will possible make
> > synchronize_sched() quite a bit more expensive on PREEMPT=y builds :/
>
> In theory, sure. In practice, people have switched any number of
> things from RCU-sched to RCU and back without problems.

Still, better safe than sorry. It was a rather big change in behaviour,
so it wouldn't have been strange to call that out.

> > But for PREEMPT=y synchronize_sched() can be quite a bit shorter than
> > synchronize_rcu(), since we don't have to wait for preempted read side
> > stuff.
>
> Again, there are quite a few places that have managed that transition
> without issue. Why do you expect this change to have problems that have
> not been seen elsewhere?

I'm not, I'm just taking issue with the Changelog.

> > Again, the patch didn't say that.
> >
> > If the Changelog would've read something like:
> >
> > "Since synchronize_sched() is now equivalent to synchronize_rcu(),
> > replace the synchronize_sched() usage such that we can eventually remove
> > the interface."
> >
> > It would've been clear that the patch is a nop and what the purpose
> > was.
>
> I can easily make that change.

Please, sufficient doesn't imply necessary etc.. A changelog should
always clarify why we do the patch.