2025-02-09 19:40:34 +03:00
|
|
|
From 5e5219596683c3b8178e09f6ec1e75154537325f Mon Sep 17 00:00:00 2001
|
2025-01-28 09:25:42 +03:00
|
|
|
From: Rik van Riel <riel@surriel.com>
|
2025-02-09 19:40:34 +03:00
|
|
|
Date: Wed, 5 Feb 2025 23:43:27 -0500
|
2025-01-28 09:25:42 +03:00
|
|
|
Subject: x86/mm: use broadcast TLB flushing for page reclaim TLB flushing
|
|
|
|
|
|
|
|
In the page reclaim code, we only track the CPU(s) where the TLB needs
|
|
|
|
to be flushed, rather than all the individual mappings that may be getting
|
|
|
|
invalidated.
|
|
|
|
|
|
|
|
Use broadcast TLB flushing when that is available.
|
|
|
|
|
|
|
|
Signed-off-by: Rik van Riel <riel@surriel.com>
|
2025-02-09 19:40:34 +03:00
|
|
|
Tested-by: Manali Shukla <Manali.Shukla@amd.com>
|
2025-01-28 09:25:42 +03:00
|
|
|
---
|
|
|
|
arch/x86/mm/tlb.c | 4 +++-
|
|
|
|
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
|
|
|
|
|
|
--- a/arch/x86/mm/tlb.c
|
|
|
|
+++ b/arch/x86/mm/tlb.c
|
2025-02-21 18:45:20 +03:00
|
|
|
@@ -1330,7 +1330,9 @@ void arch_tlbbatch_flush(struct arch_tlb
|
2025-01-28 09:25:42 +03:00
|
|
|
* a local TLB flush is needed. Optimize this use-case by calling
|
|
|
|
* flush_tlb_func_local() directly in this case.
|
|
|
|
*/
|
|
|
|
- if (cpumask_any_but(&batch->cpumask, cpu) < nr_cpu_ids) {
|
|
|
|
+ if (cpu_feature_enabled(X86_FEATURE_INVLPGB)) {
|
|
|
|
+ invlpgb_flush_all_nonglobals();
|
|
|
|
+ } else if (cpumask_any_but(&batch->cpumask, cpu) < nr_cpu_ids) {
|
|
|
|
flush_tlb_multi(&batch->cpumask, info);
|
|
|
|
} else if (cpumask_test_cpu(cpu, &batch->cpumask)) {
|
|
|
|
lockdep_assert_irqs_enabled();
|