Messages in this thread | | | From | Roland McGrath <> | Subject | Re: [PATCH 1/2] signals: collect_signal: remove the unneeded sigismember() check | Date | Tue, 20 May 2008 19:56:17 -0700 (PDT) |
| |
> 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
| |