linux/arch/ia64
Nick Piggin b3e19d924b fs: scale mntget/mntput
The problem that this patch aims to fix is vfsmount refcounting scalability.
We need to take a reference on the vfsmount for every successful path lookup,
which often go to the same mount point.

The fundamental difficulty is that a "simple" reference count can never be made
scalable, because any time a reference is dropped, we must check whether that
was the last reference. To do that requires communication with all other CPUs
that may have taken a reference count.

We can make refcounts more scalable in a couple of ways, involving keeping
distributed counters, and checking for the global-zero condition less
frequently.

- check the global sum once every interval (this will delay zero detection
  for some interval, so it's probably a showstopper for vfsmounts).

- keep a local count and only taking the global sum when local reaches 0 (this
  is difficult for vfsmounts, because we can't hold preempt off for the life of
  a reference, so a counter would need to be per-thread or tied strongly to a
  particular CPU which requires more locking).

- keep a local difference of increments and decrements, which allows us to sum
  the total difference and hence find the refcount when summing all CPUs. Then,
  keep a single integer "long" refcount for slow and long lasting references,
  and only take the global sum of local counters when the long refcount is 0.

This last scheme is what I implemented here. Attached mounts and process root
and working directory references are "long" references, and everything else is
a short reference.

This allows scalable vfsmount references during path walking over mounted
subtrees and unattached (lazy umounted) mounts with processes still running
in them.

This results in one fewer atomic op in the fastpath: mntget is now just a
per-CPU inc, rather than an atomic inc; and mntput just requires a spinlock
and non-atomic decrement in the common case. However code is otherwise bigger
and heavier, so single threaded performance is basically a wash.

Signed-off-by: Nick Piggin <npiggin@kernel.dk>
2011-01-07 17:50:33 +11:00
..
configs defconfig reduction 2010-08-14 22:26:53 +02:00
dig
hp SCSI host lock push-down 2010-11-16 13:33:23 -08:00
include/asm taskstats: use real microsecond granularity for CPU times 2010-10-27 18:03:17 -07:00
kernel fs: scale mntget/mntput 2011-01-07 17:50:33 +11:00
kvm KVM: ia64: define kvm_lapic_enabled() to fix a compile error 2010-10-24 10:52:00 +02:00
lib [IA64] fix csum_ipv6_magic() 2009-09-02 09:14:48 -07:00
mm [IA64] Fix spinaphore down_spin() 2010-06-30 10:46:16 -07:00
oprofile [IA64] implement ticket locks for Itanium 2009-09-25 08:42:16 -07:00
pci ACPI: pci_root: pass acpi_pci_root to arch-specific scan 2010-04-04 00:29:53 -04:00
scripts scripts: change scripts to use system python instead of env 2010-02-02 14:33:56 +01:00
sn Merge branch 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl 2010-10-22 10:52:56 -07:00
uv [IA64] wrong attribute of HUB chip written in uv_setup() 2010-02-26 11:20:41 -08:00
xen [IA64] xen: use ARRAY_SIZE macro in xen_pv_ops.c 2010-09-23 14:26:30 -07:00
Kconfig Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 2010-10-28 16:16:39 -07:00
Kconfig.debug
Makefile Merge commit 'v2.6.35' into kbuild/kbuild 2010-08-04 13:59:13 +02:00
install.sh kbuild: use INSTALLKERNEL to select customized installkernel script 2009-09-20 12:18:14 +02:00
module.lds