Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1365579 > unrolled thread

[PATCH v2 1/2] x86/mm: TLB_REMOTE_SEND_IPI should count pages

Started byNadav Amit <namit@vmware.com>
First post2016-03-28 18:50 +0200
Last post2016-03-28 22:50 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 1/2] x86/mm: TLB_REMOTE_SEND_IPI should count pages Nadav Amit <namit@vmware.com> - 2016-03-28 18:50 +0200
    Re: [PATCH v2 1/2] x86/mm: TLB_REMOTE_SEND_IPI should count pages Nadav Amit <namit@vmware.com> - 2016-03-28 19:50 +0200
    Re: [PATCH v2 1/2] x86/mm: TLB_REMOTE_SEND_IPI should count pages Andrew Morton <akpm@linux-foundation.org> - 2016-03-28 22:40 +0200
      Re: [PATCH v2 1/2] x86/mm: TLB_REMOTE_SEND_IPI should count pages Nadav Amit <namit@vmware.com> - 2016-03-28 22:50 +0200

#1365579 — [PATCH v2 1/2] x86/mm: TLB_REMOTE_SEND_IPI should count pages

FromNadav Amit <namit@vmware.com>
Date2016-03-28 18:50 +0200
Subject[PATCH v2 1/2] x86/mm: TLB_REMOTE_SEND_IPI should count pages
Message-ID<rhIwx-1e8-11@gated-at.bofh.it>
TLB_REMOTE_SEND_IPI was recently introduced, but it counts bytes instead
of pages. In addition, it does not report correctly the case in which
flush_tlb_page flushes a page. Fix it to be consistent with other TLB
counters.

Fixes: 4595f9620cda8a1e973588e743cf5f8436dd20c6

Signed-off-by: Nadav Amit <namit@vmware.com>
---
 arch/x86/mm/tlb.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 8f4cc3d..5fb6ada 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -106,8 +106,6 @@ static void flush_tlb_func(void *info)
 
 	if (f->flush_mm != this_cpu_read(cpu_tlbstate.active_mm))
 		return;
