All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 3/3] drm/i915/shrinker: Only shmemfs objects are backed by swap
Date: Wed, 20 Apr 2016 15:07:52 +0300	[thread overview]
Message-ID: <1461154072.8815.12.camel@linux.intel.com> (raw)
In-Reply-To: <1461150294-14123-3-git-send-email-chris@chris-wilson.co.uk>

On ke, 2016-04-20 at 12:04 +0100, Chris Wilson wrote:
> Since we can only swap out shmemfs objects, those are the only ones that
> influence the ability of the shrinker to can free pages. Currently, all
> non-shmemfs objects have a raised pages_pin_count to protect them from
> the shrinker, so this just makes the logic for can_release_pages()
> clearer (and safer in future so that we don't over estimate our ability
> to free up pages from future non-swappable objects).
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/i915_gem_shrinker.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_shrinker.c b/drivers/gpu/drm/i915/i915_gem_shrinker.c
> index cb225e039d48..e44c6358bd5a 100644
> --- a/drivers/gpu/drm/i915/i915_gem_shrinker.c
> +++ b/drivers/gpu/drm/i915/i915_gem_shrinker.c
> @@ -70,6 +70,10 @@ static bool swap_available(void)
>  
>  static bool can_release_pages(struct drm_i915_gem_object *obj)
>  {
> +	/* Only shmemfs objects are backed by swapped */
> +	if (!obj->base.filp)
> +		return false;
> +
>  	/* Only report true if by unbinding the object and putting its pages
>  	 * we can actually make forward progress towards freeing physical
>  	 * pages.
> @@ -349,18 +353,12 @@ i915_gem_shrinker_oom(struct notifier_block *nb, unsigned long event, void *ptr)
>  	 */
>  	unbound = bound = unevictable = 0;
>  	list_for_each_entry(obj, &dev_priv->mm.unbound_list, global_list) {
> -		if (!obj->base.filp) /* not backed by a freeable object */
> -			continue;
> -
>  		if (!can_release_pages(obj))
>  			unevictable += obj->base.size >> PAGE_SHIFT;
>  		else
>  			unbound += obj->base.size >> PAGE_SHIFT;
>  	}
>  	list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) {
> -		if (!obj->base.filp)
> -			continue;
> -
>  		if (!can_release_pages(obj))
>  			unevictable += obj->base.size >> PAGE_SHIFT;
>  		else
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-04-20 12:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-20  7:43 [PATCH] drm/i915/shrinker: Only report objects with extra pinned pages as pinned Chris Wilson
2016-04-20  8:24 ` ✗ Fi.CI.BAT: failure for " Patchwork
2016-04-20  8:56 ` [PATCH] " Joonas Lahtinen
2016-04-20 11:04   ` [PATCH v2 1/3] " Chris Wilson
2016-04-20 11:04     ` [PATCH v2 2/3] drm/i915/shrinker: Report "unevictable" pages Chris Wilson
2016-04-20 12:02       ` Joonas Lahtinen
2016-04-20 11:04     ` [PATCH v2 3/3] drm/i915/shrinker: Only shmemfs objects are backed by swap Chris Wilson
2016-04-20 12:07       ` Joonas Lahtinen [this message]
2016-04-20  9:03 ` ✓ Fi.CI.BAT: success for drm/i915/shrinker: Only report objects with extra pinned pages as pinned Patchwork
2016-04-20 10:23 ` Patchwork
2016-04-20 11:09 [PATCH v2 1/3] " Chris Wilson
2016-04-20 11:09 ` [PATCH v2 3/3] drm/i915/shrinker: Only shmemfs objects are backed by swap Chris Wilson
2016-04-20 11:54   ` Mika Kuoppala

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=1461154072.8815.12.camel@linux.intel.com \
    --to=joonas.lahtinen@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --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 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.