Skip to contentSkip to conversation

avoid deadlock-prone sighand_lock in do_schedule_event

PATCH In review Jan Kiszka 2 participants 4 messages May 9, 2008 Generic include/asm header files

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 avoid deadlock-prone sighand_lock in do_schedule_event

This has been posted earlier already: Fix deadlocks when debugging Xenomai applications via gdb by removing any attempt to acquire sighand_lock (while holding rq_lock). This patch also cleans up the now unused lock wrapper.

Unless someone complains, I'm going to merge this later today into trunk and 2.4.x.

Jan

---
 include/asm-generic/wrappers.h |    1 -
 ksrc/nucleus/shadow.c          |    2 --
 2 files changed, 3 deletions(-)
include/asm-generic/wrappers.h +0 -1
Index: b/include/asm-generic/wrappers.h
===================================================================
@@ -95,7 +95,6 @@ unsigned long __va_to_kva(unsigned long 
 #define PF_NOFREEZE 0
 
 /* Signals */
-#define wrap_sighand_lock(p)     ((p)->sigmask_lock)
 #define wrap_get_sigpending(m,p) sigandsets(m, \
 					    &(p)->pending.signal, \
 					    &(p)->pending.signal)
ksrc/nucleus/shadow.c +0 -2
Index: b/ksrc/nucleus/shadow.c
===================================================================
@@ -2194,9 +2194,7 @@ static inline void do_schedule_event(str
 			if (signal_pending(next)) {
 				sigset_t pending;
 
-				spin_lock(&wrap_sighand_lock(next));	/* Already interrupt-safe. */
 				wrap_get_sigpending(&pending, next);
-				spin_unlock(&wrap_sighand_lock(next));
 
 				if (sigismember(&pending, SIGSTOP) ||
 				    sigismember(&pending, SIGINT))
Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#1 lore raw
Quoted 8 lines · Jan Kiszka

This has been posted earlier already: Fix deadlocks when debugging Xenomai applications via gdb by removing any attempt to acquire sighand_lock (while holding rq_lock). This patch also cleans up the now unused lock wrapper.

Unless someone complains, I'm going to merge this later today into trunk and 2.4.x.

It's already in.

Quoted 34 lines

Jan

---
 include/asm-generic/wrappers.h |    1 -
 ksrc/nucleus/shadow.c          |    2 --
 2 files changed, 3 deletions(-)

Index: b/include/asm-generic/wrappers.h
===================================================================

include/asm-generic/wrappers.h +0 -1
@@ -95,7 +95,6 @@ unsigned long __va_to_kva(unsigned long 
 #define PF_NOFREEZE 0
 
 /* Signals */
-#define wrap_sighand_lock(p)     ((p)->sigmask_lock)
 #define wrap_get_sigpending(m,p) sigandsets(m, \
 					    &(p)->pending.signal, \
 					    &(p)->pending.signal)

Index: b/ksrc/nucleus/shadow.c
===================================================================

ksrc/nucleus/shadow.c +0 -2
@@ -2194,9 +2194,7 @@ static inline void do_schedule_event(str
 			if (signal_pending(next)) {
 				sigset_t pending;
 
-				spin_lock(&wrap_sighand_lock(next));	/* Already interrupt-safe. */
 				wrap_get_sigpending(&pending, next);
-				spin_unlock(&wrap_sighand_lock(next));
 
 				if (sigismember(&pending, SIGSTOP) ||
 				    sigismember(&pending, SIGINT))
Signature · 1 line
Philippe.
author
#2 lore raw
Quoted 11 lines · Philippe Gerum
Quoted 8 lines · Jan Kiszka

This has been posted earlier already: Fix deadlocks when debugging Xenomai applications via gdb by removing any attempt to acquire sighand_lock (while holding rq_lock). This patch also cleans up the now unused lock wrapper.

Unless someone complains, I'm going to merge this later today into trunk and 2.4.x.

It's already in.

Indeed, missed it. May I remove the wrapper?

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#3 lore raw
Quoted 7 lines · Jan Kiszka
Quoted 6 lines · Philippe Gerum
Quoted 5 lines · Jan Kiszka

This has been posted earlier already: Fix deadlocks when debugging Xenomai applications via gdb by removing any attempt to acquire sighand_lock (while holding rq_lock). This patch also cleans up the now unused lock wrapper.

Quoted 7 lines
Quoted 4 lines
Quoted 3 lines

Unless someone complains, I'm going to merge this later today into trunk and 2.4.x.

It's already in.

Indeed, missed it. May I remove the wrapper?

Would be nice, yes.

Signature · 1 line
Philippe.