-	if (!f->flush_end)
-		f->flush_end = f->flush_start + PAGE_SIZE;
 
 	count_vm_tlb_event(NR_TLB_REMOTE_FLUSH_RECEIVED);
 	if (this_cpu_read(cpu_tlbstate.state) == TLBSTATE_OK) {
@@ -135,12 +133,20 @@ void native_flush_tlb_others(const struct cpumask *cpumask,
 				 unsigned long end)
 {
 	struct flush_tlb_info info;
+
+	if (end == 0)
+		end = start + PAGE_SIZE;
 	info.flush_mm = mm;
 	info.flush_start = start;
 	info.flush_end = end;
 
 	count_vm_tlb_event(NR_TLB_REMOTE_FLUSH);
-	trace_tlb_flush(TLB_REMOTE_SEND_IPI, end - start);
+	if (end == TLB_FLUSH_ALL)
+		trace_tlb_flush(TLB_REMOTE_SEND_IPI, TLB_FLUSH_ALL);
+	else
+		trace_tlb_flush(TLB_REMOTE_SEND_IPI,
+				(end - start) >> PAGE_SHIFT);
+
 	if (is_uv_system()) {
 		unsigned int cpu;
 
-- 
2.5.0

[toc] | [next] | [standalone]


#1365605

FromNadav Amit <namit@vmware.com>
Date2016-03-28 19:50 +0200
Message-ID<rhJsD-1VY-15@gated-at.bofh.it>
In reply to#1365579
The commit message should have said:

Fixes: 5b74283ab251b9db55cbbe31d19ca72482103290

(and not what it currently says).
Let me know whether to submit v3.


Nadav

On 3/26/16, 1:25 AM, "Nadav Amit" <namit@vmware.com> wrote:

>TLB_REMOTE_SEND_IPI was recently introduced, but it counts bytes instead
>of pages. In addition, it does not report correctly the case in which
>flush_tlb_page flushes a page. Fix it to be consistent with other TLB
>counters.
>
>Fixes: 4595f9620cda8a1e973588e743cf5f8436dd20c6
>
>Signed-off-by: Nadav Amit <namit@vmware.com>
>---
> arch/x86/mm/tlb.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
>diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
>index 8f4cc3d..5fb6ada 100644
>--- a/arch/x86/mm/tlb.c
>+++ b/arch/x86/mm/tlb.c
>@@ -106,8 +106,6 @@ static void flush_tlb_func(void *info)
> 
> 	if (f->flush_mm != this_cpu_read(cpu_tlbstate.active_mm))
> 		return;
>-	if (!f->flush_end)
>-		f->flush_end = f->flush_start + PAGE_SIZE;
> 
> 	count_vm_tlb_event(NR_TLB_REMOTE_FLUSH_RECEIVED);
> 	if (this_cpu_read(cpu_tlbstate.state) == TLBSTATE_OK) {
>@@ -135,12 +133,20 @@ void native_flush_tlb_others(const struct cpumask *cpumask,
> 				 unsigned long end)
> {
> 	struct flush_tlb_info info;
>+
>+	if (end == 0)
>+		end = start + PAGE_SIZE;
> 	info.flush_mm = mm;
> 	info.flush_start = start;
> 	info.flush_end = end;
> 
> 	count_vm_tlb_event(NR_TLB_REMOTE_FLUSH);
>-	trace_tlb_flush(TLB_REMOTE_SEND_IPI, end - start);
>+	if (end == TLB_FLUSH_ALL)
>+		trace_tlb_flush(TLB_REMOTE_SEND_IPI, TLB_FLUSH_ALL);
>+	else
>+		trace_tlb_flush(TLB_REMOTE_SEND_IPI,
>+				(end - start) >> PAGE_SHIFT);
>+
> 	if (is_uv_system()) {
> 		unsigned int cpu;
> 
>-- 
>2.5.0
>

[toc] | [prev] | [next] | [standalone]


#1365662

FromAndrew Morton <akpm@linux-foundation.org>
Date2016-03-28 22:40 +0200
Message-ID<rhM77-3LA-1@gated-at.bofh.it>
In reply to#1365579
On Sat, 26 Mar 2016 01:25:04 -0700 Nadav Amit <namit@vmware.com> wrote:

> TLB_REMOTE_SEND_IPI was recently introduced, but it counts bytes instead
> of pages. In addition, it does not report correctly the case in which
> flush_tlb_page flushes a page. Fix it to be consistent with other TLB
> counters.
> 
> Fixes: 4595f9620cda8a1e973588e743cf5f8436dd20c6

I think you mean 5b74283ab251b9 ("x86, mm: trace when an IPI is about
to be sent")?

> --- a/arch/x86/mm/tlb.c
> +++ b/arch/x86/mm/tlb.c
> @@ -106,8 +106,6 @@ static void flush_tlb_func(void *info)
>  
>  	if (f->flush_mm != this_cpu_read(cpu_tlbstate.active_mm))
>  		return;
> -	if (!f->flush_end)
> -		f->flush_end = f->flush_start + PAGE_SIZE;
>  
>  	count_vm_tlb_event(NR_TLB_REMOTE_FLUSH_RECEIVED);
>  	if (this_cpu_read(cpu_tlbstate.state) == TLBSTATE_OK) {
> @@ -135,12 +133,20 @@ void native_flush_tlb_others(const struct cpumask *cpumask,
>  				 unsigned long end)
>  {
>  	struct flush_tlb_info info;
> +
> +	if (end == 0)
> +		end = start + PAGE_SIZE;
>  	info.flush_mm = mm;
>  	info.flush_start = start;
>  	info.flush_end = end;
>  
>  	count_vm_tlb_event(NR_TLB_REMOTE_FLUSH);
> -	trace_tlb_flush(TLB_REMOTE_SEND_IPI, end - start);
> +	if (end == TLB_FLUSH_ALL)
> +		trace_tlb_flush(TLB_REMOTE_SEND_IPI, TLB_FLUSH_ALL);
> +	else
> +		trace_tlb_flush(TLB_REMOTE_SEND_IPI,
> +				(end - start) >> PAGE_SHIFT);
> +
>  	if (is_uv_system()) {
>  		unsigned int cpu;

[toc] | [prev] | [next] | [standalone]


#1365666

FromNadav Amit <namit@vmware.com>
Date2016-03-28 22:50 +0200
Message-ID<rhMgP-3OW-9@gated-at.bofh.it>
In reply to#1365662
On 3/28/16, 1:38 PM, "Andrew Morton" <akpm@linux-foundation.org> wrote:


>On Sat, 26 Mar 2016 01:25:04 -0700 Nadav Amit <namit@vmware.com> wrote:
>
>> TLB_REMOTE_SEND_IPI was recently introduced, but it counts bytes instead
>> of pages. In addition, it does not report correctly the case in which
>> flush_tlb_page flushes a page. Fix it to be consistent with other TLB
>> counters.
>> 
>> Fixes: 4595f9620cda8a1e973588e743cf5f8436dd20c6
>
>I think you mean 5b74283ab251b9 ("x86, mm: trace when an IPI is about
>to be sent")?

Indeed.



[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web