dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <deathsimple@vodafone.de>
To: Grigori Goronzy <greg@chown.ath.cx>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/4] drm/radeon: use RCU query for GEM_BUSY syscall
Date: Fri, 03 Jul 2015 11:45:19 +0200	[thread overview]
Message-ID: <559659AF.2090501@vodafone.de> (raw)
In-Reply-To: <1435881253-4912-1-git-send-email-greg@chown.ath.cx>

On 03.07.2015 01:54, Grigori Goronzy wrote:
> We don't need to call the (expensive) radeon_bo_wait, checking the
> fences via RCU is much faster. The reservation done by radeon_bo_wait
> does not save us from any race conditions.
>
> Signed-off-by: Grigori Goronzy <greg@chown.ath.cx>

Patche #1-#3 are Reviewed-by: Christian König <christian.koenig@amd.com>

Patch #4 is a nice catch, but as Michel already noted needs more 
thoughts for a complete fix.

Regards,
Christian.

> ---
>   drivers/gpu/drm/radeon/radeon_gem.c | 11 ++++++++---
>   1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
> index ac3c131..7199e19 100644
> --- a/drivers/gpu/drm/radeon/radeon_gem.c
> +++ b/drivers/gpu/drm/radeon/radeon_gem.c
> @@ -428,7 +428,6 @@ int radeon_gem_mmap_ioctl(struct drm_device *dev, void *data,
>   int radeon_gem_busy_ioctl(struct drm_device *dev, void *data,
>   			  struct drm_file *filp)
>   {
> -	struct radeon_device *rdev = dev->dev_private;
>   	struct drm_radeon_gem_busy *args = data;
>   	struct drm_gem_object *gobj;
>   	struct radeon_bo *robj;
> @@ -440,10 +439,16 @@ int radeon_gem_busy_ioctl(struct drm_device *dev, void *data,
>   		return -ENOENT;
>   	}
>   	robj = gem_to_radeon_bo(gobj);
> -	r = radeon_bo_wait(robj, &cur_placement, true);
> +
> +	r = reservation_object_test_signaled_rcu(robj->tbo.resv, true);
> +	if (r == 0)
> +		r = -EBUSY;
> +	else
> +		r = 0;
> +
> +	cur_placement = ACCESS_ONCE(robj->tbo.mem.mem_type);
>   	args->domain = radeon_mem_type_to_domain(cur_placement);
>   	drm_gem_object_unreference_unlocked(gobj);
> -	r = radeon_gem_handle_lockup(rdev, r);
>   	return r;
>   }
>   

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2015-07-03  9:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-02 23:54 [PATCH 1/4] drm/radeon: use RCU query for GEM_BUSY syscall Grigori Goronzy
2015-07-02 23:54 ` [PATCH 2/4] drm/radeon: fix HDP flushing Grigori Goronzy
2015-07-02 23:54 ` [PATCH 3/4] drm/radeon: default to 2048 MB GART size on SI+ Grigori Goronzy
2015-07-02 23:54 ` [PATCH 4/4] drm/radeon: unpin cursor BOs before suspend Grigori Goronzy
2015-07-03  3:30   ` Michel Dänzer
2015-07-03  8:16     ` Grigori Goronzy
2015-07-03 10:01       ` Michel Dänzer
2015-07-03  9:45 ` Christian König [this message]
2015-07-06 21:14   ` [PATCH 1/4] drm/radeon: use RCU query for GEM_BUSY syscall Alex Deucher

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=559659AF.2090501@vodafone.de \
    --to=deathsimple@vodafone.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=greg@chown.ath.cx \
    /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