public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] Reduce TLB flushing during process migration
@ 2004-02-17 16:22 Manfred Spraul
  2004-02-17 18:08 ` David S. Miller
  0 siblings, 1 reply; 10+ messages in thread
From: Manfred Spraul @ 2004-02-17 16:22 UTC (permalink / raw)
  To: Martin Hicks; +Cc: linux-kernel

Martin wrote:

>diff -Nru a/kernel/sched.c b/kernel/sched.c
>--- a/kernel/sched.c	Tue Feb 17 07:33:59 2004
>+++ b/kernel/sched.c	Tue Feb 17 07:33:59 2004
>@@ -25,6 +25,7 @@
> #include <linux/highmem.h>
> #include <linux/smp_lock.h>
> #include <asm/mmu_context.h>
>+#include <asm/tlbflush.h>
> #include <linux/interrupt.h>
> #include <linux/completion.h>
> #include <linux/kernel_stat.h>
>@@ -1135,6 +1136,14 @@
> 		task_rq_unlock(rq, &flags);
> 		wake_up_process(rq->migration_thread);
> 		wait_for_completion(&req.done);
>+
>+		/*
>+		 * we want a new context here. This eliminates TLB
>+		 * flushes on the cpus where the process executed prior to
>+		 * the migration.
>+		 */
>+		flush_tlb_mm(current->mm);
>+
>  
>
I think flush_tlb_mm() is the wrong function - e.g. for i386, it's a 
wasted flush, because i386 disconnects previous cpus from the tlb flush 
automatically.
And it's always the wrong thing if you've migrated one thread of a task 
that runs on multiple cpus. I think you need a new hook.

--
    Manfred


^ permalink raw reply	[flat|nested] 10+ messages in thread
* [PATCH] Reduce TLB flushing during process migration
@ 2004-02-17 15:49 Martin Hicks
  2004-02-17 18:07 ` David S. Miller
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Martin Hicks @ 2004-02-17 15:49 UTC (permalink / raw)
  To: Andrew Morton; +Cc: rusty, steiner, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 373 bytes --]


Hi Andrew,

Another optimization patch from Jack Steiner, intended to reduce TLB
flushes during process migration.

CC'ed Rusty because this patch is applied on top of his cpuhotplug code.

This patch was generated against -rc4 with the rc3-mm1 patch merged on
top of it.

mh

-- 
Martin Hicks                Wild Open Source Inc.
mort@wildopensource.com     613-266-2296

[-- Attachment #2: process-migration.patch --]
[-- Type: text/plain, Size: 1225 bytes --]

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1680  -> 1.1681 
#	      kernel/sched.c	1.240   -> 1.241  
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 04/02/17	mort@tomahawk.engr.sgi.com	1.1681
# Process migration optimization.
# --------------------------------------------
#
diff -Nru a/kernel/sched.c b/kernel/sched.c
--- a/kernel/sched.c	Tue Feb 17 07:33:59 2004
+++ b/kernel/sched.c	Tue Feb 17 07:33:59 2004
@@ -25,6 +25,7 @@
 #include <linux/highmem.h>
 #include <linux/smp_lock.h>
 #include <asm/mmu_context.h>
+#include <asm/tlbflush.h>
 #include <linux/interrupt.h>
 #include <linux/completion.h>
 #include <linux/kernel_stat.h>
@@ -1135,6 +1136,14 @@
 		task_rq_unlock(rq, &flags);
 		wake_up_process(rq->migration_thread);
 		wait_for_completion(&req.done);
+
+		/*
+		 * we want a new context here. This eliminates TLB
+		 * flushes on the cpus where the process executed prior to
+		 * the migration.
+		 */
+		flush_tlb_mm(current->mm);
+
 		return;
 	}
 out:

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

end of thread, other threads:[~2004-02-18  4:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-17 16:22 [PATCH] Reduce TLB flushing during process migration Manfred Spraul
2004-02-17 18:08 ` David S. Miller
2004-02-17 20:05   ` Martin Hicks
2004-02-17 20:08     ` David S. Miller
2004-02-17 20:37       ` Martin Hicks
  -- strict thread matches above, loose matches on Subject: below --
2004-02-17 15:49 Martin Hicks
2004-02-17 18:07 ` David S. Miller
2004-02-17 20:50 ` Andrew Morton
2004-02-17 22:01   ` Martin Hicks
2004-02-18  2:34 ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox