All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: VM eviction only targets address space not physical pages
@ 2014-01-28 18:08 Chris Wilson
  2014-01-29 20:06 ` Ben Widawsky
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2014-01-28 18:08 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter, Ben Widawsky

During eviction, we are only considering how to free up space within the
current address space and not concerned with freeing up physical memory.
As such we need only skip nodes that pinned in the current VM and not
globally.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Ben Widawsky <benjamin.widawsky@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_evict.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c
index 525b242ac512..a745966b7e16 100644
--- a/drivers/gpu/drm/i915/i915_gem_evict.c
+++ b/drivers/gpu/drm/i915/i915_gem_evict.c
@@ -36,8 +36,7 @@
 static bool
 mark_free(struct i915_vma *vma, struct list_head *unwind)
 {
-	/* Freeing up memory requires no VMAs are pinned */
-	if (i915_gem_obj_is_pinned(vma->obj))
+	if (vma->pin_count)
 		return false;
 
 	if (WARN_ON(!list_empty(&vma->exec_list)))
-- 
1.8.5.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: VM eviction only targets address space not physical pages
  2014-01-28 18:08 [PATCH] drm/i915: VM eviction only targets address space not physical pages Chris Wilson
@ 2014-01-29 20:06 ` Ben Widawsky
  2014-01-29 21:19   ` Daniel Vetter
  2014-01-29 21:55   ` Chris Wilson
  0 siblings, 2 replies; 4+ messages in thread
From: Ben Widawsky @ 2014-01-29 20:06 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Daniel Vetter, intel-gfx

On Tue, Jan 28, 2014 at 06:08:38PM +0000, Chris Wilson wrote:
> During eviction, we are only considering how to free up space within the
> current address space and not concerned with freeing up physical memory.
> As such we need only skip nodes that pinned in the current VM and not
> globally.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Ben Widawsky <benjamin.widawsky@intel.com>

Can you rename i915_gem_evict_something() or add a comment at the top
that the function is not used by the shrinker, and is for evicting a VM?

The comment we currently have in the function doesn't suggest this at
all.

Reviewed-by: Ben Widawsky <ben@bwidawsk.net>

> ---
>  drivers/gpu/drm/i915/i915_gem_evict.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c
> index 525b242ac512..a745966b7e16 100644
> --- a/drivers/gpu/drm/i915/i915_gem_evict.c
> +++ b/drivers/gpu/drm/i915/i915_gem_evict.c
> @@ -36,8 +36,7 @@
>  static bool
>  mark_free(struct i915_vma *vma, struct list_head *unwind)
>  {
> -	/* Freeing up memory requires no VMAs are pinned */
> -	if (i915_gem_obj_is_pinned(vma->obj))
> +	if (vma->pin_count)
>  		return false;
>  
>  	if (WARN_ON(!list_empty(&vma->exec_list)))
> -- 
> 1.8.5.3
> 

-- 
Ben Widawsky, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: VM eviction only targets address space not physical pages
  2014-01-29 20:06 ` Ben Widawsky
@ 2014-01-29 21:19   ` Daniel Vetter
  2014-01-29 21:55   ` Chris Wilson
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2014-01-29 21:19 UTC (permalink / raw)
  To: Ben Widawsky; +Cc: Daniel Vetter, intel-gfx

On Wed, Jan 29, 2014 at 12:06:36PM -0800, Ben Widawsky wrote:
> On Tue, Jan 28, 2014 at 06:08:38PM +0000, Chris Wilson wrote:
> > During eviction, we are only considering how to free up space within the
> > current address space and not concerned with freeing up physical memory.
> > As such we need only skip nodes that pinned in the current VM and not
> > globally.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Cc: Ben Widawsky <benjamin.widawsky@intel.com>
> 
> Can you rename i915_gem_evict_something() or add a comment at the top
> that the function is not used by the shrinker, and is for evicting a VM?
> 
> The comment we currently have in the function doesn't suggest this at
> all.

I'll do a general kerneldoc cleanup for i915_gem_evict.c as a separate
patch.

> Reviewed-by: Ben Widawsky <ben@bwidawsk.net>

Queued for -next, thanks for the patch.
-Daniel
> 
> > ---
> >  drivers/gpu/drm/i915/i915_gem_evict.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c
> > index 525b242ac512..a745966b7e16 100644
> > --- a/drivers/gpu/drm/i915/i915_gem_evict.c
> > +++ b/drivers/gpu/drm/i915/i915_gem_evict.c
> > @@ -36,8 +36,7 @@
> >  static bool
> >  mark_free(struct i915_vma *vma, struct list_head *unwind)
> >  {
> > -	/* Freeing up memory requires no VMAs are pinned */
> > -	if (i915_gem_obj_is_pinned(vma->obj))
> > +	if (vma->pin_count)
> >  		return false;
> >  
> >  	if (WARN_ON(!list_empty(&vma->exec_list)))
> > -- 
> > 1.8.5.3
> > 
> 
> -- 
> Ben Widawsky, Intel Open Source Technology Center

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: VM eviction only targets address space not physical pages
  2014-01-29 20:06 ` Ben Widawsky
  2014-01-29 21:19   ` Daniel Vetter
@ 2014-01-29 21:55   ` Chris Wilson
  1 sibling, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2014-01-29 21:55 UTC (permalink / raw)
  To: Ben Widawsky; +Cc: Daniel Vetter, intel-gfx

On Wed, Jan 29, 2014 at 12:06:36PM -0800, Ben Widawsky wrote:
> On Tue, Jan 28, 2014 at 06:08:38PM +0000, Chris Wilson wrote:
> > During eviction, we are only considering how to free up space within the
> > current address space and not concerned with freeing up physical memory.
> > As such we need only skip nodes that pinned in the current VM and not
> > globally.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Cc: Ben Widawsky <benjamin.widawsky@intel.com>
> 
> Can you rename i915_gem_evict_something() or add a comment at the top
> that the function is not used by the shrinker, and is for evicting a VM?

purge is shrinker freeing up objects for physical pages
evict is eviction freeing up objects for address space

That shrink_all calls evict_everything is just a matter of convenience.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-01-29 21:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-28 18:08 [PATCH] drm/i915: VM eviction only targets address space not physical pages Chris Wilson
2014-01-29 20:06 ` Ben Widawsky
2014-01-29 21:19   ` Daniel Vetter
2014-01-29 21:55   ` Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.