Re: [PATCH 08/20] mm: Optimize fullmm TLB flushing

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

 



On Thu, 2012-06-28 at 09:45 -0700, Linus Torvalds wrote:
> On Thu, Jun 28, 2012 at 9:20 AM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> >
> > How horrid is something like the below. It detaches the mm so that
> > hardware speculation simply doesn't matter.
> 
> Actually, that's wrong. Even when detached, kernel threads may still
> use that mm lazily. Now, that only happens on other CPU's (if any
> scheduling happens on *this* CPU, they will lazily take the mm of the
> thread it scheduled away from), but even if you detach the VM that
> doesn't mean that hardware speculation wouldn't matter. Kernel threads
> on other CPU's may still be doing TLB accesses.
> 
> Of course, I *think* that if we do an IPI on the thing, we also kick
> those kernel threads out of using that mm. So it may actually work if
> you also do that explicit TLB flush to make sure other CPU's don't
> have this MM. I don't think switch_mm() does that for you, it only
> does a local-cpu invalidate.
> 
> I didn't look at the code, though. Maybe I'm wrong in thinking that
> you are wrong.

No I think you're right (as always).. also an IPI will not force
schedule the thread that might be running on the receiving cpu, also
we'd have to wait for any such schedule to complete in order to
guarantee the mm isn't lazily used anymore.

Bugger.. it would've been nice to do this. I guess I'd better go special
case s390 for now until we can come up with something that would work.


--
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


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