linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [alex.shi@intel.com: Re: [PATCH] UV: fix incorrect tlb flush all issue]
       [not found] <20120913155310.GA4081@gmail.com>
@ 2012-09-13 21:20 ` Cliff Wickman
  2012-09-14  0:24   ` Alex Shi
  2012-09-14  5:56   ` Ingo Molnar
  0 siblings, 2 replies; 3+ messages in thread
From: Cliff Wickman @ 2012-09-13 21:20 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, alex.shi, jbeulich, tglx, hpa

On Thu, Sep 13, 2012 at 05:53:10PM +0200, Ingo Molnar wrote:
> 
> Ack?
> 
> Thanks,
> 
> 	Ingo

Ack.
But with the adjustment below.  The 'end' argument was not declared long.

I tested the patch on a UV.
It has the effect of either clearing 1 or all TLBs in a cpu.
I added some debugging to test for the cases when clearing all TLBs is
overkill, and in practice it happens very seldom.

Sorry I didn't participate in this patch earlier.  Jack Steiner was
copied, I believe.  But steiner@sgi.com is no longer active. Jack has
retired -- congratulations to him, but a very big loss to us, both 
professionally and personally.

-Cliff

Reported-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Alex Shi <alex.shi@intel.com>
Acked-by: Cliff Wickman <cpw@sgi.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
---
 arch/x86/include/asm/uv/uv.h  |    2 +-
 arch/x86/platform/uv/tlb_uv.c |   10 +++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)

Index: linux/arch/x86/platform/uv/tlb_uv.c
===================================================================
--- linux.orig/arch/x86/platform/uv/tlb_uv.c
+++ linux/arch/x86/platform/uv/tlb_uv.c
@@ -1034,7 +1034,8 @@ static int set_distrib_bits(struct cpuma
  * globally purge translation cache of a virtual address or all TLB's
  * @cpumask: mask of all cpu's in which the address is to be removed
  * @mm: mm_struct containing virtual address range
- * @va: virtual address to be removed (or TLB_FLUSH_ALL for all TLB's on cpu)
+ * @start: start virtual address to be removed from TLB
+ * @end: end virtual address to be remove from TLB
  * @cpu: the current cpu
  *
  * This is the entry point for initiating any UV global TLB shootdown.
@@ -1056,7 +1057,7 @@ static int set_distrib_bits(struct cpuma
  */
 const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
 				struct mm_struct *mm, unsigned long start,
-				unsigned end, unsigned int cpu)
+				unsigned long end, unsigned int cpu)
 {
 	int locals = 0;
 	int remotes = 0;
@@ -1113,7 +1114,10 @@ const struct cpumask *uv_flush_tlb_other
 
 	record_send_statistics(stat, locals, hubs, remotes, bau_desc);
 
-	bau_desc->payload.address = start;
+	if (!end || (end - start) <= PAGE_SIZE)
+		bau_desc->payload.address = start;
+	else
+		bau_desc->payload.address = TLB_FLUSH_ALL;
 	bau_desc->payload.sending_cpu = cpu;
 	/*
 	 * uv_flush_send_and_wait returns 0 if all cpu's were messaged,
Index: linux/arch/x86/include/asm/uv/uv.h
===================================================================
--- linux.orig/arch/x86/include/asm/uv/uv.h
+++ linux/arch/x86/include/asm/uv/uv.h
@@ -16,7 +16,7 @@ extern void uv_system_init(void);
 extern const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
 						 struct mm_struct *mm,
 						 unsigned long start,
-						 unsigned end,
+						 unsigned long end,
 						 unsigned int cpu);
 
 #else	/* X86_UV */

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [alex.shi@intel.com: Re: [PATCH] UV: fix incorrect tlb flush all issue]
  2012-09-13 21:20 ` [alex.shi@intel.com: Re: [PATCH] UV: fix incorrect tlb flush all issue] Cliff Wickman
@ 2012-09-14  0:24   ` Alex Shi
  2012-09-14  5:56   ` Ingo Molnar
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Shi @ 2012-09-14  0:24 UTC (permalink / raw)
  To: Cliff Wickman; +Cc: Ingo Molnar, linux-kernel, jbeulich, tglx, hpa

On 09/14/2012 05:20 AM, Cliff Wickman wrote:

> On Thu, Sep 13, 2012 at 05:53:10PM +0200, Ingo Molnar wrote:
>>
>> Ack?
>>
>> Thanks,
>>
>> 	Ingo
> 
> Ack.
> But with the adjustment below.  The 'end' argument was not declared long.
> 
> I tested the patch on a UV.
> It has the effect of either clearing 1 or all TLBs in a cpu.
> I added some debugging to test for the cases when clearing all TLBs is
> overkill, and in practice it happens very seldom.


Thanks a lot for you all!

> 
> Sorry I didn't participate in this patch earlier.  Jack Steiner was
> copied, I believe.  But steiner@sgi.com is no longer active. Jack has
> retired -- congratulations to him, but a very big loss to us, both 
> professionally and personally.


Congratulations for Jack. :)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [alex.shi@intel.com: Re: [PATCH] UV: fix incorrect tlb flush all issue]
  2012-09-13 21:20 ` [alex.shi@intel.com: Re: [PATCH] UV: fix incorrect tlb flush all issue] Cliff Wickman
  2012-09-14  0:24   ` Alex Shi
@ 2012-09-14  5:56   ` Ingo Molnar
  1 sibling, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2012-09-14  5:56 UTC (permalink / raw)
  To: Cliff Wickman; +Cc: linux-kernel, alex.shi, jbeulich, tglx, hpa


* Cliff Wickman <cpw@sgi.com> wrote:

> On Thu, Sep 13, 2012 at 05:53:10PM +0200, Ingo Molnar wrote:
> > 
> > Ack?
> > 
> > Thanks,
> > 
> > 	Ingo
> 
> Ack.
> But with the adjustment below.  The 'end' argument was not declared long.

Ok, great - mind sending the updated patch properly under a new 
title (the old one doesn't seem ideal), with an expanded 
changelog and with a Signed-off-by: Cliff Wickman, instead of 
the Acked-by?

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-09-14  5:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20120913155310.GA4081@gmail.com>
2012-09-13 21:20 ` [alex.shi@intel.com: Re: [PATCH] UV: fix incorrect tlb flush all issue] Cliff Wickman
2012-09-14  0:24   ` Alex Shi
2012-09-14  5:56   ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).