* [PATCH RESEND] MIPS: Add local_flush_tlb_all_mm to clear all mm contexts on calling cpu
@ 2010-12-29 19:04 Maksim Rayskiy
2010-12-29 19:25 ` David Daney
0 siblings, 1 reply; 5+ messages in thread
From: Maksim Rayskiy @ 2010-12-29 19:04 UTC (permalink / raw)
To: linux-mips, Kevin D. Kissell, Ralf Baechle
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH RESEND] MIPS: Add local_flush_tlb_all_mm to clear all mm contexts on calling cpu
2010-12-29 19:04 [PATCH RESEND] MIPS: Add local_flush_tlb_all_mm to clear all mm contexts on calling cpu Maksim Rayskiy
@ 2010-12-29 19:25 ` David Daney
0 siblings, 0 replies; 5+ messages in thread
From: David Daney @ 2010-12-29 19:25 UTC (permalink / raw)
To: Maksim Rayskiy; +Cc: linux-mips, Kevin D. Kissell, Ralf Baechle
On 12/29/2010 11:04 AM, Maksim Rayskiy wrote:
> From 9a03661a40407e14ee75295f5541f371f0a7cdda Mon Sep 17 00:00:00 2001
> From: Maksim Rayskiy<maksim.rayskiy@gmail.com>
> Date: Tue, 30 Nov 2010 11:34:31 -0800
> Subject: [PATCH] MIPS: Add local_flush_tlb_all_mm to clear all mm
> contexts on calling cpu
>
> When hotplug removing a cpu, all mm context TLB entries must be cleared
> to avoid ASID conflict when cpu is restarted.
> New functions local_flush_tlb_all_mm() and all-cpu version
> flush_tlb_all_mm() are added.
> To function properly, local_flush_tlb_all_mm() must be called when
> mm_cpumask for all mm context on given cpu is cleared.
>
> Signed-off-by: Maksim Rayskiy<maksim.rayskiy@gmail.com>
> ---
> =A0arch/mips/include/asm/tlbflush.h | =A0 =A04 ++++
> =A0arch/mips/kernel/smp.c =A0 =A0 =A0 =A0 =A0 | =A0 10 ++++++++++
> =A0arch/mips/mm/tlb-r4k.c =A0 =A0 =A0 =A0 =A0 | =A0 12 ++++++++++++
> =A03 files changed, 26 insertions(+), 0 deletions(-)
>
> diff --git a/arch/mips/include/asm/tlbflush.h b/arch/mips/include/asm/t=
> lbflush.h
> index 86b21de..d7b75e6 100644
> --- a/arch/mips/include/asm/tlbflush.h
> +++ b/arch/mips/include/asm/tlbflush.h
> @@ -8,12 +8,14 @@
> =A0*
> =A0* =A0- flush_tlb_all() flushes all processes TLB entries
> =A0* =A0- flush_tlb_mm(mm) flushes the specified mm context TLB entries
> + * =A0- flush_tlb_all_mm() flushes all mm context TLB entries
[...]
Your mailer did an excellent job of mangling the patch.
Can you resend it but without the Content-Transfer-Encoding:
QUOTED-PRINTABLE bit?
David Daney
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH RESEND] MIPS: Add local_flush_tlb_all_mm to clear all mm contexts on calling cpu
@ 2010-12-29 20:21 Maksim Rayskiy
2010-12-29 20:41 ` Sergei Shtylyov
0 siblings, 1 reply; 5+ messages in thread
From: Maksim Rayskiy @ 2010-12-29 20:21 UTC (permalink / raw)
To: Maksim Rayskiy, linux-mips, Kevin D. Kissell, Ralf Baechle
I hope this one does not get mangled. The thing is I do not know how
to control it in gmail web client.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH RESEND] MIPS: Add local_flush_tlb_all_mm to clear all mm contexts on calling cpu
2010-12-29 20:21 Maksim Rayskiy
@ 2010-12-29 20:41 ` Sergei Shtylyov
2010-12-29 23:18 ` Maksim Rayskiy
0 siblings, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2010-12-29 20:41 UTC (permalink / raw)
To: Maksim Rayskiy; +Cc: linux-mips, Kevin D. Kissell, Ralf Baechle
Hello.
Maksim Rayskiy wrote:
> I hope this one does not get mangled.
It seems OK.
> The thing is I do not know how
> to control it in gmail web client.
Such remarks should follow the --- tear line.
> From 9a03661a40407e14ee75295f5541f371f0a7cdda Mon Sep 17 00:00:00 2001
> From: Maksim Rayskiy <maksim.rayskiy@gmail.com>
> Date: Tue, 30 Nov 2010 11:34:31 -0800
> Subject: [PATCH] MIPS: Add local_flush_tlb_all_mm to clear all mm
> contexts on calling cpu
Don't include this header in the patch, as it will have to be hand edited
out of it by the maintainer.
> When hotplug removing a cpu, all mm context TLB entries must be cleared
> to avoid ASID conflict when cpu is restarted.
> New functions local_flush_tlb_all_mm() and all-cpu version
> flush_tlb_all_mm() are added.
> To function properly, local_flush_tlb_all_mm() must be called when
> mm_cpumask for all
> mm context on given cpu is cleared.
> Signed-off-by: Maksim Rayskiy <maksim.rayskiy@gmail.com>
[...]
> diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c
> index c618eed..5c03218 100644
> --- a/arch/mips/mm/tlb-r4k.c
> +++ b/arch/mips/mm/tlb-r4k.c
> @@ -66,6 +66,18 @@ extern void build_tlb_refill_handler(void);
>
> #endif
>
> +/* This function will clear all mm contexts on calling cpu
> + * To produce desired effect it must be called
> + * when mm_cpumask for all mm contexts is cleared
> + */
> +void local_flush_tlb_all_mm(void)
> +{
> + struct task_struct *p;
An empty line wouldn't hurt here.
> + for_each_process(p)
> + if (p->mm)
> + local_flush_tlb_mm(p->mm);
> +}
> +
> void local_flush_tlb_all(void)
> {
> unsigned long flags;
WBR, Sergei
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH RESEND] MIPS: Add local_flush_tlb_all_mm to clear all mm contexts on calling cpu
2010-12-29 20:41 ` Sergei Shtylyov
@ 2010-12-29 23:18 ` Maksim Rayskiy
0 siblings, 0 replies; 5+ messages in thread
From: Maksim Rayskiy @ 2010-12-29 23:18 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: linux-mips, Kevin D. Kissell, Ralf Baechle
When hotplug removing a cpu, all mm context TLB entries must be cleared
to avoid ASID conflict when cpu is restarted.
New functions local_flush_tlb_all_mm() and all-cpu version
flush_tlb_all_mm() are added.
To function properly, local_flush_tlb_all_mm() must be called when
mm_cpumask for all
mm context on given cpu is cleared.
Signed-off-by: Maksim Rayskiy <maksim.rayskiy@gmail.com>
---
arch/mips/include/asm/tlbflush.h | 4 ++++
arch/mips/kernel/smp.c | 10 ++++++++++
arch/mips/mm/tlb-r4k.c | 13 +++++++++++++
3 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/arch/mips/include/asm/tlbflush.h b/arch/mips/include/asm/tlbflush.h
index 86b21de..d7b75e6 100644
--- a/arch/mips/include/asm/tlbflush.h
+++ b/arch/mips/include/asm/tlbflush.h
@@ -8,12 +8,14 @@
*
* - flush_tlb_all() flushes all processes TLB entries
* - flush_tlb_mm(mm) flushes the specified mm context TLB entries
+ * - flush_tlb_all_mm() flushes all mm context TLB entries
* - flush_tlb_page(vma, vmaddr) flushes one page
* - flush_tlb_range(vma, start, end) flushes a range of pages
* - flush_tlb_kernel_range(start, end) flushes a range of kernel pages
*/
extern void local_flush_tlb_all(void);
extern void local_flush_tlb_mm(struct mm_struct *mm);
+extern void local_flush_tlb_all_mm(void);
extern void local_flush_tlb_range(struct vm_area_struct *vma,
unsigned long start, unsigned long end);
extern void local_flush_tlb_kernel_range(unsigned long start,
@@ -26,6 +28,7 @@ extern void local_flush_tlb_one(unsigned long vaddr);
extern void flush_tlb_all(void);
extern void flush_tlb_mm(struct mm_struct *);
+extern void flush_tlb_all_mm(void);
extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long,
unsigned long);
extern void flush_tlb_kernel_range(unsigned long, unsigned long);
@@ -36,6 +39,7 @@ extern void flush_tlb_one(unsigned long vaddr);
#define flush_tlb_all() local_flush_tlb_all()
#define flush_tlb_mm(mm) local_flush_tlb_mm(mm)
+#define flush_tlb_all_mm() local_flush_tlb_all_mm()
#define flush_tlb_range(vma, vmaddr, end) local_flush_tlb_range(vma,
vmaddr, end)
#define flush_tlb_kernel_range(vmaddr,end) \
local_flush_tlb_kernel_range(vmaddr, end)
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index 383aeb9..535231f 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -242,6 +242,16 @@ void flush_tlb_all(void)
on_each_cpu(flush_tlb_all_ipi, NULL, 1);
}
+static void flush_tlb_all_mm_ipi(void *info)
+{
+ local_flush_tlb_all_mm();
+}
+
+void flush_tlb_all_mm(void)
+{
+ on_each_cpu(flush_tlb_all_mm_ipi, NULL, 1);
+}
+
static void flush_tlb_mm_ipi(void *mm)
{
local_flush_tlb_mm((struct mm_struct *)mm);
diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c
index c618eed..05f0d2e 100644
--- a/arch/mips/mm/tlb-r4k.c
+++ b/arch/mips/mm/tlb-r4k.c
@@ -66,6 +66,19 @@ extern void build_tlb_refill_handler(void);
#endif
+/* This function will clear all mm contexts on calling cpu
+ * To produce desired effect it must be called
+ * when mm_cpumask for all mm contexts is cleared
+ */
+void local_flush_tlb_all_mm(void)
+{
+ struct task_struct *p;
+
+ for_each_process(p)
+ if (p->mm)
+ local_flush_tlb_mm(p->mm);
+}
+
void local_flush_tlb_all(void)
{
unsigned long flags;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-12-29 23:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-29 19:04 [PATCH RESEND] MIPS: Add local_flush_tlb_all_mm to clear all mm contexts on calling cpu Maksim Rayskiy
2010-12-29 19:25 ` David Daney
-- strict thread matches above, loose matches on Subject: below --
2010-12-29 20:21 Maksim Rayskiy
2010-12-29 20:41 ` Sergei Shtylyov
2010-12-29 23:18 ` Maksim Rayskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox