Received: by 10.213.65.68 with SMTP id h4csp752439imn; Sun, 25 Mar 2018 12:25:07 -0700 (PDT) X-Google-Smtp-Source: AG47ELu5yeOOEHs7evYQqrfPlAobpiKBY5LpC1zAEyzXHG4ZlOGcz/YNcJMAH2721yF2rHcoidbS X-Received: by 2002:a17:902:b582:: with SMTP id a2-v6mr38409155pls.353.1522005907335; Sun, 25 Mar 2018 12:25:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522005907; cv=none; d=google.com; s=arc-20160816; b=RJ2j4QSzs6Mnw9zyWR2UD0tnak5SSHR1S1xEHH5fTf5KpyaYRXaeQnbgoFYXTn3xcR Sb7E8yEexSlADOxo65qGAC8gkQFsJXuXXvcFD66harlAPz/cCi6pl6XHnnMZhGX1bOZS V53YPjaJbWLCeMmOPDuEq2Pe83ZNmti1rub4H6rRBbOMo1A6xhkCMOPEt0qNdd2rbNOO oyaAj9ZQgWJ3MrroaRVR9VVx1QRpFjsgvuL1yQ2zpMWt1flHziVszwW6p5Su3AJgnyPM q3306wpGTCtw9Lg2E1va3UGKOwc+inGvhH0jIIQ7p3FyAHhCbIm/bWYYzDi/T8ruvtla Vu4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=0CJrqqCygQTzsKoB95IJHhRRhOQtSZrC3ZX8G4cWmN0=; b=t6lGbGVb0pKRZrDfhf4zKfBn5appNWKnKRiyzvWvr23W8hDblgGBgJdYlZlE5G4StV BAKhRoxstqqZfev/NtuZYYnj57x0JIiXJ5HT0AMp1EBzK/nK/hHzrqQ+Zu3TRmQq+ktZ yez6opgdxSn3vlyx/ocnADdVX84QVcujo9LwF4eHi+vB9enN8GtgqKi5t8b252xk62Lo mhV/wzgydIM2mKUv82oT/1C08a0FKBz4hRcgPvSoLAfnfS9isJ9bBECT/vHWllmTXIuJ MYYv5IwqzsfscVlJmolXGo4fKywbFqxuQk6mHMYHtYqbWwAJyZmT6sSN3j73CaYDOzf1 ecWg== 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 q90si10545520pfi.163.2018.03.25.12.24.53; Sun, 25 Mar 2018 12:25:07 -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 S1752131AbeCYTXc (ORCPT + 99 others); Sun, 25 Mar 2018 15:23:32 -0400 Received: from smtp2.provo.novell.com ([137.65.250.81]:59360 "EHLO smtp2.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751150AbeCYTX0 (ORCPT ); Sun, 25 Mar 2018 15:23:26 -0400 Received: from linux-n805.suse.de (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by smtp2.provo.novell.com with ESMTP (TLS encrypted); Sun, 25 Mar 2018 13:23:21 -0600 From: Davidlohr Bueso To: peterz@infradead.org, akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, Davidlohr Bueso , Davidlohr Bueso Subject: [PATCH 3/3] sched/core: update preempt_notifier_key to modern api Date: Sun, 25 Mar 2018 12:10:56 -0700 Message-Id: <20180325191056.24598-4-dave@stgolabs.net> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180325191056.24598-1-dave@stgolabs.net> References: <20180325191056.24598-1-dave@stgolabs.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org No changes in refcount semantics -- key init is false; replace static_key_slow_inc|dec with static_branch_inc|dec static_key_false with static_branch_unlikely Signed-off-by: Davidlohr Bueso --- 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 757d5a251ca4..311451e58c3c 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; +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); } -- 2.13.6