* [PATCH] x86/mm/tlb: Skip tracing when flush is not done
@ 2022-07-10 23:33 Nadav Amit
2022-07-11 22:50 ` Andy Lutomirski
0 siblings, 1 reply; 3+ messages in thread
From: Nadav Amit @ 2022-07-10 23:33 UTC (permalink / raw)
To: linux-kernel, Thomas Gleixner, Dave Hansen
Cc: Ingo Molnar, Borislav Petkov, x86, Linux MM, Nadav Amit,
Peter Zijlstra, Andy Lutomirski
From: Nadav Amit <namit@vmware.com>
Currently, if flush_tlb_func() does not flush for some reason, the
tracing of the flush will be done only in certain cases, depending on
the reason of the flush. Be consistent and just do not trace in all
cases when the flush was eventually not done.
Suggested-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Nadav Amit <namit@vmware.com>
---
arch/x86/mm/tlb.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 0f346c51dd99..5c17b86b928d 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -736,7 +736,7 @@ static void flush_tlb_func(void *info)
u32 loaded_mm_asid = this_cpu_read(cpu_tlbstate.loaded_mm_asid);
u64 local_tlb_gen = this_cpu_read(cpu_tlbstate.ctxs[loaded_mm_asid].tlb_gen);
bool local = smp_processor_id() == f->initiating_cpu;
- unsigned long nr_invalidate = 0;
+ unsigned long nr_invalidate;
u64 mm_tlb_gen;
/* This code cannot presently handle being reentered. */
@@ -795,7 +795,7 @@ static void flush_tlb_func(void *info)
* be handled can catch us all the way up, leaving no work for
* the second flush.
*/
- goto done;
+ return;
}
WARN_ON_ONCE(local_tlb_gen > mm_tlb_gen);
@@ -871,7 +871,6 @@ static void flush_tlb_func(void *info)
this_cpu_write(cpu_tlbstate.ctxs[loaded_mm_asid].tlb_gen, mm_tlb_gen);
/* Tracing is done in a unified manner to reduce the code size */
-done:
trace_tlb_flush(!local ? TLB_REMOTE_SHOOTDOWN :
(f->mm == NULL) ? TLB_LOCAL_SHOOTDOWN :
TLB_LOCAL_MM_SHOOTDOWN,
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] x86/mm/tlb: Skip tracing when flush is not done
2022-07-10 23:33 [PATCH] x86/mm/tlb: Skip tracing when flush is not done Nadav Amit
@ 2022-07-11 22:50 ` Andy Lutomirski
2022-07-11 23:42 ` Nadav Amit
0 siblings, 1 reply; 3+ messages in thread
From: Andy Lutomirski @ 2022-07-11 22:50 UTC (permalink / raw)
To: Nadav Amit, linux-kernel, Thomas Gleixner, Dave Hansen
Cc: Ingo Molnar, Borislav Petkov, x86, Linux MM, Nadav Amit, Peter Zijlstra
On 7/10/22 16:33, Nadav Amit wrote:
> From: Nadav Amit <namit@vmware.com>
>
> Currently, if flush_tlb_func() does not flush for some reason, the
> tracing of the flush will be done only in certain cases, depending on
> the reason of the flush. Be consistent and just do not trace in all
> cases when the flush was eventually not done.
>
> Suggested-by: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
> Cc: Andy Lutomirski <luto@kernel.org>
> Signed-off-by: Nadav Amit <namit@vmware.com>
Can you remove this comment, too?
> /* Tracing is done in a unified manner to reduce the code size */
> -done:
> trace_tlb_flush(!local ? TLB_REMOTE_SHOOTDOWN :
> (f->mm == NULL) ? TLB_LOCAL_SHOOTDOWN :
> TLB_LOCAL_MM_SHOOTDOWN,
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] x86/mm/tlb: Skip tracing when flush is not done
2022-07-11 22:50 ` Andy Lutomirski
@ 2022-07-11 23:42 ` Nadav Amit
0 siblings, 0 replies; 3+ messages in thread
From: Nadav Amit @ 2022-07-11 23:42 UTC (permalink / raw)
To: Andy Lutomirski
Cc: LKML, Thomas Gleixner, Dave Hansen, Ingo Molnar, Borislav Petkov,
X86 ML, Linux MM, Peter Zijlstra
On Jul 11, 2022, at 3:50 PM, Andy Lutomirski <luto@kernel.org> wrote:
> On 7/10/22 16:33, Nadav Amit wrote:
>> From: Nadav Amit <namit@vmware.com>
>> Currently, if flush_tlb_func() does not flush for some reason, the
>> tracing of the flush will be done only in certain cases, depending on
>> the reason of the flush. Be consistent and just do not trace in all
>> cases when the flush was eventually not done.
>> Suggested-by: Dave Hansen <dave.hansen@linux.intel.com>
>> Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
>> Cc: Andy Lutomirski <luto@kernel.org>
>> Signed-off-by: Nadav Amit <namit@vmware.com>
>
>
> Can you remove this comment, too?
>
>> /* Tracing is done in a unified manner to reduce the code size */
Yes. I will send v2.
… And if you have time, can you please review the other TLB patch that I
sent? It is a really urgent one.
Thanks,
Nadav
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-07-11 23:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-10 23:33 [PATCH] x86/mm/tlb: Skip tracing when flush is not done Nadav Amit
2022-07-11 22:50 ` Andy Lutomirski
2022-07-11 23:42 ` Nadav Amit
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox