Subject: CVS commit: [vmlocking] src/sys
To: None <source-changes@NetBSD.org>
From: Andrew Doran <ad@netbsd.org>
List: source-changes
Date: 09/01/2007 12:55:16
Module Name:	src
Committed By:	ad
Date:		Sat Sep  1 12:55:16 UTC 2007

Modified Files:
	src/sys/kern [vmlocking]: kern_cpu.c subr_pool.c
	src/sys/sys [vmlocking]: pool.h

Log Message:
- Add a CPU layer to pool caches. In combination with vmem/kmem this
  provides CPU-local slab/object and general purpose allocators. The
  strategy used is as described in Jeff Bonwick's USENIX paper, except in
  at least one place where the described allocation strategy doesn't make
  sense. For exclusive access to the CPU layer the IPL is raised or kernel
  preemption disabled. Where the interrupt priority levels are software
  emulated this is much cheaper than taking a lock, and I think that
  writing to a local %pil register is likely to have a similar penalty to
  taking a lock.

  No tuning of the group sizes is currently done - all groups have 15
  items each, but this should be fairly easy to implement. Also, the
  reclamation mechanism should probably use a cross-call to drain the
  CPU-level caches on remote CPUs.

  Currently this causes kernel memory corruption on i386, yet works without
  a problem on amd64. The cache layer is disabled for the time being until I
  can find the bug.

- Change the pool_cache API so that the caches are themselves dynamically
  allocated, and that each cache is tied to a single pool only. Add some
  stubs to change pool_cache parameters that call directly through to the
  pool layer (e.g. pool_cache_sethiwat). The idea here is that pool_cache
  should become the default object allocator (and so LKM friendly), and
  that the pool allocator should be for kernel-internal use only. This will
  be posted to tech-kern@ for review.


To generate a diff of this commit:
cvs rdiff -r1.2.2.6 -r1.2.2.7 src/sys/kern/kern_cpu.c
cvs rdiff -r1.128.2.6 -r1.128.2.7 src/sys/kern/subr_pool.c
cvs rdiff -r1.55.6.2 -r1.55.6.3 src/sys/sys/pool.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.