Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754069AbbKXJjt (ORCPT ); Tue, 24 Nov 2015 04:39:49 -0500 Received: from terminus.zytor.com ([198.137.202.10]:55453 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753620AbbKXJge (ORCPT ); Tue, 24 Nov 2015 04:36:34 -0500 Date: Tue, 24 Nov 2015 01:35:37 -0800 From: tip-bot for Andy Lutomirski Message-ID: Cc: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, dvlasenk@redhat.com, hpa@zytor.com, mingo@kernel.org, luto@kernel.org, tglx@linutronix.de, bp@alien8.de, peterz@infradead.org, luto@amacapital.net, fweisbec@gmail.com, brgerst@gmail.com Reply-To: mingo@kernel.org, luto@kernel.org, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, dvlasenk@redhat.com, hpa@zytor.com, tglx@linutronix.de, bp@alien8.de, peterz@infradead.org, luto@amacapital.net, brgerst@gmail.com, fweisbec@gmail.com In-Reply-To: <812df7e64f120c5c7c08481f36a8caa9f53b2199.1447361906.git.luto@kernel.org> References: <812df7e64f120c5c7c08481f36a8caa9f53b2199.1447361906.git.luto@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asm] context_tracking: Switch to new static_branch API Git-Commit-ID: ed11a7f1b3bd482bd7d6ef7bc2859c41fb43b9ee X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2852 Lines: 74 Commit-ID: ed11a7f1b3bd482bd7d6ef7bc2859c41fb43b9ee Gitweb: http://git.kernel.org/tip/ed11a7f1b3bd482bd7d6ef7bc2859c41fb43b9ee Author: Andy Lutomirski AuthorDate: Thu, 12 Nov 2015 12:59:01 -0800 Committer: Ingo Molnar CommitDate: Tue, 24 Nov 2015 09:56:43 +0100 context_tracking: Switch to new static_branch API This is much less error-prone than the old code. Signed-off-by: Andy Lutomirski Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: Frederic Weisbecker Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/812df7e64f120c5c7c08481f36a8caa9f53b2199.1447361906.git.luto@kernel.org Signed-off-by: Ingo Molnar --- include/linux/context_tracking_state.h | 4 ++-- kernel/context_tracking.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/context_tracking_state.h b/include/linux/context_tracking_state.h index ee956c5..1d34fe6 100644 --- a/include/linux/context_tracking_state.h +++ b/include/linux/context_tracking_state.h @@ -22,12 +22,12 @@ struct context_tracking { }; #ifdef CONFIG_CONTEXT_TRACKING -extern struct static_key context_tracking_enabled; +extern struct static_key_false context_tracking_enabled; DECLARE_PER_CPU(struct context_tracking, context_tracking); static inline bool context_tracking_is_enabled(void) { - return static_key_false(&context_tracking_enabled); + return static_branch_unlikely(&context_tracking_enabled); } static inline bool context_tracking_cpu_is_enabled(void) diff --git a/kernel/context_tracking.c b/kernel/context_tracking.c index d8560ee..9ad37b9 100644 --- a/kernel/context_tracking.c +++ b/kernel/context_tracking.c @@ -24,7 +24,7 @@ #define CREATE_TRACE_POINTS #include -struct static_key context_tracking_enabled = STATIC_KEY_INIT_FALSE; +DEFINE_STATIC_KEY_FALSE(context_tracking_enabled); EXPORT_SYMBOL_GPL(context_tracking_enabled); DEFINE_PER_CPU(struct context_tracking, context_tracking); @@ -191,7 +191,7 @@ void __init context_tracking_cpu_set(int cpu) if (!per_cpu(context_tracking.active, cpu)) { per_cpu(context_tracking.active, cpu) = true; - static_key_slow_inc(&context_tracking_enabled); + static_branch_inc(&context_tracking_enabled); } if (initialized) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/