diff mbox

[3/3] drm/i915: Memory node free handling on truncation of stolen obj

Message ID 1394186367-20339-4-git-send-email-sourab.gupta@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

sourab.gupta@intel.com March 7, 2014, 9:59 a.m. UTC
From: Sourab Gupta <sourab.gupta@intel.com>

While we are freeing the purgeable stolen object, the memory node has
to be freed so as to make space for the new object.

Signed-off-by: Sourab Gupta <sourab.gupta@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_stolen.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Chris Wilson March 7, 2014, 10:02 a.m. UTC | #1
On Fri, Mar 07, 2014 at 03:29:27PM +0530, sourab.gupta@intel.com wrote:
> From: Sourab Gupta <sourab.gupta@intel.com>
> 
> While we are freeing the purgeable stolen object, the memory node has
> to be freed so as to make space for the new object.
> 

The node has already been removed from the stolen mm, so this should be
triggering a WARN.
-Chris
sourab.gupta@intel.com March 7, 2014, 10:50 a.m. UTC | #2
Hi Chris,

Not able to locate where the node is removed. I looked primarily around the put_pages function but
the node doesn't seem to be removed there. Can you please let us know where the node is removed

Regards,
Sourab

-----Original Message-----
From: Chris Wilson [mailto:chris@chris-wilson.co.uk] 
Sent: Friday, March 07, 2014 3:32 PM
To: Gupta, Sourab
Cc: intel-gfx@lists.freedesktop.org; Vetter, Daniel; Wilson, Chris
Subject: Re: [Intel-gfx] [PATCH 3/3] drm/i915: Memory node free handling on truncation of stolen obj

On Fri, Mar 07, 2014 at 03:29:27PM +0530, sourab.gupta@intel.com wrote:
> From: Sourab Gupta <sourab.gupta@intel.com>
> 
> While we are freeing the purgeable stolen object, the memory node has 
> to be freed so as to make space for the new object.
> 

The node has already been removed from the stolen mm, so this should be triggering a WARN.
-Chris

--
Chris Wilson, Intel Open Source Technology Centre
Chris Wilson March 7, 2014, 11:05 a.m. UTC | #3
On Fri, Mar 07, 2014 at 10:50:00AM +0000, Gupta, Sourab wrote:
> Hi Chris,
> 
> Not able to locate where the node is removed. I looked primarily around the put_pages function but
> the node doesn't seem to be removed there. Can you please let us know where the node is removed

My mistake, I thought it would be removed by drm_mm_scan_remove_block().
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
index d092bf3..ae12074 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -411,10 +411,8 @@  found:
 
 			ret = i915_gem_object_put_pages(obj);
 			if (ret == 0) {
+				i915_gem_object_release_stolen(obj);
 				obj->madv = __I915_MADV_PURGED;
-
-				kfree(obj->stolen);
-				obj->stolen = NULL;
 			} else
 				i915_gem_object_pin_pages(obj);
 		}