Re: [PATCH 1/2] signals: collect_signal: remove the unneededsigismember() check

From: Roland McGrath
Date: Tue May 20 2008 - 22:56:47 EST


> It's basically the equivalent of a "spin_lock_irq()" for DRM, where
> signals are the "interrupts" that need to be blocked while holding the
> lock.

Well, sure, that makes sense. But that's not what it does. I can see what
it does, I just can't tell why it really makes any sense.

Despite the name, block_all_signals() in fact blocks no signals. What
it does is install notifier/notifier_mask, which makes the hook get
called for those particular signals and it can decide to delay the
signal (in a kooky fashion that's not really reliable).

drm_lock uses a mask containing only the stop signals (SIGSTOP, SIGTSTP,
SIGTTOU, SIGTTIN). So for other signals, its hook (drm_notifier) never
gets called, and signal_pending() stays set, handlers get run, etc.

So I can't tell what it's actually good for (that's at all reliable
now). But you just told me not to ask you how it's supposed to work,
and I respect that. ;-)

The best I can figure is that the user-level code in question really
does want to have signal handlers run, and to process fatal signals,
during those critical sections. It just wants to prevent a ^Z or
SIGSTOP at the critical spot leaving the lock held while the process
goes into TASK_STOPPED for an arbitrary period.


Thanks,
Roland
--
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/