]> git.neil.brown.name Git - history.git/commit
[PATCH] ppc64: SLB rewrite
authorAndrew Morton <akpm@osdl.org>
Sat, 31 Jan 2004 02:00:40 +0000 (18:00 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Sat, 31 Jan 2004 02:00:40 +0000 (18:00 -0800)
commit326f372c368ddefb3275ce087be603a1f4cfd923
tree8ccd46d283e79390592c9686e3f40b4ea603147d
parent79c5772415858a62d1bcd2e368abd1e66560f2da
[PATCH] ppc64: SLB rewrite

From: Anton Blanchard <anton@samba.org>

The current SLB handling code has a number of problems:

- We loop trying to find an empty SLB entry before deciding to cast one
  out.  On large working sets this really hurts since the SLB is always full
  and we end up looping through all 64 entries unnecessarily.

- During castout we currently invalidate the entry we are replacing.  This
  is to avoid a nasty race where the entry is in the ERAT but not the SLB and
  another cpu does a tlbie that removes the ERAT at a critical point.  If
  this race is fixed the SLB can be removed.

- The SLB prefault code doesnt work properly

The following patch addresses all the above concerns and adds some more
optimisations:

- feature nop out some segment table only code

- slb invalidate the kernel segment on context switch (avoids us having to
  slb invalidate at each cast out)

- optimise flush on context switch, the lazy tlb stuff avoids it being
  called when going from userspace to kernel thread, but it gets called when
  going to kernel thread to userspace.  In many cases we are returning to the
  same userspace task, we now check for this and avoid the flush

- use the optimised POWER4 mtcrf where possible
arch/ppc64/kernel/head.S
arch/ppc64/kernel/pacaData.c
arch/ppc64/kernel/process.c
arch/ppc64/kernel/stab.c
include/asm-ppc64/cputable.h
include/asm-ppc64/mmu.h
include/asm-ppc64/mmu_context.h
include/asm-ppc64/paca.h