Re: [PATCH] mm/migrate: don't batch the TLB flush when there is nothing to batch
From: Zhiteng Qiu
Date: Fri Nov 06 2026 - 05:09:53 EST
Hi Ying,
"Huang, Ying" <ying.huang@xxxxxxxxxxxxxxxxx> writes:
> IIRC, after commit b99a342d4f11 ("NUMA balancing: reduce TLB flush via
> delaying mapping on hint page fault"), we can avoid most TLB flushing
> caused by do_numa_page(). Could you check why it does not work?
Thanks for looking. b99a342d4f11 is in effect here: on success
do_numa_page() returns without rebuilding the PTE, so the PTE is still
PROT_NONE when try_to_migrate() runs, and both the batched and the
direct unmap path should skip the flush because pte_accessible() is
false.
The numbers disagree for the batched path. On the same workload and
setup there are about 200 TLB shootdown interrupts per migrated page
with TTU_BATCH_FLUSH, and about 13 with this patch applied. So
something makes the batched path flush where the direct path does not,
and I don't have the answer yet. I'm instrumenting the unmap path and
will follow up with data.
Thanks,
Zhiteng