All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <deathsimple@vodafone.de>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 13/13] drm/radeon: rework recursive gpu reset handling
Date: Fri, 20 Apr 2012 11:38:23 +0200	[thread overview]
Message-ID: <4F912E8F.4020807@vodafone.de> (raw)
In-Reply-To: <20120420075052.GD4217@phenom.ffwll.local>

On 20.04.2012 09:50, Daniel Vetter wrote:
> On Fri, Apr 20, 2012 at 07:57:09AM +0100, Dave Airlie wrote:
>> 2012/4/19 Christian König<deathsimple@vodafone.de>:
>>> Instead of all this humpy pumpy with recursive
>>> mutex (which also fixes only halve of the problem)
>>> move the actual gpu reset out of the fence code,
>>> return -EDEADLK and then reset the gpu in the
>>> calling ioctl function.
>> I'm trying to figure out if this has any disadvantages over doing what
>> I proposed before and just kicking a thread to reset the gpu.
>>
>> It seems like this should also avoid the locking problems, I'd like to
>> make sure we don't return -EDEADLK to userspace by accident anywhere,
>> since I don't think it prepared for it and it would be an ABI change.
> Fyi, the trick i915 uses to solve the reset problem is to bail out with
> -EAGAIN and rely on drmIOCtl restarting the ioctl. This way we use the
> same codepaths we use to bail out when getting a signal, and thanks to X
> these are rather well-tested. The hangcheck code also fires of a work item to
> do all the reset magic. In all the ioctls that might wait for the gpu we
> have a fancy piece of code which checks whether a gpu reset is pending,
> and if so waits for that to complete. It also checks whether the reset
> succeeded and if not bails out with -EIO.
> -Daniel
Well I considered using an asynchronous work item also, but didn't know 
how to probably prevent multiple GPU resets at the same time, signaling 
the result back to the ioctls, etc.. It just seemed to be more 
complicated without any real benefit (maybe except that you don't have 
to check every ioctl result separately, but there are not so many).

Also I didn't know what to tell userspace to retry the current 
operation, but if it's already prepared for -EAGAIN than this sounds 
like the proper solution here.

And regarding returning -EDEADLK to userspace: I think I handle every 
ioctl that could cause the lockup detection to run, but checking that 
again won't hurt.

Christian.

  reply	other threads:[~2012-04-20  9:38 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-19 22:39 Reworking of GPU reset logic Christian König
2012-04-19 22:39 ` [PATCH 01/13] drm/radeon: make radeon_gpu_is_lockup a per ring function Christian König
2012-04-19 22:39 ` [PATCH 02/13] drm/radeon: replace gpu_lockup with ring->ready flag Christian König
2012-04-19 22:39 ` [PATCH 03/13] drm/radeon: register ring debugfs handlers on init Christian König
2012-04-19 22:39 ` [PATCH 04/13] drm/radeon: use central function for IB testing Christian König
2012-04-19 22:39 ` [PATCH 05/13] drm/radeon: rework gpu lockup detection and processing Christian König
2012-04-19 22:39 ` [PATCH 06/13] drm/radeon: improve sub allocator Christian König
2012-04-20  7:24   ` Michel Dänzer
2012-04-20  9:11     ` Christian König
2012-04-19 22:39 ` [PATCH 07/13] drm/radeon: add sub allocator debugfs file Christian König
2012-04-19 22:39 ` [PATCH 08/13] drm/radeon: add biggest hole tracking and wakequeue to the sa Christian König
2012-04-19 22:39 ` [PATCH 09/13] drm/radeon: simplify semaphore handling Christian König
2012-04-19 22:39 ` [PATCH 10/13] drm/radeon: return -ENOENT in fence_wait_* Christian König
2012-04-20  7:20   ` Michel Dänzer
2012-04-20  8:49     ` Christian König
2012-04-20  9:15       ` Michel Dänzer
2012-04-20 10:24         ` Christian König
2012-04-20 11:30           ` Michel Dänzer
2012-04-19 22:39 ` [PATCH 11/13] drm/radeon: rip out the ib pool Christian König
2012-04-19 22:39 ` [PATCH 12/13] drm/radeon: fix a bug with the ring syncing code Christian König
2012-04-24 14:04   ` Dave Airlie
2012-04-24 14:23     ` Christian König
2012-04-19 22:39 ` [PATCH 13/13] drm/radeon: rework recursive gpu reset handling Christian König
2012-04-20  6:57   ` Dave Airlie
2012-04-20  7:50     ` Daniel Vetter
2012-04-20  9:38       ` Christian König [this message]
2012-04-19 23:47 ` Reworking of GPU reset logic Jerome Glisse
2012-04-21  9:42   ` Christian König
2012-04-21 14:14     ` Jerome Glisse
2012-04-25 13:01       ` Christian König
2012-04-25 13:30         ` Dave Airlie
2012-04-25 13:46           ` Alex Deucher
2012-04-25 14:26             ` Jerome Glisse
2012-04-23  7:40     ` Michel Dänzer
2012-04-25 12:50       ` Christian König

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=4F912E8F.4020807@vodafone.de \
    --to=deathsimple@vodafone.de \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.