On Sat, Jul 28, 2018 at 2:53 PM, Rik van Riel <r...@surriel.com> wrote: > Conditionally skip lazy TLB mm refcounting. When an architecture has > CONFIG_ARCH_NO_ACTIVE_MM_REFCOUNTING enabled, an mm that is used in > lazy TLB mode anywhere will get shot down from exit_mmap, and there > in no need to incur the cache line bouncing overhead of refcounting > a lazy TLB mm.
Unless I've misunderstood something, this patch results in idle tasks whose active_mm has been freed still having active_mm pointing at freed memory. This isn't strictly speaking a bug, but it's extremely confusing and risks all kinds of nasty errors. That's why I prefer the approach of actually removing the active_mm field on x86 rather than merely removing the refcount. I realize that this will add more ifdeffery and make the patch a bit bigger, but I think it'll be much more robust. Not to mention that it will save a pointer an a refcount per mm_struct, but that barely matters.