* [PATCH] drm/i915: annote drop_caches debugfs interface with lockdep
@ 2017-03-12 19:27 Daniel Vetter
2017-03-12 19:47 ` ✓ Fi.CI.BAT: success for " Patchwork
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Daniel Vetter @ 2017-03-12 19:27 UTC (permalink / raw)
To: Intel Graphics Development
Cc: Peter Zijlstra, Daniel Vetter, linux-kernel, Ingo Molnar,
Daniel Vetter
The trouble we have is that we can't really test all the shrinker
recursion stuff exhaustively in BAT because any kind of thrashing
stress test just takes too long.
But that leaves a really big gap open, since shrinker recursions are
one of the most annoying bugs. Now lockdep already has support for
checking allocation deadlocks:
- Direct reclaim paths are marked up with
lockdep_set_current_reclaim_state() and
lockdep_clear_current_reclaim_state().
- Any allocation paths are marked with lockdep_trace_alloc().
If we simply mark up our debugfs with the reclaim annotations, any
code and locks taken in there will automatically complete the picture
with any allocation paths we already have, as long as we have a simple
testcase in BAT which throws out a few objects using this interface.
Not stress test or thrashing needed at all.
v2: Need to EXPORT_SYMBOL_GPL to make it compile as a module.
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: linux-kernel@vger.kernel.org
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> (v1)
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
--
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?
Thanks, Daniel
---
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..0f1d6c4a212b 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -4273,11 +4273,13 @@ 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);
if (val & DROP_UNBOUND)
i915_gem_shrink(dev_priv, LONG_MAX, I915_SHRINK_UNBOUND);
+ lockdep_clear_current_reclaim_state();
if (val & DROP_SHRINK_ALL)
i915_gem_shrink_all(dev_priv);
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
^ permalink raw reply related [flat|nested] 9+ messages in thread
* ✓ Fi.CI.BAT: success for drm/i915: annote drop_caches debugfs interface with lockdep
2017-03-12 19:27 [PATCH] drm/i915: annote drop_caches debugfs interface with lockdep Daniel Vetter
@ 2017-03-12 19:47 ` Patchwork
2017-03-12 19:57 ` [PATCH] " Chris Wilson
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2017-03-12 19:47 UTC (permalink / raw)
To: Daniel Vetter; +Cc: intel-gfx
== Series Details ==
Series: drm/i915: annote drop_caches debugfs interface with lockdep
URL : https://patchwork.freedesktop.org/series/21114/
State : success
== Summary ==
Series 21114v1 drm/i915: annote drop_caches debugfs interface with lockdep
https://patchwork.freedesktop.org/api/1.0/series/21114/revisions/1/mbox/
Test kms_force_connector_basic:
Subgroup prune-stale-modes:
skip -> PASS (fi-snb-2520m)
fi-bdw-5557u total:278 pass:267 dwarn:0 dfail:0 fail:0 skip:11 time: 465s
fi-bsw-n3050 total:278 pass:239 dwarn:0 dfail:0 fail:0 skip:39 time: 614s
fi-bxt-j4205 total:278 pass:259 dwarn:0 dfail:0 fail:0 skip:19 time: 532s
fi-bxt-t5700 total:278 pass:258 dwarn:0 dfail:0 fail:0 skip:20 time: 585s
fi-byt-j1900 total:278 pass:251 dwarn:0 dfail:0 fail:0 skip:27 time: 503s
fi-byt-n2820 total:278 pass:247 dwarn:0 dfail:0 fail:0 skip:31 time: 501s
fi-hsw-4770 total:278 pass:262 dwarn:0 dfail:0 fail:0 skip:16 time: 436s
fi-hsw-4770r total:278 pass:262 dwarn:0 dfail:0 fail:0 skip:16 time: 436s
fi-ilk-650 total:278 pass:228 dwarn:0 dfail:0 fail:0 skip:50 time: 443s
fi-ivb-3520m total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time: 506s
fi-ivb-3770 total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time: 495s
fi-kbl-7500u total:278 pass:259 dwarn:1 dfail:0 fail:0 skip:18 time: 479s
fi-skl-6260u total:278 pass:268 dwarn:0 dfail:0 fail:0 skip:10 time: 507s
fi-skl-6700hq total:278 pass:261 dwarn:0 dfail:0 fail:0 skip:17 time: 591s
fi-skl-6700k total:278 pass:256 dwarn:4 dfail:0 fail:0 skip:18 time: 501s
fi-skl-6770hq total:278 pass:268 dwarn:0 dfail:0 fail:0 skip:10 time: 540s
fi-snb-2520m total:278 pass:250 dwarn:0 dfail:0 fail:0 skip:28 time: 550s
fi-snb-2600 total:278 pass:249 dwarn:0 dfail:0 fail:0 skip:29 time: 426s
2cb12884655eab41d4992b33ccb36c609c4537d3 drm-tip: 2017y-03m-12d-13h-00m-05s UTC integration manifest
bbcfeae drm/i915: annote drop_caches debugfs interface with lockdep
== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4145/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/i915: annote drop_caches debugfs interface with lockdep
2017-03-12 19:27 [PATCH] drm/i915: annote drop_caches debugfs interface with lockdep Daniel Vetter
2017-03-12 19:47 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-03-12 19:57 ` Chris Wilson
2017-03-12 20:53 ` Daniel Vetter
2017-03-12 21:18 ` ✗ Fi.CI.BAT: warning for drm/i915: annote drop_caches debugfs interface with lockdep (rev2) Patchwork
3 siblings, 0 replies; 9+ messages in thread
From: Chris Wilson @ 2017-03-12 19:57 UTC (permalink / raw)
To: Daniel Vetter
Cc: Intel Graphics Development, Peter Zijlstra, Ingo Molnar,
linux-kernel, Daniel Vetter
On Sun, Mar 12, 2017 at 08:27:16PM +0100, Daniel Vetter wrote:
> The trouble we have is that we can't really test all the shrinker
> recursion stuff exhaustively in BAT because any kind of thrashing
> stress test just takes too long.
>
> But that leaves a really big gap open, since shrinker recursions are
> one of the most annoying bugs. Now lockdep already has support for
> checking allocation deadlocks:
>
> - Direct reclaim paths are marked up with
> lockdep_set_current_reclaim_state() and
> lockdep_clear_current_reclaim_state().
>
> - Any allocation paths are marked with lockdep_trace_alloc().
>
> If we simply mark up our debugfs with the reclaim annotations, any
> code and locks taken in there will automatically complete the picture
> with any allocation paths we already have, as long as we have a simple
> testcase in BAT which throws out a few objects using this interface.
> Not stress test or thrashing needed at all.
>
> v2: Need to EXPORT_SYMBOL_GPL to make it compile as a module.
>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: linux-kernel@vger.kernel.org
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> (v1)
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
>
> --
>
> 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?
>
> Thanks, Daniel
> ---
> 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..0f1d6c4a212b 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -4273,11 +4273,13 @@ 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);
>
> if (val & DROP_UNBOUND)
> i915_gem_shrink(dev_priv, LONG_MAX, I915_SHRINK_UNBOUND);
> + lockdep_clear_current_reclaim_state();
>
> if (val & DROP_SHRINK_ALL)
> i915_gem_shrink_all(dev_priv);
Best to move the clear to here.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] drm/i915: annote drop_caches debugfs interface with lockdep
2017-03-12 19:27 [PATCH] drm/i915: annote drop_caches debugfs interface with lockdep 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-13 8:01 ` Peter Zijlstra
2017-03-12 21:18 ` ✗ Fi.CI.BAT: warning for drm/i915: annote drop_caches debugfs interface with lockdep (rev2) Patchwork
3 siblings, 1 reply; 9+ messages in thread
From: Daniel Vetter @ 2017-03-12 20:53 UTC (permalink / raw)
To: Intel Graphics Development
Cc: Peter Zijlstra, Daniel Vetter, linux-kernel, Ingo Molnar,
Daniel Vetter
The trouble we have is that we can't really test all the shrinker
recursion stuff exhaustively in BAT because any kind of thrashing
stress test just takes too long.
But that leaves a really big gap open, since shrinker recursions are
one of the most annoying bugs. Now lockdep already has support for
checking allocation deadlocks:
- Direct reclaim paths are marked up with
lockdep_set_current_reclaim_state() and
lockdep_clear_current_reclaim_state().
- Any allocation paths are marked with lockdep_trace_alloc().
If we simply mark up our debugfs with the reclaim annotations, any
code and locks taken in there will automatically complete the picture
with any allocation paths we already have, as long as we have a simple
testcase in BAT which throws out a few objects using this interface.
Not stress test or thrashing needed at all.
v2: Need to EXPORT_SYMBOL_GPL to make it compile as a module.
v3: Fixup rebase fail (spotted by Chris).
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
--
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?
Thanks, Daniel
---
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
^ permalink raw reply related [flat|nested] 9+ messages in thread
* ✗ Fi.CI.BAT: warning for drm/i915: annote drop_caches debugfs interface with lockdep (rev2)
2017-03-12 19:27 [PATCH] drm/i915: annote drop_caches debugfs interface with lockdep Daniel Vetter
` (2 preceding siblings ...)
2017-03-12 20:53 ` Daniel Vetter
@ 2017-03-12 21:18 ` Patchwork
3 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2017-03-12 21:18 UTC (permalink / raw)
To: Daniel Vetter; +Cc: intel-gfx
== Series Details ==
Series: drm/i915: annote drop_caches debugfs interface with lockdep (rev2)
URL : https://patchwork.freedesktop.org/series/21114/
State : warning
== Summary ==
Series 21114v2 drm/i915: annote drop_caches debugfs interface with lockdep
https://patchwork.freedesktop.org/api/1.0/series/21114/revisions/2/mbox/
Test gem_exec_gttfill:
Subgroup basic:
pass -> DMESG-WARN (fi-byt-n2820)
pass -> DMESG-WARN (fi-kbl-7500u)
pass -> DMESG-WARN (fi-snb-2600)
pass -> DMESG-WARN (fi-bxt-j4205)
pass -> DMESG-WARN (fi-skl-6700hq)
pass -> DMESG-WARN (fi-skl-6260u)
pass -> DMESG-WARN (fi-skl-6770hq)
pass -> DMESG-WARN (fi-hsw-4770r)
pass -> DMESG-WARN (fi-ilk-650)
pass -> DMESG-WARN (fi-snb-2520m)
pass -> DMESG-WARN (fi-skl-6700k)
pass -> DMESG-WARN (fi-ivb-3770)
pass -> DMESG-WARN (fi-byt-j1900)
pass -> DMESG-WARN (fi-bdw-5557u)
pass -> DMESG-WARN (fi-hsw-4770)
pass -> DMESG-WARN (fi-ivb-3520m)
Test gem_exec_suspend:
Subgroup basic-s3:
dmesg-warn -> PASS (fi-kbl-7500u) fdo#100124
Subgroup basic-s4-devices:
pass -> DMESG-WARN (fi-bxt-t5700) fdo#100125
Test kms_force_connector_basic:
Subgroup prune-stale-modes:
skip -> PASS (fi-snb-2520m)
fdo#100124 https://bugs.freedesktop.org/show_bug.cgi?id=100124
fdo#100125 https://bugs.freedesktop.org/show_bug.cgi?id=100125
fi-bdw-5557u total:278 pass:266 dwarn:1 dfail:0 fail:0 skip:11 time: 458s
fi-bsw-n3050 total:278 pass:239 dwarn:0 dfail:0 fail:0 skip:39 time: 590s
fi-bxt-j4205 total:278 pass:258 dwarn:1 dfail:0 fail:0 skip:19 time: 514s
fi-bxt-t5700 total:278 pass:257 dwarn:1 dfail:0 fail:0 skip:20 time: 546s
fi-byt-j1900 total:278 pass:250 dwarn:1 dfail:0 fail:0 skip:27 time: 476s
fi-byt-n2820 total:278 pass:246 dwarn:1 dfail:0 fail:0 skip:31 time: 478s
fi-hsw-4770 total:278 pass:261 dwarn:1 dfail:0 fail:0 skip:16 time: 432s
fi-hsw-4770r total:278 pass:261 dwarn:1 dfail:0 fail:0 skip:16 time: 423s
fi-ilk-650 total:278 pass:227 dwarn:1 dfail:0 fail:0 skip:50 time: 551s
fi-ivb-3520m total:278 pass:259 dwarn:1 dfail:0 fail:0 skip:18 time: 504s
fi-ivb-3770 total:278 pass:259 dwarn:1 dfail:0 fail:0 skip:18 time: 482s
fi-kbl-7500u total:278 pass:259 dwarn:1 dfail:0 fail:0 skip:18 time: 469s
fi-skl-6260u total:278 pass:267 dwarn:1 dfail:0 fail:0 skip:10 time: 483s
fi-skl-6700hq total:278 pass:260 dwarn:1 dfail:0 fail:0 skip:17 time: 587s
fi-skl-6700k total:278 pass:255 dwarn:5 dfail:0 fail:0 skip:18 time: 483s
fi-skl-6770hq total:278 pass:267 dwarn:1 dfail:0 fail:0 skip:10 time: 530s
fi-snb-2520m total:278 pass:249 dwarn:1 dfail:0 fail:0 skip:28 time: 540s
fi-snb-2600 total:278 pass:248 dwarn:1 dfail:0 fail:0 skip:29 time: 407s
2cb12884655eab41d4992b33ccb36c609c4537d3 drm-tip: 2017y-03m-12d-13h-00m-05s UTC integration manifest
0cfa335 drm/i915: annote drop_caches debugfs interface with lockdep
== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4146/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/i915: annote drop_caches debugfs interface with lockdep
2017-03-12 20:53 ` Daniel Vetter
@ 2017-03-13 8:01 ` Peter Zijlstra
2017-03-13 8:15 ` Daniel Vetter
0 siblings, 1 reply; 9+ messages in thread
From: Peter Zijlstra @ 2017-03-13 8:01 UTC (permalink / raw)
To: Daniel Vetter
Cc: Daniel Vetter, Intel Graphics Development, Ingo Molnar,
linux-kernel
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/i915: annote drop_caches debugfs interface with lockdep
2017-03-13 8:01 ` Peter Zijlstra
@ 2017-03-13 8:15 ` Daniel Vetter
2017-03-13 8:30 ` Peter Zijlstra
0 siblings, 1 reply; 9+ messages in thread
From: Daniel Vetter @ 2017-03-13 8:15 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Daniel Vetter, Intel Graphics Development, linux-kernel,
Ingo Molnar, Daniel Vetter
On Mon, Mar 13, 2017 at 09:01:57AM +0100, Peter Zijlstra wrote:
> 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.
Yeah, we'd really like to have that, and even when switched to a
lockdep_map instead of reusing the context stuff the semantic interface
would be the same (and I think we should keep the gfp_flags stuff, in case
someone adds a nesting lockdep map for GFP_IO).
Do you want a topic branch with just this patch (the shrink_all is new so
there will be a conflict and we can't mege it through one tree alone) so
that you can refactor things with i915 included?
Thanks, Daniel
>
> > ---
> > 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
> >
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/i915: annote drop_caches debugfs interface with lockdep
2017-03-13 8:15 ` Daniel Vetter
@ 2017-03-13 8:30 ` Peter Zijlstra
2017-03-14 9:10 ` Daniel Vetter
0 siblings, 1 reply; 9+ messages in thread
From: Peter Zijlstra @ 2017-03-13 8:30 UTC (permalink / raw)
To: Intel Graphics Development, Chris Wilson, Ingo Molnar,
linux-kernel, Daniel Vetter
On Mon, Mar 13, 2017 at 09:15:17AM +0100, Daniel Vetter wrote:
> On Mon, Mar 13, 2017 at 09:01:57AM +0100, Peter Zijlstra wrote:
> > 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.
>
> Yeah, we'd really like to have that, and even when switched to a
> lockdep_map instead of reusing the context stuff the semantic interface
> would be the same (and I think we should keep the gfp_flags stuff, in case
> someone adds a nesting lockdep map for GFP_IO).
>
> Do you want a topic branch with just this patch (the shrink_all is new so
> there will be a conflict and we can't mege it through one tree alone) so
> that you can refactor things with i915 included?
Just take your patch; I'll sort it out when I get time for things and
take i915 along for the ride.
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Thanks!
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/i915: annote drop_caches debugfs interface with lockdep
2017-03-13 8:30 ` Peter Zijlstra
@ 2017-03-14 9:10 ` Daniel Vetter
0 siblings, 0 replies; 9+ messages in thread
From: Daniel Vetter @ 2017-03-14 9:10 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Daniel Vetter, Intel Graphics Development, Ingo Molnar,
linux-kernel
On Mon, Mar 13, 2017 at 09:30:41AM +0100, Peter Zijlstra wrote:
> On Mon, Mar 13, 2017 at 09:15:17AM +0100, Daniel Vetter wrote:
> > On Mon, Mar 13, 2017 at 09:01:57AM +0100, Peter Zijlstra wrote:
> > > 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.
> >
> > Yeah, we'd really like to have that, and even when switched to a
> > lockdep_map instead of reusing the context stuff the semantic interface
> > would be the same (and I think we should keep the gfp_flags stuff, in case
> > someone adds a nesting lockdep map for GFP_IO).
> >
> > Do you want a topic branch with just this patch (the shrink_all is new so
> > there will be a conflict and we can't mege it through one tree alone) so
> > that you can refactor things with i915 included?
>
> Just take your patch; I'll sort it out when I get time for things and
> take i915 along for the ride.
>
> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Thanks, queued in drm-intel for 4.12 with Chris' irc r-b confirmation.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2017-03-14 9:10 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-12 19:27 [PATCH] drm/i915: annote drop_caches debugfs interface with lockdep 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-13 8:01 ` Peter Zijlstra
2017-03-13 8:15 ` Daniel Vetter
2017-03-13 8:30 ` Peter Zijlstra
2017-03-14 9:10 ` Daniel Vetter
2017-03-12 21:18 ` ✗ Fi.CI.BAT: warning for drm/i915: annote drop_caches debugfs interface with lockdep (rev2) Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox