From: Daniel Vetter <daniel@ffwll.ch>
To: Matthew Wilcox <willy@infradead.org>
Cc: Thomas Hellstrom <thomas@shipmail.org>,
Chris Wilson <chris@chris-wilson.co.uk>,
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 17:12:20 +0200 [thread overview]
Message-ID: <20180403151220.GW3881@phenom.ffwll.local> (raw)
In-Reply-To: <20180403144829.GB28565@bombadil.infradead.org>
On Tue, Apr 03, 2018 at 07:48:29AM -0700, Matthew Wilcox wrote:
> On Tue, Apr 03, 2018 at 03:12:35PM +0200, Thomas Hellstrom wrote:
> > I think the TTM page fault handler originally set the standard for this.
> > First, IMO any critical section that waits for the GPU (like typically the
> > page fault handler does), should be locked at least killable. The need for
> > interruptible locks came from the X server's silken mouse relying on signals
> > for smooth mouse operations: You didn't want the X server to be stuck in the
> > kernel waiting for GPU completion when it should handle the cursor move
> > request.. Now that doesn't seem to be the case anymore but to reiterate
> > Chris' question, why would the signal persist once returned to user-space?
>
> Yeah, you graphics people have had to deal with much more recalcitrant
> hardware than most of the rest of us ... and less reasonable user
> expectations ("My graphics card was doing something and I expected
> everything else to keep going" vs "My hard drive died and my kernel
> paniced, oh well.")
>
> I don't know exactly how the signal code works at the delivery end;
> I'm not sure when TIF_SIGPENDING gets cleared. I just get concerned
> when I see one bit of kernel code doing things in a very complicated
> and careful manner and another bit of kernel code blithely assuming
> that everything's going to be OK.
I think you last line pretty much sums up the proper attitude when writing
gpu drivers:
https://i.imgflip.com/27nm7w.jpg
Cheers, Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
next prev parent reply other threads:[~2018-04-03 15:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-02 14:10 Matthew Wilcox
2018-04-03 12:33 ` Chris Wilson
2018-04-03 13:10 ` Matthew Wilcox
2018-04-03 13:20 ` Chris Wilson
2018-04-03 13:48 ` Matthew Wilcox
2018-04-03 13:12 ` Thomas Hellstrom
2018-04-03 14:48 ` Matthew Wilcox
2018-04-03 15:12 ` Daniel Vetter [this message]
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=20180403151220.GW3881@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--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 \
--cc=thomas@shipmail.org \
--cc=willy@infradead.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