intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 2/6] drm/i915/gem: Almagamate clflushes on freeze
Date: Sat, 23 Jan 2021 06:46:33 -0800	[thread overview]
Message-ID: <20210123144633.GA88631@roeck-us.net> (raw)
In-Reply-To: <20210119144912.12653-2-chris@chris-wilson.co.uk>

On Tue, Jan 19, 2021 at 02:49:08PM +0000, Chris Wilson wrote:
> When flushing objects larger than the CPU cache it is preferrable to use
> a single wbinvd() rather than overlapping clflush(). At runtime, we
> avoid wbinvd() due to its system-wide latencies, but during
> singlethreaded suspend, no one will observe the imposed latency and we
> can opt for the faster wbinvd to clear all objects in a single hit.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gem.c | 16 +++++-----------
>  1 file changed, 5 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index c013148835e6..d3a287bf56c5 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -1175,19 +1175,13 @@ int i915_gem_freeze_late(struct drm_i915_private *i915)
>  	 * the objects as well, see i915_gem_freeze()
>  	 */
>  
> -	wakeref = intel_runtime_pm_get(&i915->runtime_pm);
> -
> -	i915_gem_shrink(i915, -1UL, NULL, ~0);
> +	with_intel_runtime_pm(&i915->runtime_pm, wakeref)
> +		i915_gem_shrink(i915, -1UL, NULL, ~0);
>  	i915_gem_drain_freed_objects(i915);
>  
> -	list_for_each_entry(obj, &i915->mm.shrink_list, mm.link) {
> -		i915_gem_object_lock(obj, NULL);
> -		drm_WARN_ON(&i915->drm,
> -			    i915_gem_object_set_to_cpu_domain(obj, true));
> -		i915_gem_object_unlock(obj);
> -	}
> -
> -	intel_runtime_pm_put(&i915->runtime_pm, wakeref);
> +	wbinvd_on_all_cpus();

with CONFIG_SMP=n, this results in:

drivers/gpu/drm/i915/i915_gem.c: In function 'i915_gem_freeze_late':
drivers/gpu/drm/i915/i915_gem.c:1182:2: error: implicit declaration of function 'wbinvd_on_all_cpus'

Other drivers calling this function include <asm/smp.h>.

Guenter

> +	list_for_each_entry(obj, &i915->mm.shrink_list, mm.link)
> +		__start_cpu_write(obj);
>  
>  	return 0;
>  }
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2021-01-23 14:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-19 14:49 [Intel-gfx] [PATCH 1/6] drm/i915/gem: Almagamate clflushes on suspend Chris Wilson
2021-01-19 14:49 ` [Intel-gfx] [PATCH 2/6] drm/i915/gem: Almagamate clflushes on freeze Chris Wilson
2021-01-19 15:34   ` Matthew Auld
2021-01-23 14:46   ` Guenter Roeck [this message]
2021-01-23 14:53     ` Chris Wilson
2021-01-19 14:49 ` [Intel-gfx] [PATCH 3/6] drm/i915/gem: Move stolen node into GEM object union Chris Wilson
2021-01-19 15:40   ` Matthew Auld
2021-01-19 14:49 ` [Intel-gfx] [PATCH 4/6] drm/i915/gem: Use shrinkable status for unknown swizzle quirks Chris Wilson
2021-01-19 16:13   ` Matthew Auld
2021-01-19 14:49 ` [Intel-gfx] [PATCH 5/6] drm/i915/gem: Make i915_gem_object_flush_write_domain() static Chris Wilson
2021-01-19 16:16   ` Matthew Auld
2021-01-19 14:49 ` [Intel-gfx] [PATCH 6/6] drm/i915/gem: Drop lru bumping on display unpinning Chris Wilson
2021-01-19 16:38   ` Matthew Auld
2021-01-19 17:02     ` Chris Wilson
2021-01-19 17:14       ` Matthew Auld
2021-01-19 15:30 ` [Intel-gfx] [PATCH 1/6] drm/i915/gem: Almagamate clflushes on suspend Matthew Auld
2021-01-19 15:37   ` Chris Wilson
2021-01-19 17:26 ` Matthew Auld
2021-01-19 21:50 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for series starting with [1/6] drm/i915/gem: Almagamate clflushes on suspend (rev2) Patchwork

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=20210123144633.GA88631@roeck-us.net \
    --to=linux@roeck-us.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).