linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: dri-devel@lists.freedesktop.org, linux-mm@kvack.org,
	Souptick Joarder <jrdr.linux@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: Signal handling in a page fault handler
Date: Tue, 3 Apr 2018 06:48:54 -0700	[thread overview]
Message-ID: <20180403134854.GA28565@bombadil.infradead.org> (raw)
In-Reply-To: <152276164305.32747.4969221700358143640@mail.alporthouse.com>

On Tue, Apr 03, 2018 at 02:20:43PM +0100, Chris Wilson wrote:
> Quoting Matthew Wilcox (2018-04-03 14:10:25)
> > On Tue, Apr 03, 2018 at 01:33:15PM +0100, Chris Wilson wrote:
> > > Quoting Matthew Wilcox (2018-04-02 15:10:58)
> > > > I don't think the graphics drivers really want to be interrupted by
> > > > any signal.
> > > 
> > > Assume the worst case and we may block for 10s. Even a 10ms delay may be
> > > unacceptable to some signal handlers (one presumes). For the number one
> > > ^C usecase, yes that may be reduced to only bother if it's killable, but
> > > I wonder if there are not timing loops (e.g. sigitimer in Xorg < 1.19)
> > > that want to be able to interrupt random blockages.
> > 
> > Ah, setitimer / SIGALRM.  So what do we want to have happen if that
> > signal handler touches the mmaped device memory?
> 
> Burn in a great ball of fire :) Isn't that what usually happens if you
> do anything in a signal handler?

I don't know.  My mummy and daddy don't let me play with sharp things
like signals.

> Hmm, if SIGBUS has a handler does that count as a killable signal? The
> ddx does have code to service SIGBUS emitted when accessing the mmapped
> pointer that may result from the page insertion failing with no memory
> (or other random error). There we stop accessing via the pointer and
> use another indirect method.

Any signal with a handler is non-fatal, and so a call to
mutex_lock_killable() would not return if SIGBUS was delivered to a thread
blocking in a page fault.  mutex_lock_interruptible() would return -EINTR.

  parent reply	other threads:[~2018-04-03 13:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-02 14:10 Signal handling in a page fault handler Matthew Wilcox
2018-04-03 12:33 ` Chris Wilson
2018-04-03 13:10   ` Matthew Wilcox
     [not found]     ` <152276164305.32747.4969221700358143640@mail.alporthouse.com>
2018-04-03 13:48       ` Matthew Wilcox [this message]
2018-04-03 13:12   ` Thomas Hellstrom
2018-04-03 14:48     ` Matthew Wilcox
2018-04-03 15:12       ` Daniel Vetter
2018-04-04  9:32 ` Daniel Vetter
2018-04-04 14:39   ` Matthew Wilcox
2018-04-04 15:15     ` Daniel Vetter
2018-04-04 16:24       ` Matthew Wilcox
2018-04-04 17:45         ` Daniel Vetter

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=20180403134854.GA28565@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=chris@chris-wilson.co.uk \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jrdr.linux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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;
as well as URLs for NNTP newsgroup(s).