> On Jan 18, 2023, at 12:00 AM, Nicholas Piggin <npig...@gmail.com> wrote: > > +static void do_shoot_lazy_tlb(void *arg) > +{ > + struct mm_struct *mm = arg; > + > + if (current->active_mm == mm) { > + WARN_ON_ONCE(current->mm); > + current->active_mm = &init_mm; > + switch_mm(mm, &init_mm, current); > + } > +} I might be out of touch - doesn’t a flush already take place when we free the page-tables, at least on common cases on x86? IIUC exit_mmap() would free page-tables, and whenever page-tables are freed, on x86, we do shootdown regardless to whether the target CPU TLB state marks is_lazy. Then, flush_tlb_func() should call switch_mm_irqs_off() and everything should be fine, no? [ I understand you care about powerpc, just wondering on the effect on x86 ]
- [PATCH v6 0/5] shoot lazy tlbs Nicholas Piggin
- [PATCH v6 1/5] lazy tlb: introduce lazy tlb mm refcou... Nicholas Piggin
- [PATCH v6 2/5] lazy tlb: allow lazy tlb mm refcountin... Nicholas Piggin
- Re: [PATCH v6 2/5] lazy tlb: allow lazy tlb mm re... Nadav Amit
- Re: [PATCH v6 2/5] lazy tlb: allow lazy tlb m... Nadav Amit
- Re: [PATCH v6 2/5] lazy tlb: allow lazy t... Nicholas Piggin
- [PATCH v6 3/5] lazy tlb: shoot lazies, non-refcountin... Nicholas Piggin
- Re: [PATCH v6 3/5] lazy tlb: shoot lazies, non-re... Nadav Amit
- Re: [PATCH v6 3/5] lazy tlb: shoot lazies, no... Nicholas Piggin
- Re: [PATCH v6 3/5] lazy tlb: shoot lazies, no... Nicholas Piggin
- Re: [PATCH v6 3/5] lazy tlb: shoot lazies... Nadav Amit
- Re: [PATCH v6 3/5] lazy tlb: shoot l... Nicholas Piggin
- [PATCH v6 4/5] powerpc/64s: enable MMU_LAZY_TLB_SHOOT... Nicholas Piggin
- Re: [PATCH v6 4/5] powerpc/64s: enable MMU_LAZY_T... Linus Torvalds
- Re: [PATCH v6 4/5] powerpc/64s: enable MMU_LA... Nicholas Piggin
- [PATCH v6 5/5] powerpc/64s/radix: combine final TLB f... Nicholas Piggin