On Sat, Jan 8, 2022 at 9:56 PM Nadav Amit <nadav.amit@xxxxxxxxx> wrote: > > Just wondering: In a world of ASID/PCID - does the “lazy TLB” really > have a worthy advantage? > > Considering the fact that with PTI anyhow address spaces are switched > all the time, can’t we just get rid of it? Hmm.. That may indeed be the right thing to do. I think arm64 already hardcodes ASID 0 to init_mm, and that kernel threads (and the idle threads in particular) might as well just use that. In that kind of situation, there's likely little advantage to reusing a user address space ID, and quite possibly any potential advantage is overshadowed by the costs. The lazy tlb thing goes back a *looong* way, and lots of things have changed since. Maybe it's not worth it any more. Or maybe it's only worth it on platforms where it's free (UP, possibly other situations - like if you have IPI and it's "free"). If I read the history correctly, it looks like PF_LAZY_TLB was introduced in 2.3.11-pre4 or something. Back in summer of 1999. The "active_mm" vs "mm" model came later. Linus