patch-2.4.21 linux-2.4.21/kernel/signal.c

Next file: linux-2.4.21/kernel/sys.c
Previous file: linux-2.4.21/kernel/sched.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.20/kernel/signal.c linux-2.4.21/kernel/signal.c
@@ -20,6 +20,14 @@
  * SLAB caches for signal bits.
  */
 
+#define DEBUG_SIG 0
+
+#if DEBUG_SIG
+#define SIG_SLAB_DEBUG	(SLAB_DEBUG_FREE | SLAB_RED_ZONE /* | SLAB_POISON */)
+#else
+#define SIG_SLAB_DEBUG	0
+#endif
+
 static kmem_cache_t *sigqueue_cachep;
 
 atomic_t nr_queued_signals;
@@ -31,7 +39,7 @@
 		kmem_cache_create("sigqueue",
 				  sizeof(struct sigqueue),
 				  __alignof__(struct sigqueue),
-				  0, NULL, NULL);
+				  SIG_SLAB_DEBUG, NULL, NULL);
 	if (!sigqueue_cachep)
 		panic("signals_init(): cannot create sigqueue SLAB cache");
 }
@@ -257,6 +265,11 @@
 {
 	int sig = 0;
 
+#if DEBUG_SIG
+printk("SIG dequeue (%s:%d): %d ", current->comm, current->pid,
+	signal_pending(current));
+#endif
+
 	sig = next_signal(current, mask);
 	if (sig) {
 		if (current->notifier) {
@@ -276,6 +289,10 @@
 	}
 	recalc_sigpending(current);
 
+#if DEBUG_SIG
+printk(" %d -> %d\n", signal_pending(current), sig);
+#endif
+
 	return sig;
 }
 
@@ -518,6 +535,11 @@
 	unsigned long flags;
 	int ret;
 
+
+#if DEBUG_SIG
+printk("SIG queue (%s:%d): %d ", t->comm, t->pid, sig);
+#endif
+
 	ret = -EINVAL;
 	if (sig < 0 || sig > _NSIG)
 		goto out_nolock;
@@ -552,6 +574,9 @@
 out:
 	spin_unlock_irqrestore(&t->sigmask_lock, flags);
 out_nolock:
+#if DEBUG_SIG
+printk(" %d -> %d\n", signal_pending(t), ret);
+#endif
 
 	return ret;
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)