public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	Daniel Vetter <daniel@ffwll.ch>,
	intel-gfx <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915: Wait for completion of pending flips when starved of fences
Date: Mon, 20 Jan 2014 17:17:16 +0100	[thread overview]
Message-ID: <20140120161716.GI15089@phenom.ffwll.local> (raw)
In-Reply-To: <20140120104427.GE27650@nuc-i3427.alporthouse.com>

On Mon, Jan 20, 2014 at 10:44:27AM +0000, Chris Wilson wrote:
> On Mon, Jan 20, 2014 at 11:37:42AM +0100, Daniel Vetter wrote:
> > On Mon, Jan 20, 2014 at 09:49:24AM +0000, Chris Wilson wrote:
> > > On Sun, Jan 19, 2014 at 10:55:26PM +0100, Daniel Vetter wrote:
> > > > Also there's a certain chance we'll starve
> > > > the unpin work, similar to the issues around flushing the unpin work
> > > > in our pageflip implementation.
> > > 
> > > If you mean that we will never run the unpin workqueue, that's what the
> > > implementation will fix, eventually, after a busy-spin in userspace since
> > > set_need_resched() was removed. I can teach userspace to yield() after
> > > an EAGAIN which seems a reasonable compromise (userspace gets a bonus
> > > for being cooperative rather than penalized for using up its timeslice.)
> > 
> > yield won't help, we need to block on the work-queue draining like we do
> > in the pageflip code with flush_workqueue. At least we've had bug reports
> > in the past where someone found it intriguing to run his entire userspace
> > with rt prio, which ended up starving the sched_normal workqueue and so
> > livelocked the entire system.
> 
> But isn't that exactly the behaviour the RT user programmed?

Well userspace asked for pageflips and execbuffers and the kernel
delivered a deadlock. So not quite imo ;-)

I know it's a ridiculous corner-case but in general I think the kernel
should ensure that forward process of userspace requests happens and that
offloading things to workqueues is just an implementation details. Also,
epxlicit waits and locks have better debug instrumentation compared to
hand-rolled busy-loops.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

      reply	other threads:[~2014-01-20 16:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-19 21:20 [PATCH] drm/i915: Wait for completion of pending flips when starved of fences Chris Wilson
2014-01-19 21:55 ` Daniel Vetter
2014-01-20  9:49   ` Chris Wilson
2014-01-20 10:17     ` [PATCH 1/2] " Chris Wilson
2014-01-20 10:17       ` [PATCH 2/2] drm/i915: Repeat evictions whilst pageflip completions are outstanding Chris Wilson
2014-01-21 11:03         ` Bloomfield, Jon
2014-01-21 12:19           ` Daniel Vetter
2014-01-20 20:30       ` [PATCH 1/2] drm/i915: Wait for completion of pending flips when starved of fences Chris Wilson
2014-01-21  9:32         ` Daniel Vetter
2014-01-21  9:37           ` Chris Wilson
2014-01-21 11:03       ` Bloomfield, Jon
2014-01-20 10:37     ` [PATCH] " Daniel Vetter
2014-01-20 10:44       ` Chris Wilson
2014-01-20 16:17         ` Daniel Vetter [this message]

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=20140120161716.GI15089@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.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