Received: by 10.213.65.68 with SMTP id h4csp389206imn; Tue, 27 Mar 2018 00:48:25 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/i7hkJ3xNsoQ8jXagdHXhYcAz9/YN4/T0VQh9jjft/gD+7UtAxmjtuGFZomYuy6+yIG+sf X-Received: by 10.101.100.203 with SMTP id t11mr7874359pgv.129.1522136905834; Tue, 27 Mar 2018 00:48:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522136905; cv=none; d=google.com; s=arc-20160816; b=G7ZWJta/ZmBbkt1FxETVAAQJ8hWIAhUr4x7qFHeiwuzHY1jnihGALS+eP6mUWHGiY6 uPbt7HSWFWX68I+5yPyVzmNemocYgmxbxuej7A2v6CF7PLRRVyMcEDJcR1xLqbXIF6nh faVeF1CH0uFdGzHGJ+23ODuNYcqreMfPef+/44/IkZqWz5r9h7iOgee4AdKJ7bGUuW+t k7g/TA+NAasU6Yae5kMz15ypIeJDmedH3UZd08UTkDn5N26F6aW7OUVMp/GWR/lC23Pl QQ0MIowNoA1PaT3cN9ToowulSmOzNvAQTZIy/xsHTvbXqrfDTa14Szsr93F0rRNurFAZ 2Vjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=ea1WiUiPoz0zH6J9t+rH/yf7Ykwk5z6x8i6iuPMzYPY=; b=HuDLIbKuILr7eXr7N4Ue0bdwWH2TC98t2hbf5+xZmOswvxtF6UBVxwFtIea9rpA0Vr oYMQMeraUG/92ZLSrzBMIiyQQwBMAmsQGa1s8KqW9MFpPQs+zQvqXyJ3PeQ3CqZoD2iK yZ6tsYQXX2GlwEReUOfmFfS1mNfwFp/eAUEhEHSsaPTJ4vX36RnDxj/KPYNfzNft9AmZ YRa13lbPIc/dA/DxJnKmbD5JhI/4mMkR9Ye9oaq167zIqa+rlSg18hPGC480JFbjXVLx zLDY5Bm515RPA2gAq+vI2PvHiKqo+lhthn8owpw4yXDSC4/Xa++vabvoytfYqDCWB+xP rLYQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 85si488468pfz.271.2018.03.27.00.48.11; Tue, 27 Mar 2018 00:48:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751192AbeC0HrO (ORCPT + 99 others); Tue, 27 Mar 2018 03:47:14 -0400 Received: from terminus.zytor.com ([198.137.202.136]:48927 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750873AbeC0HrN (ORCPT ); Tue, 27 Mar 2018 03:47:13 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w2R7kUxb568690; Tue, 27 Mar 2018 00:46:30 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w2R7kTKX568687; Tue, 27 Mar 2018 00:46:29 -0700 Date: Tue, 27 Mar 2018 00:46:29 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Davidlohr Bueso Message-ID: Cc: mingo@kernel.org, dave@stgolabs.net, peterz@infradead.org, dbueso@suse.de, torvalds@linux-foundation.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, hpa@zytor.com Reply-To: dbueso@suse.de, tglx@linutronix.de, torvalds@linux-foundation.org, hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@kernel.org, dave@stgolabs.net, peterz@infradead.org In-Reply-To: <20180326210929.5244-4-dave@stgolabs.net> References: <20180326210929.5244-4-dave@stgolabs.net> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] sched/core: Update preempt_notifier_key to modern API Git-Commit-ID: b720342849fe685310fca01748a32730a6eca5aa 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 X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: b720342849fe685310fca01748a32730a6eca5aa Gitweb: https://git.kernel.org/tip/b720342849fe685310fca01748a32730a6eca5aa Author: Davidlohr Bueso AuthorDate: Mon, 26 Mar 2018 14:09:26 -0700 Committer: Ingo Molnar CommitDate: Tue, 27 Mar 2018 07:51:45 +0200 sched/core: Update preempt_notifier_key to modern API No changes in refcount semantics, use DEFINE_STATIC_KEY_FALSE() for initialization and replace: static_key_slow_inc|dec() => static_branch_inc|dec() static_key_false() => static_branch_unlikely() Signed-off-by: Davidlohr Bueso Cc: Davidlohr Bueso Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: akpm@linux-foundation.org Link: http://lkml.kernel.org/r/20180326210929.5244-4-dave@stgolabs.net Signed-off-by: Ingo Molnar --- kernel/sched/core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index b249adbf2a48..de440456f15c 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -2462,17 +2462,17 @@ void wake_up_new_task(struct task_struct *p) #ifdef CONFIG_PREEMPT_NOTIFIERS -static struct static_key preempt_notifier_key = STATIC_KEY_INIT_FALSE; +static DEFINE_STATIC_KEY_FALSE(preempt_notifier_key); void preempt_notifier_inc(void) { - static_key_slow_inc(&preempt_notifier_key); + static_branch_inc(&preempt_notifier_key); } EXPORT_SYMBOL_GPL(preempt_notifier_inc); void preempt_notifier_dec(void) { - static_key_slow_dec(&preempt_notifier_key); + static_branch_dec(&preempt_notifier_key); } EXPORT_SYMBOL_GPL(preempt_notifier_dec); @@ -2482,7 +2482,7 @@ EXPORT_SYMBOL_GPL(preempt_notifier_dec); */ void preempt_notifier_register(struct preempt_notifier *notifier) { - if (!static_key_false(&preempt_notifier_key)) + if (!static_branch_unlikely(&preempt_notifier_key)) WARN(1, "registering preempt_notifier while notifiers disabled\n"); hlist_add_head(¬ifier->link, ¤t->preempt_notifiers); @@ -2511,7 +2511,7 @@ static void __fire_sched_in_preempt_notifiers(struct task_struct *curr) static __always_inline void fire_sched_in_preempt_notifiers(struct task_struct *curr) { - if (static_key_false(&preempt_notifier_key)) + if (static_branch_unlikely(&preempt_notifier_key)) __fire_sched_in_preempt_notifiers(curr); } @@ -2529,7 +2529,7 @@ static __always_inline void fire_sched_out_preempt_notifiers(struct task_struct *curr, struct task_struct *next) { - if (static_key_false(&preempt_notifier_key)) + if (static_branch_unlikely(&preempt_notifier_key)) __fire_sched_out_preempt_notifiers(curr, next); }