Re: [PATCH v6 2/5] lazy tlb: allow lazy tlb mm refcounting to be configurable

2023-01-23 Thread Nicholas Piggin
On Mon Jan 23, 2023 at 6:02 PM AEST, Nadav Amit wrote: > > > On 1/23/23 9:35 AM, Nadav Amit wrote: > >> +    if (IS_ENABLED(CONFIG_MMU_LAZY_TLB_REFCOUNT)) { > >> +    mmdrop(mm); > >> +    } else { > >> +    /* > >> + * mmdrop_lazy_tlb must provide a full memory barrier, see the >

Re: [PATCH v6 2/5] lazy tlb: allow lazy tlb mm refcounting to be configurable

2023-01-23 Thread Nadav Amit
On 1/23/23 9:35 AM, Nadav Amit wrote: +    if (IS_ENABLED(CONFIG_MMU_LAZY_TLB_REFCOUNT)) { +    mmdrop(mm); +    } else { +    /* + * mmdrop_lazy_tlb must provide a full memory barrier, see the + * membarrier comment finish_task_switch which relies on this. +

Re: [PATCH v6 2/5] lazy tlb: allow lazy tlb mm refcounting to be configurable

2023-01-22 Thread Nadav Amit
On 1/18/23 10:00 AM, Nicholas Piggin wrote: Add CONFIG_MMU_TLB_REFCOUNT which enables refcounting of the lazy tlb mm when it is context switched. This can be disabled by architectures that don't require this refcounting if they clean up lazy tlb mms when the last refcount is dropped.

[PATCH v6 2/5] lazy tlb: allow lazy tlb mm refcounting to be configurable

2023-01-18 Thread Nicholas Piggin
Add CONFIG_MMU_TLB_REFCOUNT which enables refcounting of the lazy tlb mm when it is context switched. This can be disabled by architectures that don't require this refcounting if they clean up lazy tlb mms when the last refcount is dropped. Currently this is always enabled, which is what existing