[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080521025617.612D726FA1C@magilla.localdomain>
Date: Tue, 20 May 2008 19:56:17 -0700 (PDT)
From: Roland McGrath <roland@...hat.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Oleg Nesterov <oleg@...sign.ru>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] signals: collect_signal: remove the unneeded
sigismember() check
> 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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists