Re: [RFC PATCH v3 1/2] membarrier: Provide register expedited private command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux