From ad5ca98f54c3b6604a7bb72059973a85deb0b779 Mon Sep 17 00:00:00 2001 From: Marcelo Ricardo Leitner Date: Thu, 14 Aug 2014 16:44:53 -0300 Subject: [PATCH] ipv4: avoid parallel route cache gc executions When rt_intern_hash() has to deal with neighbour cache overflowing, it triggers the route cache garbage collector in an attempt to free some references on neighbour entries. Such call cannot be done async but should also not run in parallel with an already-running one, so that they don't collapse fighting over the hash lock entries. This patch thus blocks parallel executions with spinlocks: - A call from worker and from rt_intern_hash() are not the same, and cannot be merged, thus they will wait each other on rt_gc_lock. - Calls to gc from rt_intern_hash() may happen in parallel but we must wait for it to finish in order to try again. This dedup and synchrinozation is then performed by the locking just before calling __do_rt_garbage_collect(). Signed-off-by: Marcelo Ricardo Leitner Acked-by: Hannes Frederic Sowa Signed-off-by: Ben Hutchings --- Reading git-format-patch failed