Re: [PATCH v1 4/4] mm/hugetlb: fix excessive IPI broadcasts when unsharing PMD tables using mmu_gather
From: Nadav Amit
Date: Sun Dec 07 2025 - 07:24:47 EST
> On 7 Dec 2025, at 14:15, Nadav Amit <nadav.amit@xxxxxxxxx> wrote:
>
>
>> On 5 Dec 2025, at 23:35, David Hildenbrand (Red Hat) <david@xxxxxxxxxx> wrote:
>>
>> @@ -400,6 +411,7 @@ static inline void __tlb_reset_range(struct mmu_gather *tlb)
>>
>
> @@ -400,6 +411,7 @@ static inline void __tlb_reset_range(struct mmu_gather *tlb)
> tlb->cleared_pmds = 0;
> tlb->cleared_puds = 0;
> tlb->cleared_p4ds = 0;
> + tlb->unshared_tables = 0;
> /*
> * Do not reset mmu_gather::vma_* fields here, we do not
> * call into tlb_start_vma() again to set them if there is an
>
> I understand you don’t want to initialize fully_unshared_tables here, but
> tlb_gather_mmu() needs to happen somewhere. So you probably want it to
> take place in tlb_gather_mmu(), no?
To clarify my messed up response: the code needs to initialize fully_unshared_tables
somewhere during tlb_gather_mmu() invocation.