All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/i915: annote drop_caches debugfs interface with lockdep
Date: Mon, 13 Mar 2017 09:01:57 +0100	[thread overview]
Message-ID: <20170313080157.GF3343@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20170312205340.16202-1-daniel.vetter@ffwll.ch>

On Sun, Mar 12, 2017 at 09:53:40PM +0100, Daniel Vetter wrote:

> Peter/Ingo,
> 
> We want this to validate the i915 shrinker locking in our fast tests
> without thrashing badly (that takes too long, we can only thrash in
> the extended runs). Can you pls take a look and if it's ok ack for
> merging through drm-intel.git?

Hurm, I was going to rework all that soonish; have a look here:

 https://lkml.kernel.org/r/20170302134031.GG6536@twins.programming.kicks-ass.net

The immediate problem is that I made the annotation private to mm/
there, I suppose I could fix that.

> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 2 ++
>  kernel/locking/lockdep.c            | 2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 82fb005a5e22..fbe761a3f5bd 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -4273,6 +4273,7 @@ i915_drop_caches_set(void *data, u64 val)
>  	if (val & (DROP_RETIRE | DROP_ACTIVE))
>  		i915_gem_retire_requests(dev_priv);
>  
> +	lockdep_set_current_reclaim_state(GFP_KERNEL);
>  	if (val & DROP_BOUND)
>  		i915_gem_shrink(dev_priv, LONG_MAX, I915_SHRINK_BOUND);
>  
> @@ -4281,6 +4282,7 @@ i915_drop_caches_set(void *data, u64 val)
>  
>  	if (val & DROP_SHRINK_ALL)
>  		i915_gem_shrink_all(dev_priv);
> +	lockdep_clear_current_reclaim_state();
>  
>  unlock:
>  	mutex_unlock(&dev->struct_mutex);
> diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
> index 12e38c213b70..508cbf31d43e 100644
> --- a/kernel/locking/lockdep.c
> +++ b/kernel/locking/lockdep.c
> @@ -3856,11 +3856,13 @@ void lockdep_set_current_reclaim_state(gfp_t gfp_mask)
>  {
>  	current->lockdep_reclaim_gfp = gfp_mask;
>  }
> +EXPORT_SYMBOL_GPL(lockdep_set_current_reclaim_state);
>  
>  void lockdep_clear_current_reclaim_state(void)
>  {
>  	current->lockdep_reclaim_gfp = 0;
>  }
> +EXPORT_SYMBOL_GPL(lockdep_clear_current_reclaim_state);
>  
>  #ifdef CONFIG_LOCK_STAT
>  static int
> -- 
> 2.11.0
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

WARNING: multiple messages have this Message-ID (diff)
From: Peter Zijlstra <peterz@infradead.org>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Chris Wilson <chris@chris-wilson.co.uk>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH] drm/i915: annote drop_caches debugfs interface with lockdep
Date: Mon, 13 Mar 2017 09:01:57 +0100	[thread overview]
Message-ID: <20170313080157.GF3343@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20170312205340.16202-1-daniel.vetter@ffwll.ch>

On Sun, Mar 12, 2017 at 09:53:40PM +0100, Daniel Vetter wrote:

> Peter/Ingo,
> 
> We want this to validate the i915 shrinker locking in our fast tests
> without thrashing badly (that takes too long, we can only thrash in
> the extended runs). Can you pls take a look and if it's ok ack for
> merging through drm-intel.git?

Hurm, I was going to rework all that soonish; have a look here:

 https://lkml.kernel.org/r/20170302134031.GG6536@twins.programming.kicks-ass.net

The immediate problem is that I made the annotation private to mm/
there, I suppose I could fix that.

> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 2 ++
>  kernel/locking/lockdep.c            | 2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 82fb005a5e22..fbe761a3f5bd 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -4273,6 +4273,7 @@ i915_drop_caches_set(void *data, u64 val)
>  	if (val & (DROP_RETIRE | DROP_ACTIVE))
>  		i915_gem_retire_requests(dev_priv);
>  
> +	lockdep_set_current_reclaim_state(GFP_KERNEL);
>  	if (val & DROP_BOUND)
>  		i915_gem_shrink(dev_priv, LONG_MAX, I915_SHRINK_BOUND);
>  
> @@ -4281,6 +4282,7 @@ i915_drop_caches_set(void *data, u64 val)
>  
>  	if (val & DROP_SHRINK_ALL)
>  		i915_gem_shrink_all(dev_priv);
> +	lockdep_clear_current_reclaim_state();
>  
>  unlock:
>  	mutex_unlock(&dev->struct_mutex);
> diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
> index 12e38c213b70..508cbf31d43e 100644
> --- a/kernel/locking/lockdep.c
> +++ b/kernel/locking/lockdep.c
> @@ -3856,11 +3856,13 @@ void lockdep_set_current_reclaim_state(gfp_t gfp_mask)
>  {
>  	current->lockdep_reclaim_gfp = gfp_mask;
>  }
> +EXPORT_SYMBOL_GPL(lockdep_set_current_reclaim_state);
>  
>  void lockdep_clear_current_reclaim_state(void)
>  {
>  	current->lockdep_reclaim_gfp = 0;
>  }
> +EXPORT_SYMBOL_GPL(lockdep_clear_current_reclaim_state);
>  
>  #ifdef CONFIG_LOCK_STAT
>  static int
> -- 
> 2.11.0
> 

  reply	other threads:[~2017-03-13  8:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-12 19:27 [PATCH] drm/i915: annote drop_caches debugfs interface with lockdep Daniel Vetter
2017-03-12 19:27 ` Daniel Vetter
2017-03-12 19:47 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-03-12 19:57 ` [PATCH] " Chris Wilson
2017-03-12 20:53 ` Daniel Vetter
2017-03-12 20:53   ` Daniel Vetter
2017-03-13  8:01   ` Peter Zijlstra [this message]
2017-03-13  8:01     ` Peter Zijlstra
2017-03-13  8:15     ` Daniel Vetter
2017-03-13  8:15       ` Daniel Vetter
2017-03-13  8:30       ` Peter Zijlstra
2017-03-13  8:30         ` Peter Zijlstra
2017-03-14  9:10         ` Daniel Vetter
2017-03-14  9:10           ` [Intel-gfx] " Daniel Vetter
2017-03-12 21:18 ` ✗ Fi.CI.BAT: warning for drm/i915: annote drop_caches debugfs interface with lockdep (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=20170313080157.GF3343@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    /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.