Re: [patch] Real-Time Preemption, -RT-2.6.9-mm1-V0.6.8

From: Ingo Molnar
Date: Wed Nov 03 2004 - 03:42:40 EST



* Ingo Molnar <mingo@xxxxxxx> wrote:

> yeah, this is yet another networking deadlock, nicely detected and
> logged. Since the deadlock locks up ksoftirqd, timer handling (also
> driven by ksoftirqd) wont work - i think this explains the followup
> symptoms you got.

the patch below should fix this deadlock but there might be others
around ...

Ingo

--- linux/include/net/sock.h.orig2
+++ linux/include/net/sock.h
@@ -706,8 +706,8 @@ extern void FASTCALL(lock_sock(struct so
extern void FASTCALL(release_sock(struct sock *sk));

/* BH context may only use the following locking interface. */
-#define bh_lock_sock(__sk) spin_lock(&((__sk)->sk_lock.slock))
-#define bh_unlock_sock(__sk) spin_unlock(&((__sk)->sk_lock.slock))
+#define bh_lock_sock(__sk) do { rcu_read_lock_read(&ptype_lock); spin_lock(&((__sk)->sk_lock.slock)); } while (0)
+#define bh_unlock_sock(__sk) do { spin_unlock(&((__sk)->sk_lock.slock)); rcu_read_unlock_read(&ptype_lock); } while (0)

extern struct sock * sk_alloc(int family, int priority, int zero_it,
kmem_cache_t *slab);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/