linux/arch
David S. Miller 7a1ac52641 [SPARC64]: Fix and re-enable dynamic TSB sizing.
This is good for up to %50 performance improvement of some test cases.
The problem has been the race conditions, and hopefully I've plugged
them all up here.

1) There was a serious race in switch_mm() wrt. lazy TLB
   switching to and from kernel threads.

   We could erroneously skip a tsb_context_switch() and thus
   use a stale TSB across a TSB grow event.

   There is a big comment now in that function describing
   exactly how it can happen.

2) All code paths that do something with the TSB need to be
   guarded with the mm->context.lock spinlock.  This makes
   page table flushing paths properly synchronize with both
   TSB growing and TLB context changes.

3) TSB growing events are moved to the end of successful fault
   processing.  Previously it was in update_mmu_cache() but
   that is deadlock prone.  At the end of do_sparc64_fault()
   we hold no spinlocks that could deadlock the TSB grow
   sequence.  We also have dropped the address space semaphore.

While we're here, add prefetching to the copy_tsb() routine
and put it in assembler into the tsb.S file.  This piece of
code is quite time critical.

There are some small negative side effects to this code which
can be improved upon.  In particular we grab the mm->context.lock
even for the tsb insert done by update_mmu_cache() now and that's
a bit excessive.  We can get rid of that locking, and the same
lock taking in flush_tsb_user(), by disabling PSTATE_IE around
the whole operation including the capturing of the tsb pointer
and tsb_nentries value.  That would work because anyone growing
the TSB won't free up the old TSB until all cpus respond to the
TSB change cross call.

I'm not quite so confident in that optimization to put it in
right now, but eventually we might be able to and the description
is here for reference.

This code seems very solid now.  It passes several parallel GCC
bootstrap builds, and our favorite "nut cruncher" stress test which is
a full "make -j8192" build of a "make allmodconfig" kernel.  That puts
about 256 processes on each cpu's run queue, makes lots of process cpu
migrations occur, causes lots of page table and TLB flushing activity,
incurs many context version number changes, and it swaps the machine
real far out to disk even though there is 16GB of ram on this test
system. :-)

Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20 01:16:33 -08:00
..
alpha [PATCH] alpha: fix IRQ handling lockup 2006-03-09 19:47:37 -08:00
arm [ARM] 3362/1: [cleanup] - duplicate decleration of mem_fclk_21285 2006-03-15 23:18:08 +00:00
arm26 [PATCH] arm26: select BLK_DEV_FD only on A5K 2006-02-01 08:53:22 -08:00
cris [PATCH] fallout from ptrace consolidation patch: cris/arch-v10 2006-02-07 20:57:19 -05:00
frv [PATCH] FRV: Use virtual interrupt disablement 2006-02-14 16:09:35 -08:00
h8300 [PATCH] add missing pm_power_off's 2006-03-06 18:40:44 -08:00
i386 [PATCH] x86: check for online cpus before bringing them up 2006-03-17 07:51:25 -08:00
ia64 [IA64] Fix race in the accessed/dirty bit handlers 2006-03-08 16:07:55 -08:00
m32r [PATCH] m32r: fix and update for gcc-4.0 2006-02-24 14:31:36 -08:00
m68k [PATCH] m68k: pm_power_off() breakage 2006-02-18 16:30:20 -05:00
m68knommu [PATCH] hrtimer: round up relative start time on low-res arches 2006-02-14 16:09:35 -08:00
mips [MIPS] SB1: Check for -mno-sched-prolog if building corelis debug kernel. 2006-03-18 16:59:31 +00:00
parisc [PATCH] hrtimer: round up relative start time on low-res arches 2006-02-14 16:09:35 -08:00
powerpc powerpc: update defconfigs 2006-03-16 16:55:08 +11:00
ppc powerpc: Fix various syscall/signal/swapcontext bugs 2006-03-08 13:24:22 +11:00
s390 [PATCH] s390: Increase spinlock retry code performance 2006-03-09 19:47:38 -08:00
sh [PATCH] arch/sh/Kconfig: don't source non-existing Kconfig files 2006-03-09 19:47:37 -08:00
sh64 [PATCH] drive_info removal outside of arch/i386 2006-02-07 20:56:47 -05:00
sparc [SPARC]: BUG_ON() Conversion in arch/sparc/kernel/ioport.c 2006-03-20 01:10:35 -08:00
sparc64 [SPARC64]: Fix and re-enable dynamic TSB sizing. 2006-03-20 01:16:33 -08:00
um [PATCH] uml: tidying COW code 2006-02-24 14:31:37 -08:00
v850 [PATCH] add missing pm_power_off's 2006-03-06 18:40:44 -08:00
x86_64 Revert "[PATCH] x86-64: Fix up handling of non canonical user RIPs" 2006-03-14 08:01:47 -08:00
xtensa [PATCH] xtensa must set RWSEM_GENERIC_SPINLOCK=y 2006-03-09 19:47:37 -08:00