linux/include
David S. Miller f11e6659ce [IPV6]: Fix routing round-robin locking.
As per RFC2461, section 6.3.6, item #2, when no routers on the
matching list are known to be reachable or probably reachable we
do round robin on those available routes so that we make sure
to probe as many of them as possible to detect when one becomes
reachable faster.

Each routing table has a rwlock protecting the tree and the linked
list of routes at each leaf.  The round robin code executes during
lookup and thus with the rwlock taken as a reader.  A small local
spinlock tries to provide protection but this does not work at all
for two reasons:

1) The round-robin list manipulation, as coded, goes like this (with
   read lock held):

	walk routes finding head and tail

	spin_lock();
	rotate list using head and tail
	spin_unlock();

   While one thread is rotating the list, another thread can
   end up with stale values of head and tail and then proceed
   to corrupt the list when it gets the lock.  This ends up causing
   the OOPS in fib6_add() later onthat many people have been hitting.

2) All the other code paths that run with the rwlock held as
   a reader do not expect the list to change on them, they
   expect it to remain completely fixed while they hold the
   lock in that way.

So, simply stated, it is impossible to implement this correctly using
a manipulation of the list without violating the rwlock locking
semantics.

Reimplement using a per-fib6_node round-robin pointer.  This way we
don't need to manipulate the list at all, and since the round-robin
pointer can only ever point to real existing entries we don't need
to perform any locking on the changing of the round-robin pointer
itself.  We only need to reset the round-robin pointer to NULL when
the entry it is pointing to is removed.

The idea is from Thomas Graf and it is very similar to how this
was implemented before the advanced router selection code when in.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-03-25 18:48:05 -07:00
..
acpi Pull bugzilla-8171 into release branch 2007-03-20 11:06:00 -04:00
asm-alpha
asm-arm Merge master.kernel.org:/home/rmk/linux-2.6-arm 2007-03-24 17:01:45 -07:00
asm-arm26 Storage class should be before const qualifier 2007-02-17 20:11:19 +01:00
asm-avr32 [PATCH] gpio_direction_output() needs an initial value 2007-03-16 19:25:04 -07:00
asm-cris
asm-frv [PATCH] FRV: Add some missng lazy MMU hooks for NOMMU mode 2007-03-01 14:53:36 -08:00
asm-generic Revert "[PATCH] LOG2: Alter get_order() so that it can make use of ilog2() on a constant" 2007-03-06 19:38:01 -08:00
asm-h8300
asm-i386 [PATCH] i386: clear segment register padding in core dumps 2007-03-23 15:32:58 -07:00
asm-ia64 Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6 2007-03-21 19:45:50 -07:00
asm-m32r [PATCH] m32r dma-mapping.h should simply include generic/dma-mapping-broken.h 2007-03-14 15:27:49 -07:00
asm-m68k [PATCH] m68k dma-mapping: gfp_t annotations 2007-03-14 15:27:51 -07:00
asm-m68knommu [PATCH] m68knommu: GPIO line defines for the ColdFire 5282 2007-03-06 18:08:38 -08:00
asm-mips [MIPS] SB1250: Fix bugs/warnings by creative use of volatile. 2007-03-24 17:01:50 +00:00
asm-parisc Merge master.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6 2007-02-26 12:48:06 -08:00
asm-powerpc [POWERPC] Avoid hypervisor statistics calculation in real mode 2007-03-22 15:01:43 +11:00
asm-ppc
asm-s390 [S390] Wire up sys_utimes. 2007-03-19 13:19:07 +01:00
asm-sh sh: Fix bogus regs pointer in do_IRQ(). 2007-03-14 13:03:35 +09:00
asm-sh64
asm-sparc [PATCH] sparc: have dma-mapping.h include generic/dma-mapping-broken in non-PCI case 2007-03-14 15:27:49 -07:00
asm-sparc64 [SPARC64]: Get DEBUG_PAGEALLOC working again. 2007-03-16 17:20:28 -07:00
asm-um [PATCH] uml: pte_mkread fix 2007-03-01 14:53:38 -08:00
asm-v850
asm-x86_64 x86-64: add "local_apic_timer_c2_ok" here too 2007-03-23 11:32:31 -07:00
asm-xtensa
crypto
keys
linux [PATCH] lockdep: lockdep_depth vs. debug_locks 2007-03-22 19:39:06 -07:00
math-emu
media V4L/DVB (5271): Add VIDIOC_TRY_ENCODER_CMD and VIDIOC_ENCODER_CMD ioctls. 2007-03-01 13:09:46 -02:00
mtd
net [IPV6]: Fix routing round-robin locking. 2007-03-25 18:48:05 -07:00
pcmcia
rdma
rxrpc
scsi Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2007-02-19 13:32:28 -08:00
sound [ALSA] version 1.0.14rc3 2007-03-14 08:25:52 +01:00
video
Kbuild