From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm: Use a normal idr allocation for the obj->name
Date: Mon, 4 Jan 2016 17:31:14 +0200 [thread overview]
Message-ID: <20160104153114.GZ4437@intel.com> (raw)
In-Reply-To: <1451902261-25380-3-git-send-email-chris@chris-wilson.co.uk>
On Mon, Jan 04, 2016 at 10:11:01AM +0000, Chris Wilson wrote:
> Unlike the handle, the name table uses a sleeping mutex rather than a
> spinlock. The allocation is in a normal context, and we can use the
> simpler sleeping gfp_t, rather than have to take from the atomic
> reserves.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/drm_gem.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
> index ad955d7c99fd..1b0c2c127072 100644
> --- a/drivers/gpu/drm/drm_gem.c
> +++ b/drivers/gpu/drm/drm_gem.c
> @@ -642,7 +642,6 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,
> return -ENOENT;
>
> mutex_lock(&dev->object_name_lock);
> - idr_preload(GFP_KERNEL);
> /* prevent races with concurrent gem_close. */
> if (obj->handle_count == 0) {
> ret = -ENOENT;
> @@ -650,7 +649,7 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,
> }
>
> if (!obj->name) {
> - ret = idr_alloc(&dev->object_name_idr, obj, 1, 0, GFP_NOWAIT);
> + ret = idr_alloc(&dev->object_name_idr, obj, 1, 0, GFP_KERNEL);
> if (ret < 0)
> goto err;
>
> @@ -661,7 +660,6 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,
> ret = 0;
>
> err:
> - idr_preload_end();
> mutex_unlock(&dev->object_name_lock);
> drm_gem_object_unreference_unlocked(obj);
> return ret;
> --
> 2.6.4
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2016-01-04 15:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-04 10:10 [PATCH 1/3] drm: Balance error path for GEM handle allocation Chris Wilson
2016-01-04 10:11 ` [PATCH 2/3] drm: Only bump object-reference count when adding first handle Chris Wilson
2016-01-04 15:29 ` Ville Syrjälä
2016-01-04 10:11 ` [PATCH 3/3] drm: Use a normal idr allocation for the obj->name Chris Wilson
2016-01-04 15:31 ` Ville Syrjälä [this message]
2016-01-05 8:00 ` Daniel Vetter
2016-01-04 10:18 ` [PATCH 1/3] drm: Balance error path for GEM handle allocation Chris Wilson
2016-01-04 15:33 ` Ville Syrjälä
2016-01-04 15:37 ` Chris Wilson
2016-01-04 10:49 ` ✗ failure: Fi.CI.BAT Patchwork
2016-01-04 15:24 ` [PATCH 1/3] drm: Balance error path for GEM handle allocation Ville Syrjälä
2016-01-04 15:37 ` Ville Syrjälä
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=20160104153114.GZ4437@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=dri-devel@lists.freedesktop.org \
--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