From nobody Mon Jun 22 23:57:54 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA23FC433F5 for ; Tue, 15 Mar 2022 08:31:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345962AbiCOIcR (ORCPT ); Tue, 15 Mar 2022 04:32:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345922AbiCOIcH (ORCPT ); Tue, 15 Mar 2022 04:32:07 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3B324C415; Tue, 15 Mar 2022 01:30:55 -0700 (PDT) Date: Tue, 15 Mar 2022 08:30:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1647333053; 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; bh=mu73k6T0eRhzXNXG6ZNwBHwmn6Hf3dOvK/yDq4DQ9lE=; b=2kkIzX9jvASGxMn1TIhFiegpT1Jm1ztm4RA3NAIuCJb5fpqX/15+MoSWkfeFuhLuQ+sV7m 5Mebs5o+4K185ijT21OcYTw1OaWwB6QIPpEKM5FVOd08K/oT1mwmGqShBkOL+uEyAnHq+y 5FHfiCT9Qbpl5HdcxuctWqoVHRpkwtjCNimc02mTeBBmwfrVc31a7z2Rt5AlMqhk2zwHIS +FblvuSiw5iFzrLWRbnr6cV0/1DWPJFRmg2ZN6OJPri3m9TJIPF9bMvhOC0dTPc99H2eed 2dfqYYN3ymM/RWMs3OfxemLkjMZ9lfsCmTTn0ujLuQ3lZsudxfPuT0xLjOJyGg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1647333053; 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; bh=mu73k6T0eRhzXNXG6ZNwBHwmn6Hf3dOvK/yDq4DQ9lE=; b=I9ZbCh8wnBozXZhwrxRT+NXtt4uc0h0jMsHTkzuzE1/M5mW9MFWb3B7nqk0aHirD7KSvlG ZcWanYiG75HADFCw== From: "tip-bot2 for Ingo Molnar" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched/headers: Reorganize, clean up and optimize kernel/sched/sched.h dependencies Cc: Ingo Molnar , Peter Zijlstra , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <164733305217.16921.16969063947874969598.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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the sched/core branch of tip: Commit-ID: 4ff8f2ca6ccd9e0cc5665d09f86d631b3ae3a14c Gitweb: https://git.kernel.org/tip/4ff8f2ca6ccd9e0cc5665d09f86d631b3= ae3a14c Author: Ingo Molnar AuthorDate: Tue, 22 Feb 2022 14:51:58 +01:00 Committer: Ingo Molnar CommitterDate: Wed, 23 Feb 2022 10:58:34 +01:00 sched/headers: Reorganize, clean up and optimize kernel/sched/sched.h depen= dencies Remove all headers, except the ones required to make this header build standalone. Also include stats.h in sched.h explicitly - dependencies already require this. Summary of the build speedup gained through the last ~15 scheduler build & header dependency patches: Cumulative scheduler (kernel/sched/) build time speedup on a Linux distribution's config, which enables all scheduler features, compared to the vanilla kernel: _________________________________________________________________________= ____ | | Vanilla kernel (v5.13-rc7): |_________________________________________________________________________= ____ | | Performance counter stats for 'make -j96 kernel/sched/' (3 runs): | | 126,975,564,374 instructions # 1.45 insn per cyc= le ( +- 0.00% ) | 87,637,847,671 cycles # 3.959 GHz = ( +- 0.30% ) | 22,136.96 msec cpu-clock # 7.499 CPUs utilize= d ( +- 0.29% ) | | 2.9520 +- 0.0169 seconds time elapsed ( +- 0.57% ) |_________________________________________________________________________= ____ | | Patched kernel: |_________________________________________________________________________= ____ | | Performance counter stats for 'make -j96 kernel/sched/' (3 runs): | | 50,420,496,914 instructions # 1.47 insn per cyc= le ( +- 0.00% ) | 34,234,322,038 cycles # 3.946 GHz = ( +- 0.31% ) | 8,675.81 msec cpu-clock # 3.053 CPUs utilize= d ( +- 0.45% ) | | 2.8420 +- 0.0181 seconds time elapsed ( +- 0.64% ) |_________________________________________________________________________= ____ Summary: - CPU time used to build the scheduler dropped by -60.9%, a reduction from 22.1 clock-seconds to 8.7 clock-seconds. - Wall-clock time to build the scheduler dropped by -3.9%, a reduction from 2.95 seconds to 2.84 seconds. Signed-off-by: Ingo Molnar Reviewed-by: Peter Zijlstra --- kernel/sched/build_policy.c | 4 +- kernel/sched/build_utility.c | 6 +- kernel/sched/sched.h | 147 ++++++++++------------------------ kernel/sched/stats.h | 2 +- 4 files changed, 46 insertions(+), 113 deletions(-) diff --git a/kernel/sched/build_policy.c b/kernel/sched/build_policy.c index a2e4023..e0104b4 100644 --- a/kernel/sched/build_policy.c +++ b/kernel/sched/build_policy.c @@ -28,10 +28,6 @@ #include #include =20 -#ifdef CONFIG_PARAVIRT -# include -#endif - #include =20 #include "sched.h" diff --git a/kernel/sched/build_utility.c b/kernel/sched/build_utility.c index bc2f4d6..eec0849 100644 --- a/kernel/sched/build_utility.c +++ b/kernel/sched/build_utility.c @@ -44,13 +44,11 @@ #include #include =20 -#ifdef CONFIG_PARAVIRT -# include -#endif - #include #include =20 +#include + #include "sched.h" #include "sched-pelt.h" #include "stats.h" diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index f255ec2..0d42179 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -5,158 +5,97 @@ #ifndef _KERNEL_SCHED_SCHED_H #define _KERNEL_SCHED_SCHED_H =20 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - #include #include -#include -#include #include -#include #include -#include -#include -#include -#include -#include -#include +#include #include #include -#include -#include -#include #include -#include #include #include #include #include +#include #include -#include -#include #include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef CONFIG_PARAVIRT -# include -#endif - -#include - -#ifdef CONFIG_CGROUP_SCHED -#include -#include -#endif - -#ifdef CONFIG_SCHED_DEBUG -# include -#endif - -#include "cpupri.h" -#include "cpudeadline.h" - -#ifdef CONFIG_SCHED_DEBUG -# define SCHED_WARN_ON(x) WARN_ONCE(x, #x) -#else -# define SCHED_WARN_ON(x) ({ (void)(x), 0; }) -#endif =20 +#include #include +#include #include +#include #include #include #include #include #include +#include #include #include +#include #include #include +#include #include #include +#include +#include +#include #include #include +#include #include #include +#include #include -#include -#include -#include -#include -#include -#include +#include #include #include #include #include +#include +#include #include #include +#include #include #include #include #include #include +#include #include =20 #include +#include =20 #include "../workqueue_internal.h" =20 +#ifdef CONFIG_CGROUP_SCHED +#include +#include +#endif + +#ifdef CONFIG_SCHED_DEBUG +# include +#endif + +#ifdef CONFIG_PARAVIRT +# include +# include +#endif + +#include "cpupri.h" +#include "cpudeadline.h" + +#ifdef CONFIG_SCHED_DEBUG +# define SCHED_WARN_ON(x) WARN_ONCE(x, #x) +#else +# define SCHED_WARN_ON(x) ({ (void)(x), 0; }) +#endif + struct rq; struct cpuidle_state; =20 @@ -1925,6 +1864,8 @@ extern void flush_smp_call_function_from_idle(void); static inline void flush_smp_call_function_from_idle(void) { } #endif =20 +#include "stats.h" + #if defined(CONFIG_SCHED_CORE) && defined(CONFIG_SCHEDSTATS) =20 extern void __sched_core_account_forceidle(struct rq *rq); diff --git a/kernel/sched/stats.h b/kernel/sched/stats.h index a0df79e..baa839c 100644 --- a/kernel/sched/stats.h +++ b/kernel/sched/stats.h @@ -2,8 +2,6 @@ #ifndef _KERNEL_STATS_H #define _KERNEL_STATS_H =20 -#include "sched.h" - #ifdef CONFIG_SCHEDSTATS =20 extern struct static_key_false sched_schedstats;