From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 11/29] drm/i915: BUG_ON put_pages later Date: Mon, 5 Aug 2013 11:42:45 +0200 Message-ID: <20130805094245.GH22035@phenom.ffwll.local> References: <1375315222-4785-1-git-send-email-ben@bwidawsk.net> <1375315222-4785-12-git-send-email-ben@bwidawsk.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by gabe.freedesktop.org (Postfix) with ESMTP id C6275E5FBE for ; Mon, 5 Aug 2013 02:42:38 -0700 (PDT) Received: by mail-wi0-f170.google.com with SMTP id hi8so1304515wib.5 for ; Mon, 05 Aug 2013 02:42:37 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1375315222-4785-12-git-send-email-ben@bwidawsk.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Ben Widawsky Cc: Intel GFX List-Id: intel-gfx@lists.freedesktop.org On Wed, Jul 31, 2013 at 05:00:04PM -0700, Ben Widawsky wrote: > With multiple VMs, the eviction code benefits from being able to blindly > put pages without needing to know if there are any entities still > holding on to those pages. As such it's preferable to return the -EBUSY > before the BUG. > > Eviction code is the only user for now, but overall it makes sense > anyway, IMO. > > Signed-off-by: Ben Widawsky > --- > drivers/gpu/drm/i915/i915_gem.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c > index adb0a18..dbf72d5 100644 > --- a/drivers/gpu/drm/i915/i915_gem.c > +++ b/drivers/gpu/drm/i915/i915_gem.c > @@ -1654,11 +1654,11 @@ i915_gem_object_put_pages(struct drm_i915_gem_object *obj) > if (obj->pages == NULL) > return 0; > > - BUG_ON(i915_gem_obj_ggtt_bound(obj)); > - > if (obj->pages_pin_count) > return -EBUSY; > > + BUG_ON(i915_gem_obj_ggtt_bound(obj)); Hm, shouldn't this be a bound_any eventually? Again I'm too layz to check the end result, just noting my thoughs here ;-) -Daniel > + > /* ->put_pages might need to allocate memory for the bit17 swizzle > * array, hence protect them from being reaped by removing them from gtt > * lists early. */ > -- > 1.8.3.4 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch