[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1472592301.2388.37.camel@kernel.crashing.org>
Date: Wed, 31 Aug 2016 07:25:01 +1000
From: Benjamin Herrenschmidt <benh@...nel.crashing.org>
To: Oleg Nesterov <oleg@...hat.com>,
Peter Zijlstra <peterz@...radead.org>
Cc: Balbir Singh <bsingharora@...il.com>,
LKML <linux-kernel@...r.kernel.org>,
Nicholas Piggin <nicholas.piggin@...il.com>
Subject: Re: [RFC][PATCH] Fix a race between rwsem and the scheduler
On Tue, 2016-08-30 at 15:04 +0200, Oleg Nesterov wrote:
>
> Confused... how this connects to UNLOCK+LOCK on rq->lock? A LOAD can
> leak into the critical section.
>
> But context switch should imply mb() we can rely on?
Between setting of ->on_rq and returning to the task so it can
change its state back to [UN]INTERRUPTIBLE, there will be at least one
write barrier (spin unlock of the rq), possibly even a full barrier
(context switch). The write barrier is enough so I didn't dig to make
sure we always context switch in the scenario we're looking at but I
think we do.
Cheers,
Ben.
Powered by blists - more mailing lists