From patchwork Tue Jan 5 13:31:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Henriques X-Patchwork-Id: 563103 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id CB6A11402EC; Wed, 6 Jan 2016 00:31:22 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1aGRhn-00081X-HS; Tue, 05 Jan 2016 13:31:19 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1aGRhh-0007zZ-VE for kernel-team@lists.ubuntu.com; Tue, 05 Jan 2016 13:31:13 +0000 Received: from 1.general.henrix.uk.vpn ([10.172.192.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1aGRhh-00047W-9H; Tue, 05 Jan 2016 13:31:13 +0000 From: Luis Henriques To: Peter Hurley Subject: [3.16.y-ckt stable] Patch "locking: Add WARN_ON_ONCE lock assertion" has been added to staging queue Date: Tue, 5 Jan 2016 13:31:11 +0000 Message-Id: <1452000671-3959-1-git-send-email-luis.henriques@canonical.com> X-Extended-Stable: 3.16 Cc: Greg Kroah-Hartman , kernel-team@lists.ubuntu.com, Ingo Molnar X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com This is a note to let you know that I have just added a patch titled locking: Add WARN_ON_ONCE lock assertion to the linux-3.16.y-queue branch of the 3.16.y-ckt extended stable tree which can be found at: http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.16.y-queue This patch is scheduled to be released in version 3.16.7-ckt22. If you, or anyone else, feels it should not be added to this tree, please reply to this email. For more information about the 3.16.y-ckt tree, see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable Thanks. -Luis ------ From 02d4d9512faf2e50dfc426e1970a3471d70243e1 Mon Sep 17 00:00:00 2001 From: Peter Hurley Date: Wed, 10 Sep 2014 14:31:39 -0400 Subject: locking: Add WARN_ON_ONCE lock assertion commit 9a37110d20c95d1ebf6c04881177fe8f62831db2 upstream. An interface may need to assert a lock invariant and not flood the system logs; add a lockdep helper macro equivalent to lockdep_assert_held() which only WARNs once. Signed-off-by: Peter Hurley Acked-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman Signed-off-by: Luis Henriques --- include/linux/lockdep.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index 008388f920d7..64c7425afbce 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h @@ -362,6 +362,10 @@ extern void lockdep_trace_alloc(gfp_t mask); WARN_ON(debug_locks && !lockdep_is_held(l)); \ } while (0) +#define lockdep_assert_held_once(l) do { \ + WARN_ON_ONCE(debug_locks && !lockdep_is_held(l)); \ + } while (0) + #define lockdep_recursing(tsk) ((tsk)->lockdep_recursion) #else /* !CONFIG_LOCKDEP */ @@ -412,6 +416,7 @@ struct lock_class_key { }; #define lockdep_depth(tsk) (0) #define lockdep_assert_held(l) do { (void)(l); } while (0) +#define lockdep_assert_held_once(l) do { (void)(l); } while (0) #define lockdep_recursing(tsk) (0)