Skip to contentSkip to conversation

Reduce TLB flushing during process migration

DISCUSSION Andrew Morton 3 participants 3 messages May 12, 2004 – May 13, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

fyi, we're planning on pulling out the tlb_migrate_prepare() stuff again - apparently it's not welcome on ia64 in its present form.

davem, you expressed interest in this previously. The question is whether we should remove the whole thing, or just the ia64 component?

Begin forwarded message:

Date: Wed, 12 May 2004 15:08:36 -0700
From: Andrew Morton <[email protected]>
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Reduce TLB flushing during process migration

Quoted 2 lines · David Mosberger

Please remove it until a proper solution exists.

I'll submit this on Friday, when bugalugs returns.

David Mosberger asked that this be backed out:

"I do not believe that flushing the TLB before migration is be the right thing to do on ia64 machines which support global TLB purges (i.e., all but SGI's machines)."

It was of huge benefit for the SGI machines, so work is ongoing.

---

 25-akpm/include/asm-generic/tlb.h |    2 --
 25-akpm/include/asm-ia64/tlb.h    |    2 --
 25-akpm/kernel/sched.c            |   10 ----------
 3 files changed, 14 deletions(-)
include/asm-generic/tlb.h renamed from include/asm-generic/tlb.h~revert-process-migration-speedup +0 -2
diff -puN include/asm-generic/tlb.h~revert-process-migration-speedup include/asm-generic/tlb.h
@@ -146,6 +146,4 @@ static inline void tlb_remove_page(struc
 		__pmd_free_tlb(tlb, pmdp);			\
 	} while (0)
 
-#define tlb_migrate_prepare(mm) do { } while(0)
-
 #endif /* _ASM_GENERIC__TLB_H */
include/asm-ia64/tlb.h renamed from include/asm-ia64/tlb.h~revert-process-migration-speedup +0 -2
diff -puN include/asm-ia64/tlb.h~revert-process-migration-speedup include/asm-ia64/tlb.h
@@ -211,8 +211,6 @@ __tlb_remove_tlb_entry (struct mmu_gathe
 	tlb->end_addr = address + PAGE_SIZE;
 }
 
-#define tlb_migrate_prepare(mm) flush_tlb_mm(mm)
-
 #define tlb_start_vma(tlb, vma)			do { } while (0)
 #define tlb_end_vma(tlb, vma)			do { } while (0)
 
kernel/sched.c renamed from kernel/sched.c~revert-process-migration-speedup +0 -10
diff -puN kernel/sched.c~revert-process-migration-speedup kernel/sched.c
@@ -26,8 +26,6 @@
 #include <linux/highmem.h>
 #include <linux/smp_lock.h>
 #include <asm/mmu_context.h>
-#include <linux//pagemap.h>
-#include <asm/tlb.h>
 #include <linux/interrupt.h>
 #include <linux/completion.h>
 #include <linux/kernel_stat.h>
@@ -1302,14 +1300,6 @@ static void sched_migrate_task(task_t *p
 		wake_up_process(mt);
 		put_task_struct(mt);
 		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.
-		 */
-		tlb_migrate_prepare(current->mm);
-
 		return;
 	}
 out:

_

#1 lore raw
Quoted 2 lines · On Wed, 12 May 2004 15:32:03 -0700 Andrew Morton <[email protected]> wrote:

davem, you expressed interest in this previously. The question is whether we should remove the whole thing, or just the ia64 component?

It doesn't do anything for me on sparc64. As per the change description, it's a benefit also on platforms like x86 where context-switch == tlb flush anyways.

At least that was my understanding.

If it's beneficial to the ia64 folks, I'm ambivalent, so just put the fixed version back in once available.

#2 lore raw
Quoted 6 lines · David S. Miller
Quoted 2 lines

davem, you expressed interest in this previously. The question is whether we should remove the whole thing, or just the ia64 component?

It doesn't do anything for me on sparc64. As per the change description, it's a benefit also on platforms like x86 where context-switch == tlb flush anyways.

Hmm, are you sure? How would that help?

-Andi