Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp684937pxu; Wed, 14 Oct 2020 11:00:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzDo2sJ/TgWgZId7ndXoXQjbSGQvKixv/iXiSyOw+kyqMb/98u2q9luTlPjFbeJFtDcPMj X-Received: by 2002:aa7:c608:: with SMTP id h8mr135541edq.16.1602698431754; Wed, 14 Oct 2020 11:00:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602698431; cv=none; d=google.com; s=arc-20160816; b=rDq9BKJV02cGIiOBN4JXPIxsiIMQCT6mipudIfGd7TMMJUVNGzELwFLmo+BZmnF6j8 Ulhi5+WUoaJfkpa0qwwiGt5pOOdLtWgoxr//svB68Yyo1ZNi6c0ShvHFzYHanwnWuebv c8S6Xcj6IXCLU5PV6E2rfcSo8OC3YS0+qZ2eTyZZmh+ry+zhbCivcTMxi43V4Up4Ah5U CF6N2GSQ7Flbrj2zYSNdJz2LlA5QdUI22y64U66zzYmCj1fzhU8vSFSghVNLo/terp8u pttqO+MQyyoapWKRcpcKQxN9MJ+Zv4YqTDIJoTj3Xb1I6xRwjqPxf+Dm3EXwJfZhUEvT 4TJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=jD1PXWndAygUyGL6CO/NQRWv6PLhWTxqnGXffaEI/3g=; b=KDBafWigty2dAifwBLG6qD/Nr1SkOuQmHYcNzVmlaoH3tWAoWd9Hyrl9lhI+uohfI9 +9Q2o7nUHbsNcCaYwLtswqBvseIkDel+U1s7/HavOtsxnmEMQuT0jG3FBxBKz46QbNjY cq4OAF6FBvoHDmq2OrKGvVG6W59e2JvkiAzUEq65XFHK3hZ9uTVfm3zdfo1f5T8axMu1 rxPHj1PX5qhVFW3o+mRGBt0leJbwMp5hWTjmC+OcFblMUjJmR7teNZtJrrkURUUruipY SC3oC/bNG8R8kNTt3KymD6ZXlCXLjh9mgacFkdudM0Zfq8jJRXQA2jRwG6js4FxXvUy1 f8Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=zhvm8FxY; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=vZsO9QjU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 89si140635edy.301.2020.10.14.11.00.09; Wed, 14 Oct 2020 11:00:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=zhvm8FxY; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=vZsO9QjU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728602AbgJNR7L (ORCPT + 99 others); Wed, 14 Oct 2020 13:59:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727071AbgJNR7L (ORCPT ); Wed, 14 Oct 2020 13:59:11 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C16DFC0613D2; Wed, 14 Oct 2020 10:59:10 -0700 (PDT) Date: Wed, 14 Oct 2020 17:58:51 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1602698348; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jD1PXWndAygUyGL6CO/NQRWv6PLhWTxqnGXffaEI/3g=; b=zhvm8FxYy9ZKDlFdLZnGvRJ3DxpNFTw/VeWQNZ8SdcPAIkE3oj+vxKjX62pccDvBv+A7Ey C/HuI3XLuTw79I7LAwtrR/mgrMrt5i4FdgmjsWnBZqu4p2oXVniFS+aGYcGrsXtFZpgXuI D5gZ1aGheQn2839T4zJAYLgTpcR7ni7bU9ZCBXcmY2GarnPBlYzNil4yK0IvSt9GEVfY+2 1TtGWzKftXNgqLkcs9PIWLPvfLI0Giz4umX8gJXHr0A6gjxP3IbxJajWsWdGAePSmoGdXg +GYwp92xWxhg1AV1jhjQoqDkxxsUQjgOVy+E8x7qL/bHrURVmj6iRoCxfi86qg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1602698348; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jD1PXWndAygUyGL6CO/NQRWv6PLhWTxqnGXffaEI/3g=; b=vZsO9QjUkgUKxI7iw92BG9prxgG70u3HGa4rdTQdD4X3d6EBx6+t+eU5z+UHAliUxQs5Ad s/zmsvI3Hg7QMBDQ== From: "tip-bot2 for Juri Lelli" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/urgent] sched/features: Fix !CONFIG_JUMP_LABEL case Cc: Daniel Bristot de Oliveira , Juri Lelli , Ingo Molnar , Patrick Bellasi , Valentin Schneider , x86 , LKML In-Reply-To: <20201013053114.160628-1-juri.lelli@redhat.com> References: <20201013053114.160628-1-juri.lelli@redhat.com> MIME-Version: 1.0 Message-ID: <160269833126.7002.6845610795437305128.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the sched/urgent branch of tip: Commit-ID: a73f863af4ce9730795eab7097fb2102e6854365 Gitweb: https://git.kernel.org/tip/a73f863af4ce9730795eab7097fb2102e6854365 Author: Juri Lelli AuthorDate: Tue, 13 Oct 2020 07:31:14 +02:00 Committer: Ingo Molnar CommitterDate: Wed, 14 Oct 2020 19:55:46 +02:00 sched/features: Fix !CONFIG_JUMP_LABEL case Commit: 765cc3a4b224e ("sched/core: Optimize sched_feat() for !CONFIG_SCHED_DEBUG builds") made sched features static for !CONFIG_SCHED_DEBUG configurations, but overlooked the CONFIG_SCHED_DEBUG=y and !CONFIG_JUMP_LABEL cases. For the latter echoing changes to /sys/kernel/debug/sched_features has the nasty effect of effectively changing what sched_features reports, but without actually changing the scheduler behaviour (since different translation units get different sysctl_sched_features). Fix CONFIG_SCHED_DEBUG=y and !CONFIG_JUMP_LABEL configurations by properly restructuring ifdefs. Fixes: 765cc3a4b224e ("sched/core: Optimize sched_feat() for !CONFIG_SCHED_DEBUG builds") Co-developed-by: Daniel Bristot de Oliveira Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Juri Lelli Signed-off-by: Ingo Molnar Acked-by: Patrick Bellasi Reviewed-by: Valentin Schneider Link: https://lore.kernel.org/r/20201013053114.160628-1-juri.lelli@redhat.com --- kernel/sched/core.c | 2 +- kernel/sched/sched.h | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 8160ab5..d2003a7 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -44,7 +44,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(sched_update_nr_running_tp); DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues); -#if defined(CONFIG_SCHED_DEBUG) && defined(CONFIG_JUMP_LABEL) +#ifdef CONFIG_SCHED_DEBUG /* * Debugging: various feature bits * diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 648f023..df80bfc 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1629,7 +1629,7 @@ enum { #undef SCHED_FEAT -#if defined(CONFIG_SCHED_DEBUG) && defined(CONFIG_JUMP_LABEL) +#ifdef CONFIG_SCHED_DEBUG /* * To support run-time toggling of sched features, all the translation units @@ -1637,6 +1637,7 @@ enum { */ extern const_debug unsigned int sysctl_sched_features; +#ifdef CONFIG_JUMP_LABEL #define SCHED_FEAT(name, enabled) \ static __always_inline bool static_branch_##name(struct static_key *key) \ { \ @@ -1649,7 +1650,13 @@ static __always_inline bool static_branch_##name(struct static_key *key) \ extern struct static_key sched_feat_keys[__SCHED_FEAT_NR]; #define sched_feat(x) (static_branch_##x(&sched_feat_keys[__SCHED_FEAT_##x])) -#else /* !(SCHED_DEBUG && CONFIG_JUMP_LABEL) */ +#else /* !CONFIG_JUMP_LABEL */ + +#define sched_feat(x) (sysctl_sched_features & (1UL << __SCHED_FEAT_##x)) + +#endif /* CONFIG_JUMP_LABEL */ + +#else /* !SCHED_DEBUG */ /* * Each translation unit has its own copy of sysctl_sched_features to allow @@ -1665,7 +1672,7 @@ static const_debug __maybe_unused unsigned int sysctl_sched_features = #define sched_feat(x) !!(sysctl_sched_features & (1UL << __SCHED_FEAT_##x)) -#endif /* SCHED_DEBUG && CONFIG_JUMP_LABEL */ +#endif /* SCHED_DEBUG */ extern struct static_key_false sched_numa_balancing; extern struct static_key_false sched_schedstats;