lkml.org 
[lkml]   [2008]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] signals: collect_signal: remove the unneeded sigismember() check


On Tue, 20 May 2008, Roland McGrath wrote:
>
> drm_lock is using block_all_signals to catch all the stop signals
> for a purpose that is not immediately clear to me.

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.

In order for the user-level direct-rendering code to be able to do a lock
that is safe in the presense of signals, the locking code needs to have
some way to basically disable signals. And it could disable/re-enable them
all the time, but that would be very expensive and defeat the whole
purpose (which is that you can get the lock cheaply in user space and only
take a system call on a lock conflict).

So instead, when it gets the DRM lock, it also does that
"block_all_signals()" thing, which means that *if* a signal happens, it
can temporarily disable the signal so that the handler won't be invoced in
the critical region.

Now, I have to admit that I do not know if the current user-level code
needs that any more, and even if it does, if it could possibly be replaced
by better models. It's a hack, no question about it. The whole DRI locking
is something really odd. Don't even ask me how it's supposed to work.

Linus


\
 
 \ /
  Last update: 2008-05-21 04:17    [W:0.058 / U:1.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site