public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Daniel Vetter <daniel.vetter@intel.com>,
	Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>
Subject: Re: [PATCH 2/3] lockdep: add might_lock_nested()
Date: Fri, 23 Aug 2019 10:49:11 +0200	[thread overview]
Message-ID: <20190823084911.GE2369@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20190820081951.25053-2-daniel.vetter@ffwll.ch>

On Tue, Aug 20, 2019 at 10:19:50AM +0200, Daniel Vetter wrote:
> Necessary to annotate functions where we might acquire a
> mutex_lock_nested() or similar. Needed by i915.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: linux-kernel@vger.kernel.org

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>

> ---
>  include/linux/lockdep.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
> index 38ea6178df7d..30f6172d6889 100644
> --- a/include/linux/lockdep.h
> +++ b/include/linux/lockdep.h
> @@ -631,6 +631,13 @@ do {									\
>  	lock_acquire(&(lock)->dep_map, 0, 0, 1, 1, NULL, _THIS_IP_);	\
>  	lock_release(&(lock)->dep_map, 0, _THIS_IP_);			\
>  } while (0)
> +# define might_lock_nested(lock, subclass) 				\
> +do {									\
> +	typecheck(struct lockdep_map *, &(lock)->dep_map);		\
> +	lock_acquire(&(lock)->dep_map, subclass, 0, 1, 1, NULL,		\
> +		     _THIS_IP_);					\
> +	lock_release(&(lock)->dep_map, 0, _THIS_IP_);		\
> +} while (0)
>  
>  #define lockdep_assert_irqs_enabled()	do {				\
>  		WARN_ONCE(debug_locks && !current->lockdep_recursion &&	\
> @@ -653,6 +660,7 @@ do {									\
>  #else
>  # define might_lock(lock) do { } while (0)
>  # define might_lock_read(lock) do { } while (0)
> +# define might_lock_nested(lock, subclass) do { } while (0)
>  # define lockdep_assert_irqs_enabled() do { } while (0)
>  # define lockdep_assert_irqs_disabled() do { } while (0)
>  # define lockdep_assert_in_irq() do { } while (0)
> -- 
> 2.23.0.rc1
> 

  reply	other threads:[~2019-08-23  8:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20  8:19 [PATCH 1/3] drm/i915: Switch obj->mm.lock lockdep annotations on its head Daniel Vetter
2019-08-20  8:19 ` [PATCH 2/3] lockdep: add might_lock_nested() Daniel Vetter
2019-08-23  8:49   ` Peter Zijlstra [this message]
2019-08-20  8:19 ` [PATCH 3/3] drm/i915: use might_lock_nested in get_pages annotation Daniel Vetter
2019-08-23  8:49   ` Peter Zijlstra
2019-08-20 10:04 ` [PATCH 1/3] drm/i915: Switch obj->mm.lock lockdep annotations on its head Chris Wilson
2019-08-20 11:55 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] " Patchwork
2019-08-20 14:14 ` ✓ Fi.CI.BAT: success " Patchwork
2019-08-20 19:03 ` ✓ Fi.CI.IGT: " Patchwork
2019-08-22 14:50 ` [PATCH] " Daniel Vetter
2019-08-22 15:06   ` Tang, CQ
2019-08-22 15:33 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with drm/i915: Switch obj->mm.lock lockdep annotations on its head (rev2) Patchwork
2019-08-22 16:12 ` ✓ Fi.CI.BAT: success " Patchwork
2019-08-23  9:36 ` ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2019-11-04 17:37 [PATCH 1/3] drm/i915: Switch obj->mm.lock lockdep annotations on its head Daniel Vetter
2019-11-04 17:37 ` [PATCH 2/3] lockdep: add might_lock_nested() Daniel Vetter

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=20190823084911.GE2369@hirez.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 \
    --cc=will@kernel.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