Re: [PATCH 03/11] locking, rwsem: introduce basis for down_write_killable

From: Peter Zijlstra
Date: Mon Apr 04 2016 - 05:21:58 EST


On Mon, Apr 04, 2016 at 11:17:00AM +0200, Michal Hocko wrote:
> > >@@ -486,21 +487,39 @@ struct rw_semaphore __sched *rwsem_down_write_failed(struct rw_semaphore *sem)
> > >
> > > /* Block until there are no active lockers. */
> > > do {
> > >+ if (signal_pending_state(state, current)) {
> >
> > ^^ unlikely()?
>
> The generated code is identical after I've added unlikely. I haven't
> tried more gcc versions (mine is 5.3.1) but is this worth it?

Both signal_pending() and __fatal_signal_pending() already have an
unlikely(), which is why adding it here is superfluous.