Contributed by merdely on from the shootdown-at-the-tlb-corral dept.
The Translation Lookaside Buffer (TLB) is cache in the CPU that maps virtual page addresses to physical page addresses. It prevents the CPU from having to go all the way out to the page table.
A TLB Shootdown occurs when a process restricts access to a page in shared memory and must interrupt processes using that memory space on other processors so they flush their TLB tables.
During the hackathon, art@ committed a change that's a simplified, faster version of the shootdown code which gives a 15% reduction in system time on Art's dual-core laptop.
The commit message is below.
CVSROOT: /cvs Module name: src Changes by: art a t cvs openbsd org 2007/05/25 09:55:27 Modified files: sys/arch/i386/i386: apicvec.s ipifuncs.c lapic.c lock_machdep.c machdep.c pmap.c vm_machdep.c sys/arch/i386/include: atomic.h i82489var.h intr.h pmap.h Log message: Replace the overdesigned and overcomplicated tlb shootdown code with very simple and dumb fast tlb IPI handlers that have in the order of the same amount of instructions as the old code had function calls. All TLB shootdowns are reorganized so that we always shoot the[m], without looking at PG_U and when we're shooting a range (primarily in pmap_remove), we shoot the range when there are 32 or less pages in it, otherwise we just nuke the whole TLB (this might need tweaking if someone is interested in micro-optimization). The IPIs are not handled through the normal interrupt vectoring code, they are not blockable and they only shoot one page or a range of pages or the whole tlb. This gives a 15% reduction in system time on my dual-core laptop during a kernel compile and an 18% reduction in real time on a quad machine doing bulk ports build. Tested by many, in snaps for a week, no slowdowns reported (although not everyone is seeing such huge wins).The massive speed improvements we've seen in different parts of OpenBSD through the hackathon will certainly make OpenBSD 4.2 an interesting upgrade.
(Comments are closed)