From nobody Mon Jun 22 23:57:53 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 481E8C433F5 for ; Tue, 15 Mar 2022 08:31:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346010AbiCOIca (ORCPT ); Tue, 15 Mar 2022 04:32:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345956AbiCOIcL (ORCPT ); Tue, 15 Mar 2022 04:32: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 8C9FA4C428; Tue, 15 Mar 2022 01:30:59 -0700 (PDT) Date: Tue, 15 Mar 2022 08:30:57 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1647333058; 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=kupy0Bc0ObB7ZHAcB3Ho+yjyamO78el+3D4x6h3kiFs=; b=2AQW/uIj4Do0OpB4N1+q7dKBWXkukaiYA+siuY1uKFe1b+hNIcNloAuoMh1xyX4sKVmOnA pS1+TM6J9Zd0m6UEwDWBHb1MpC5M1Ydm2VTlzYzdaHVzJSN8B/4RReA5atiC4V/BUSLyGL qqFSaliIMvJR2R1uXGRV79W03hHwaF772lFFLHYyZtAxGNmOBPDJP4B1RNLuzBEE/x/2c3 Dx2Au1fXV/t7aiW6h2v4IstdDheN3pRX4JtqibEDcPo5D0xafTJ2GwwqMNQQUKF+l9MSgK +vSYABx2WCq6PJZgeUl4vIVhn0yit0ApL9/ZNJxSr02qE++OFNDmTQeJSJE8xw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1647333058; 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=kupy0Bc0ObB7ZHAcB3Ho+yjyamO78el+3D4x6h3kiFs=; b=ERIowSrMFszmWjptSzu1qzsU1DJaVTAnqUHZ7eWgK9Eybw21hDQE4dPdQsiQW7rDUGYnQU mpB6sVOU1pWDkCDQ== 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: Standardize kernel/sched/sched.h header dependencies Cc: Ingo Molnar , Peter Zijlstra , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <164733305721.16921.17375336826369599412.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: b9e9c6ca6e54b5d58a57663f76c5cb33c12ea98f Gitweb: https://git.kernel.org/tip/b9e9c6ca6e54b5d58a57663f76c5cb33c= 12ea98f Author: Ingo Molnar AuthorDate: Sun, 13 Feb 2022 08:19:43 +01:00 Committer: Ingo Molnar CommitterDate: Wed, 23 Feb 2022 10:58:33 +01:00 sched/headers: Standardize kernel/sched/sched.h header dependencies kernel/sched/sched.h is a weird mix of ad-hoc headers included in the middle of the header. Two of them rely on being included in the middle of kernel/sched/sched.h, due to definitions they require: - "stat.h" needs the rq definitions. - "autogroup.h" needs the task_group definition. Move the inclusion of these two files out of kernel/sched/sched.h, and include them in all files that require them. Move of the rest of the header dependencies to the top of the kernel/sched/sched.h file. Signed-off-by: Ingo Molnar Reviewed-by: Peter Zijlstra --- kernel/sched/build_policy.c | 3 +++ kernel/sched/build_utility.c | 2 ++ kernel/sched/core.c | 2 ++ kernel/sched/fair.c | 2 ++ kernel/sched/sched.h | 20 +++++++++++--------- kernel/sched/stats.h | 4 ++-- 6 files changed, 22 insertions(+), 11 deletions(-) diff --git a/kernel/sched/build_policy.c b/kernel/sched/build_policy.c index 6bb384d..9a169b2 100644 --- a/kernel/sched/build_policy.c +++ b/kernel/sched/build_policy.c @@ -13,6 +13,9 @@ */ =20 #include "sched.h" + +#include "autogroup.h" +#include "stats.h" #include "pelt.h" =20 #include "idle.c" diff --git a/kernel/sched/build_utility.c b/kernel/sched/build_utility.c index 31216ce..8b2b199 100644 --- a/kernel/sched/build_utility.c +++ b/kernel/sched/build_utility.c @@ -12,6 +12,8 @@ =20 #include "sched.h" #include "sched-pelt.h" +#include "stats.h" +#include "autogroup.h" =20 #include =20 diff --git a/kernel/sched/core.c b/kernel/sched/core.c index ef94612..22de537 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -11,6 +11,8 @@ #undef CREATE_TRACE_POINTS =20 #include "sched.h" +#include "stats.h" +#include "autogroup.h" =20 #include #include diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 16874e1..7391c92 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -21,6 +21,8 @@ * Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra */ #include "sched.h" +#include "stats.h" +#include "autogroup.h" =20 /* * Targeted preemption latency for CPU-bound tasks: diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index f7d10b9..f255ec2 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -96,11 +96,20 @@ # include #endif =20 +#include + +#ifdef CONFIG_CGROUP_SCHED +#include +#include +#endif + +#ifdef CONFIG_SCHED_DEBUG +# include +#endif + #include "cpupri.h" #include "cpudeadline.h" =20 -#include - #ifdef CONFIG_SCHED_DEBUG # define SCHED_WARN_ON(x) WARN_ONCE(x, #x) #else @@ -417,9 +426,6 @@ extern bool dl_cpu_busy(unsigned int cpu); =20 #ifdef CONFIG_CGROUP_SCHED =20 -#include -#include - struct cfs_rq; struct rt_rq; =20 @@ -1919,9 +1925,6 @@ extern void flush_smp_call_function_from_idle(void); static inline void flush_smp_call_function_from_idle(void) { } #endif =20 -#include "stats.h" -#include "autogroup.h" - #if defined(CONFIG_SCHED_CORE) && defined(CONFIG_SCHEDSTATS) =20 extern void __sched_core_account_forceidle(struct rq *rq); @@ -2016,7 +2019,6 @@ static inline void __set_task_cpu(struct task_struct = *p, unsigned int cpu) * Tunables that become constants when CONFIG_SCHED_DEBUG is off: */ #ifdef CONFIG_SCHED_DEBUG -# include # define const_debug __read_mostly #else # define const_debug const diff --git a/kernel/sched/stats.h b/kernel/sched/stats.h index edc0d13..a0df79e 100644 --- a/kernel/sched/stats.h +++ b/kernel/sched/stats.h @@ -2,10 +2,10 @@ #ifndef _KERNEL_STATS_H #define _KERNEL_STATS_H =20 -#ifdef CONFIG_SCHEDSTATS - #include "sched.h" =20 +#ifdef CONFIG_SCHEDSTATS + extern struct static_key_false sched_schedstats; =20 /*