From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Widawsky Subject: Re: [PATCH 3/5] drm/i915: Remove node only when allocated Date: Mon, 12 Aug 2013 18:37:56 -0700 Message-ID: <20130813013756.GA19697@bwidawsk.net> References: <1376111536-12461-1-git-send-email-benjamin.widawsky@intel.com> <1376111536-12461-3-git-send-email-benjamin.widawsky@intel.com> <20130810084505.GD3561@cantiga.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail.bwidawsk.net (bwidawsk.net [166.78.191.112]) by gabe.freedesktop.org (Postfix) with ESMTP id B3614E73F4 for ; Mon, 12 Aug 2013 18:38:00 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20130810084505.GD3561@cantiga.alporthouse.com> 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: Chris Wilson , Ben Widawsky , Intel GFX List-Id: intel-gfx@lists.freedesktop.org On Sat, Aug 10, 2013 at 09:45:05AM +0100, Chris Wilson wrote: > On Fri, Aug 09, 2013 at 10:12:14PM -0700, Ben Widawsky wrote: > > In upcoming code, it will be possible for a vma to have been created, > > but no space reserved for it in the address space. The drm_mm semantics > > are such that trying to remove an unallocated node is not allowed. > > But not allocated during unbind, i.e. calling unbind() before bind()? > That seems scary enough. > -Chris > The condition can occur if we create a vma, fail to bind it, and then free up the object (which tries to unbind). As I alluded to, this cannot happen until we do the execbufer vma creation. The example for which is can happen is if we have some object created, with a vma AFAICT, this condition cannot occur until we actually are using multiple VMs, but once we are the following can occur: object X created for context Y VMA-Y created for object X VMA-Z created for object X, but fails before or during bind VMA-Z persists object X destroyed free calls unbind on all VMAs. VMA-Z has no node allocated for it. One way to may this better is to not call unbind() if it isn't allocated, and simply call vma_destroy(). I don't really care. You tell me what you want. -- Ben Widawsky, Intel Open Source Technology Center