Re: [PATCH 11/11] mm,sched: conditionally skip lazy TLB mm refcounting

From: Peter Zijlstra
Date: Mon Aug 06 2018 - 13:50:23 EST


On Fri, Aug 03, 2018 at 01:39:52PM -0400, Rik van Riel wrote:

> > At the very least the Changelog needs to explain why we cannot do
> > away with the swizzle now and how doing the swizzle without the
> > refcounting is not completely broken (I think I see, but urgh).
>
> The changelog for patches 9 & 10 explains, I think.

They hint at it :-)

> What is missing from my explanation?
> How would you like to see it explained?

Maybe a few words like:

"Since ->active_mm is still used in a few sites, we must keep the
current tracking, such that we will not hit a kthread's NULL mm. Note
that lazy_tlb_exit_mmap() switches ->active_mm to &init_mm before taking
out the lazy mm."

That said; I'm not entirely sure we'll actually touch active_mm if we're
not a user task. The perf thing for example will only touch active_mm
when user_mode(regs).

But whatever, this was the only hickup.

Acked-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>

Attachment: signature.asc
Description: PGP signature