mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Roland McGrath <roland@redhat.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] signals: collect_signal: remove the unneeded sigismember() check
Date: Tue, 20 May 2008 19:14:15 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.1.10.0805201903150.3081@woody.linux-foundation.org> (raw)
In-Reply-To: <20080521005646.1BD5426FA1C@magilla.localdomain>



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

  reply	other threads:[~2008-05-21  2:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-17 15:14 Oleg Nesterov
2008-05-21  0:56 ` Roland McGrath
2008-05-21  2:14   ` Linus Torvalds [this message]
2008-05-21  2:56     ` Roland McGrath
2008-05-21 12:20       ` Oleg Nesterov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.1.10.0805201903150.3081@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@tv-sign.ru \
    --cc=roland@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®