kernel-ark/include/asm-sparc64
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
..
a.out.h [SPARC64]: Do not allow mapping pages within 4GB of 64-bit VA hole. 2006-03-20 01:14:14 -08:00
agp.h
apb.h
asi.h [SPARC64]: Sun4v specific ASI defines. 2006-03-20 01:11:43 -08:00
atomic.h [PATCH] mutex subsystem, add atomic_xchg() to all arches 2006-01-09 15:59:17 -08:00
auxio.h
auxvec.h
bbc.h
bitops.h [FLS64]: generic version 2006-01-03 13:11:06 -08:00
bpp.h
bsderrno.h
bug.h
bugs.h
byteorder.h
cache.h [PATCH] Kill L1_CACHE_SHIFT_MAX 2006-01-08 20:13:39 -08:00
cacheflush.h
chafsr.h
checksum.h
chmctrl.h
cmt.h
compat.h
const.h
cpudata.h [SPARC64]: Kill cpudata->idle_volume. 2006-03-20 01:13:51 -08:00
cputime.h
current.h
dcr.h
dcu.h
delay.h
display7seg.h
div64.h
dma-mapping.h
dma.h
ebus.h [SPARC]: More abstractions and cleanups of dma handling in cs4231. 2005-11-07 14:09:19 -08:00
elf.h [SPARC64]: Add HWCAP_SPARC_BLKINIT elf capability flag for Niagara. 2006-03-20 01:13:26 -08:00
emergency-restart.h
envctrl.h
errno.h
estate.h
fbio.h
fcntl.h
fhc.h
floppy.h
fpumacro.h
futex.h [SPARC64]: Mark __ex_table section correctly. 2006-03-04 23:23:56 -08:00
hardirq.h
head.h [SPARC64]: Add GET_GL_GLOBAL() macro for SUN4V. 2006-03-20 01:13:18 -08:00
hw_irq.h
hypervisor.h [SPARC64]: Fix bugs in SUN4V cpu mondo dispatch. 2006-03-20 01:14:09 -08:00
ide.h
idprom.h [SPARC]: Clean up idprom header files. 2006-03-20 01:12:08 -08:00
intr_queue.h [SPARC64]: Sun4v interrupt queue register definitions. 2006-03-20 01:11:44 -08:00
io.h
ioctl.h
ioctls.h
iommu.h
ipc.h
ipcbuf.h
irq.h [SPARC64]: Fix uniprocessor IRQ targetting on SUN4V. 2006-03-20 01:13:24 -08:00
isa.h
kdebug.h
kmap_types.h
kprobes.h [PATCH] kprobes: fix build breakage 2006-01-10 08:01:40 -08:00
linkage.h
local.h
lsu.h
mc146818rtc.h
mman.h [PATCH] add asm-generic/mman.h 2006-02-15 15:32:22 -08:00
mmu_context.h [SPARC64]: Fix and re-enable dynamic TSB sizing. 2006-03-20 01:16:33 -08:00
mmu.h [SPARC64]: Use 13-bit context size always. 2006-03-20 01:14:06 -08:00
module.h
mostek.h
msgbuf.h
mutex.h [PATCH] mutex subsystem, add default include/asm-*/mutex.h files 2006-01-09 15:59:19 -08:00
namei.h
ns87303.h
numnodes.h [SPARC64]: Move over to sparsemem. 2006-03-20 01:14:22 -08:00
openprom.h
openpromio.h
oplib.h [SPARC64]: Fix system type in /proc/cpuinfo and remove bogus OBP check. 2006-03-20 01:14:25 -08:00
page.h [SPARC64]: Move over to sparsemem. 2006-03-20 01:14:22 -08:00
param.h
parport.h
pbm.h [SPARC64]: More SUN4V PCI controller work. 2006-03-20 01:12:11 -08:00
pci.h [SPARC64]: Beginnings of SUN4V PCI controller support. 2006-03-20 01:12:10 -08:00
pconf.h
percpu.h
perfctr.h
pgalloc.h [SPARC64]: Kill pgtable quicklists and use SLAB. 2006-03-20 01:11:14 -08:00
pgtable.h [SPARC64]: Move over to sparsemem. 2006-03-20 01:14:22 -08:00
pil.h [SPARC64]: Fix new context version SMP handling. 2006-03-20 01:14:21 -08:00
poll.h
posix_types.h
processor.h [SPARC64]: Fix %tstate ASI handling in start_thread{,32}() 2006-03-20 01:13:57 -08:00
psrcompat.h
pstate.h [SPARC64]: Fixup TSTATE layout diagram in asm/pstate.h 2006-03-20 01:13:02 -08:00
ptrace.h
reg.h
resource.h
rtc.h
rwsem-const.h
rwsem.h
sbus.h
scatterlist.h
scratchpad.h [SPARC64]: Sun4v scratchpad register layout. 2006-03-20 01:11:44 -08:00
seccomp.h
sections.h
semaphore.h
sembuf.h
setup.h
sfafsr.h
sfp-machine.h
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h
signal.h
smp.h [SPARC64]: Add SMT scheduling support for Niagara. 2006-03-20 01:14:24 -08:00
socket.h
sockios.h
solerrno.h
sparsemem.h [SPARC64]: Move over to sparsemem. 2006-03-20 01:14:22 -08:00
spinlock_types.h
spinlock.h [SPARC64]: Implement __raw_read_trylock() 2006-01-23 21:03:56 -08:00
spitfire.h [SPARC64]: Add 'hypervisor' to ultra_tlb_type enumeration. 2006-03-20 01:11:39 -08:00
starfire.h
stat.h
statfs.h
string.h
sunbpp.h
svr4.h
system.h [SPARC64]: Kill all %pstate changes in context switch code. 2006-03-20 01:11:49 -08:00
termbits.h
termios.h [SPARC]: remove duplicate TIOCPKT_ definitions 2005-11-07 14:10:42 -08:00
thread_info.h [SPARC64]: Correctable ECC errors cannot occur at trap level > 0. 2006-03-20 01:11:33 -08:00
timer.h
timex.h [SPARC64]: Define ARCH_HAS_READ_CURRENT_TIMER. 2006-03-20 01:13:29 -08:00
tlb.h [SPARC64] mm: simpler tlb_flush_mmu 2005-11-07 14:12:08 -08:00
tlbflush.h [SPARC64]: Move away from virtual page tables, part 1. 2006-03-20 01:11:13 -08:00
topology.h
tsb.h [SPARC64]: Create a seperate kernel TSB for 4MB/256MB mappings. 2006-03-20 01:13:56 -08:00
ttable.h [SPARC64]: More TLB/TSB handling fixes. 2006-03-20 01:13:34 -08:00
types.h
uaccess.h [SPARC64]: __bzero_noasi --> __clear_user 2006-03-20 01:13:28 -08:00
uctx.h
unaligned.h
unistd.h [SPARC]: sys_newfstatat --> sys_fstatat64 2006-02-12 23:30:11 -08:00
upa.h
user.h
utrap.h
vdev.h [SPARC64]: Decode virtual-devices interrupts correctly. 2006-03-20 01:13:05 -08:00
vga.h
visasm.h
watchdog.h
xor.h [SPARC64]: Niagara optimized XOR functions for RAID. 2006-03-20 01:14:03 -08:00