[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170922085617.GB19090@tardis>
Date: Fri, 22 Sep 2017 16:56:17 +0800
From: Boqun Feng <boqun.feng@...il.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
"Paul E . McKenney" <paulmck@...ux.vnet.ibm.com>,
linux-kernel@...r.kernel.org, Andrew Hunter <ahh@...gle.com>,
Maged Michael <maged.michael@...il.com>, gromer@...gle.com,
Avi Kivity <avi@...lladb.com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Michael Ellerman <mpe@...erman.id.au>,
Dave Watson <davejwatson@...com>,
Alan Stern <stern@...land.harvard.edu>,
Will Deacon <will.deacon@....com>,
Andy Lutomirski <luto@...nel.org>, linux-arch@...r.kernel.org
Subject: Re: [RFC PATCH v3 1/2] membarrier: Provide register expedited
private command
On Fri, Sep 22, 2017 at 10:24:41AM +0200, Peter Zijlstra wrote:
> On Fri, Sep 22, 2017 at 11:22:06AM +0800, Boqun Feng wrote:
>
> > The idea is in membarrier_private_expedited(), we go through all ->curr
> > on each CPU and
> >
> > 1) If it's a userspace task and its ->mm is matched, we send an ipi
> >
> > 2) If it's a kernel task, we skip
> >
> > (Because there will be a smp_mb() implied by mmdrop(), when it
> > switchs to userspace task).
> >
> > 3) If it's a userspace task and its ->mm is not matched, we take
> > the corresponding rq->lock and check rq->curr again, if its ->mm
> > matched, we send an ipi, otherwise we do nothing.
> >
> > (Because if we observe rq->curr is not matched with rq->lock
> > held, when a task having matched ->mm schedules in, the rq->lock
> > pairing along with the smp_mb__after_spinlock() will guarantee
> > it observes all memory ops before sys_membarrir()).
>
> 3) is an insta DoS.
OK, fair enough.
Regards,
Boqun
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists