Re: Potential race in TLB flush batching?

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

 



On Sat, Jul 15, 2017 at 09:41:35AM -0700, Andrew Lutomirski wrote:
> On Sat, Jul 15, 2017 at 8:55 AM, Mel Gorman <mgorman@xxxxxxx> wrote:
> > The patch looks fine to be but when writing the patch, I wondered why the
> > original code disabled preemption before inc_mm_tlb_gen. I didn't spot
> > the reason for it but given the importance of properly synchronising with
> > switch_mm, I played it safe. However, this should be ok on top and
> > maintain the existing sequences
> 
> LGTM.  You could also fold it into your patch or even put it before
> your patch, too.
> 

Thanks.

> FWIW, I didn't have any real reason to inc_mm_tlb_gen() with
> preemption disabled.  I think I did it because the code it replaced
> was also called with preemption off.  That being said, it's
> effectively a single instruction, so it barely matters latency-wise.
> (Hmm.  Would there be a performance downside if a thread got preempted
> between inc_mm_tlb_gen() and doing the flush? 

There isn't a preemption point until the point where irqs are
disabled/enabled for the local TLB flush so it doesn't really matter.
It can still be preempted by an interrupt but that's not surprising. I
don't think it matters that much either way so I'll leave it at it is.

-- 
Mel Gorman
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux