From nobody Mon Jun 22 23:53:34 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 76654C433EF for ; Tue, 15 Mar 2022 08:43:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346110AbiCOIpJ (ORCPT ); Tue, 15 Mar 2022 04:45:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346101AbiCOIpC (ORCPT ); Tue, 15 Mar 2022 04:45:02 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA0F4220DB for ; Tue, 15 Mar 2022 01:43:50 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id i8so27805889wrr.8 for ; Tue, 15 Mar 2022 01:43:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XOKCoe4jWaD7x9lPq3isdzFOVnNDQZD4YR70OuDp6Zg=; b=lKCdBY2z8w3dHGFZSXF8p3ejcdhgR/KW5Zla+wMlGvotRQdWgjoWkfJuUT5CPf8vH9 coCeNnKyAI6cUvix3o0IdN5QtJsHqUOmwEiu9WG7oV3hJusQ56MjNWt4WtYiANawRb2d EXzYj2WYDfuVARRY1EdhUgiF/4zBsFLeSl1uSWYyKXgzhh9sQ/ZLWQh7nv3hVezGS7n4 43j/p6f3F2wL8+QLoIA91SvHfoYxZUhpH7Z2UP2YJI8DZViXJLQOUyU+JDeX1rcPZ6BO YYhPd6RbGRJbmIRHuhR4i3bGwcDGoRemTlMo7lqNku+c5/y00XFIJkjIJPhRuwtIT48h czCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=XOKCoe4jWaD7x9lPq3isdzFOVnNDQZD4YR70OuDp6Zg=; b=yRPNDA/0b3Q6F2YbidTbEC41zTJAtN1FtL4Dc/wcPGTYWrPj1ehQteq+ztnRekeamF T7nPuQnMmab3KFt4/jzqmhWvx/4Kdpa6S0pOfiqtiMo6qfVYaLUFy84aI8RpIN4Y9+TG HsvXtdSoVzoIUie5UM2r/TU3UGUDL6K6B+OMSRGBZN035ftmqvXReCodXcmyNeuPkAkx SoRw58pkU6DFn07qXLBDcIjjU6hgC2oTdIXi2LiOYnR+XjnuAs2YxFftH0DTbajRlk6r XNcvQFSF/jGCOgsDdOkxaXseEyGsnRqKx6F3SeU/ONeM0hS8VSTzHPQZeVo4zPb+VtqE vvRw== X-Gm-Message-State: AOAM533kl2ZVp1psHfllQp+Fx1bpyy9zNiriG9Q6zUwt1BN8YLfqUdbx AaRB4vfQZHH14IIYVMa2TENMZy8lGJg= X-Google-Smtp-Source: ABdhPJxNgrgL2pqa/NjQgOFxf2ZXQYmaWLzMRViF4EjC7wHdaITAPxupOvQXVcr0AnQxvnQMjKca0w== X-Received: by 2002:a5d:6987:0:b0:1f0:16cb:db6b with SMTP id g7-20020a5d6987000000b001f016cbdb6bmr19518110wru.702.1647333829298; Tue, 15 Mar 2022 01:43:49 -0700 (PDT) Received: from kepler.. (0526F1FC.dsl.pool.telekom.hu. [5.38.241.252]) by smtp.gmail.com with ESMTPSA id e6-20020a5d5006000000b0020374784350sm15078503wrt.64.2022.03.15.01.43.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 01:43:48 -0700 (PDT) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Juri Lelli , Andy Lutomirski , Mel Gorman , Andrew Morton , Borislav Petkov , Linus Torvalds , Thomas Gleixner Subject: [PATCH 01/15] sched/headers: Fix header to build standalone: Date: Tue, 15 Mar 2022 09:42:33 +0100 Message-Id: <20220315084247.40783-2-mingo@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220315084247.40783-1-mingo@kernel.org> References: <20220315084247.40783-1-mingo@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Uses various kernel types that don't build standalone. Signed-off-by: Ingo Molnar Reviewed-by: Peter Zijlstra --- include/linux/sched_clock.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/sched_clock.h b/include/linux/sched_clock.h index 835ee87ed792..cb41c5edb4d4 100644 --- a/include/linux/sched_clock.h +++ b/include/linux/sched_clock.h @@ -5,6 +5,8 @@ #ifndef LINUX_SCHED_CLOCK #define LINUX_SCHED_CLOCK =20 +#include + #ifdef CONFIG_GENERIC_SCHED_CLOCK /** * struct clock_read_data - data required to read from sched_clock() --=20 2.32.0 From nobody Mon Jun 22 23:53:34 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 46322C433EF for ; Tue, 15 Mar 2022 08:44:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243555AbiCOIpM (ORCPT ); Tue, 15 Mar 2022 04:45:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346091AbiCOIpD (ORCPT ); Tue, 15 Mar 2022 04:45:03 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BAD06469 for ; Tue, 15 Mar 2022 01:43:52 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id 7-20020a05600c228700b00385fd860f49so1047450wmf.0 for ; Tue, 15 Mar 2022 01:43:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tH2GvQq/KqMNcn2198cqxL2zSXD8McSQV3coSRC1vhc=; b=pfrQ05wXNqGkPMexWzyKTBcZgb+4KxdZoU/M8cPb1E38WDTUJe3U7HiaUkSOF8MJUE tudi64Mvm2u7nzjLG+i0QIqPD8xMLx5gGEyqMBeTs/o5bx0egkTVFnudyc91CqPAGRJD JD+q3AVQjmgJLded5ba/8D6IW89WX9mQGcoplWUojJgW9OInaSiMxy71CjIdxgkc5lRG zSuHmqdw1GQVVb/B+k0jM0HmGZsjNbMqCbbou1OYw16xJxVwISj7QV9W/7BMVODD9JHC Z5pwhObOLyHSHrZj5YwBd8VdFT0RRSWYiR2Mo3Ub04GRqsW8kUAquAjnmOf2kra6UjQR Y6Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=tH2GvQq/KqMNcn2198cqxL2zSXD8McSQV3coSRC1vhc=; b=voOTAviyrLCfR8v8R7q6hUk/DdjrLccTU6okCzDJiJpXSw4o36vL0ahhN/I0f26tWw unpFXY37nxmVoc5CoDdpqiGM8Amr9zaKuXJDMzRHI7TTajHyYSK3GNcgTW3OYQJMKqtW dKr66gh+S75OGrt+fg6pILWX9GIDKWwhzsO1Ii9s+HpZuTdMKywHp8sHN06sEqRsMPpT 8tG77ebDd+3tZlmn6ldr5tQd/PxwOQ6CXPBuMRMbLa18QLvGkF/yAMx1oYcd+UESatum e56lpDrq7xp3Te0JAGSIIT2QW7SN+Hmv7rrTztlEGzCQWVWlIXCz6gaWka4N6KRw5QXR dWpg== X-Gm-Message-State: AOAM530zMgu87D5fayH/ARmLiidExU77V9GPB8Z+kyIUb4RCffGDcXKs O6BYile1cJoX0RBRogRXSiQfIiHhHoM= X-Google-Smtp-Source: ABdhPJz/RqNiHb1jrS036WTXH0qA6BZ03+m5BMQSXqjbUEJX5YBSVqTfMB/RupGeCvGDMHM85JieuA== X-Received: by 2002:a05:600c:5c7:b0:389:9cf2:53b4 with SMTP id p7-20020a05600c05c700b003899cf253b4mr2344804wmd.114.1647333830505; Tue, 15 Mar 2022 01:43:50 -0700 (PDT) Received: from kepler.. (0526F1FC.dsl.pool.telekom.hu. [5.38.241.252]) by smtp.gmail.com with ESMTPSA id e6-20020a5d5006000000b0020374784350sm15078503wrt.64.2022.03.15.01.43.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 01:43:49 -0700 (PDT) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Juri Lelli , Andy Lutomirski , Mel Gorman , Andrew Morton , Borislav Petkov , Linus Torvalds , Thomas Gleixner Subject: [PATCH 02/15] sched/headers: Add header guard to kernel/sched/sched.h Date: Tue, 15 Mar 2022 09:42:34 +0100 Message-Id: <20220315084247.40783-3-mingo@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220315084247.40783-1-mingo@kernel.org> References: <20220315084247.40783-1-mingo@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Use the canonical header guard naming of the full path to the header. Signed-off-by: Ingo Molnar Reviewed-by: Peter Zijlstra --- kernel/sched/sched.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 3da5718cd641..eab4a18f71c2 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -2,6 +2,9 @@ /* * Scheduler internal types and methods: */ +#ifndef _KERNEL_SCHED_SCHED_H +#define _KERNEL_SCHED_SCHED_H + #include =20 #include @@ -3137,3 +3140,4 @@ extern int sched_dynamic_mode(const char *str); extern void sched_dynamic_update(int mode); #endif =20 +#endif /* _KERNEL_SCHED_SCHED_H */ --=20 2.32.0 From nobody Mon Jun 22 23:53:34 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 31EFEC433F5 for ; Tue, 15 Mar 2022 08:44:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346115AbiCOIpQ (ORCPT ); Tue, 15 Mar 2022 04:45:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346099AbiCOIpG (ORCPT ); Tue, 15 Mar 2022 04:45:06 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 782434CD7D for ; Tue, 15 Mar 2022 01:43:53 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id q20so10770155wmq.1 for ; Tue, 15 Mar 2022 01:43:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3w0JyGhW5UbKaWUJ77X5B22PP7tPslG3inU2Ek4fp5k=; b=XUw5zKpUJIbkciEzU5+6TXccQc9QeqIBID8GeIoKRF9kL688uLSXgx8mYXXXlueleu HWs+CZMJSMTyBO89SgMpkAslAMBzjhyyOY5I0+suqnIxffo0nUcx4nUflAlUxd+AHwwB tZR+fpVEK0/HSE0vHzBd7NwJgR2GHgYWbhKwBIDOHTRANIc1Xqln3zyEDSp333zCwdpL nGOsq98AM7TCeY3i/+hcCG67NgsA1dG1MOUCD0sLnhPHqeaNM3T5qWfVRhbZp1gDi6jj y/fisX7BMWei/HKzmvbaUaIwqw6XlW3Qg895Z/ZBfoEbst2er85oSWCraIKKlMRwP6Um +8cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=3w0JyGhW5UbKaWUJ77X5B22PP7tPslG3inU2Ek4fp5k=; b=r0C/yHgFOSWr/fMHUK3neqnShTdppVXV2LOVoVzI/5PxxNFyWENwztpgQolg7cYKkG dHZhn9u++zlByb5p/TxJ9/Z2KRQEClT09aW4gyXIhLTbPsXWHtb/yLygmafBGpBACCmn hXW2d01d5AEhbHuAwF8esLPk1kOzRpARfqBfNe6KjB2mX+NHa/AgIcWr9Rt99XByXGLq hihZ2c9/jpJNgfRSxnl08/3bDWrv9aBuEZ6cW8C/b3V7rGU9m0mp4SimVlIqn5OLGRci MmkB+j4EjqU/t0DnqttzR3VQXgEalmZyhYezBWEDE0zQtmcMw6Dmjj4kHyRaX5EI2twd XJ0g== X-Gm-Message-State: AOAM533x3vtEFPlpTs/qWfmuhEPPGhA2oxhCSot/i0FExJWbMC/Lx2hx 0XJ0lHIYeJkT46JB7Lqe2Wd84hDJxEM= X-Google-Smtp-Source: ABdhPJwR6/iTgf98Ily85ocKNN8hRpNNA+QrYWv1c9xMnSdBOb1iG2G37/26eOWo8JMIpL9Ly/+oGA== X-Received: by 2002:a05:600c:3b13:b0:389:cf43:da5f with SMTP id m19-20020a05600c3b1300b00389cf43da5fmr2320532wms.201.1647333831802; Tue, 15 Mar 2022 01:43:51 -0700 (PDT) Received: from kepler.. (0526F1FC.dsl.pool.telekom.hu. [5.38.241.252]) by smtp.gmail.com with ESMTPSA id e6-20020a5d5006000000b0020374784350sm15078503wrt.64.2022.03.15.01.43.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 01:43:51 -0700 (PDT) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Juri Lelli , Andy Lutomirski , Mel Gorman , Andrew Morton , Borislav Petkov , Linus Torvalds , Thomas Gleixner Subject: [PATCH 03/15] sched/headers: Add header guard to kernel/sched/stats.h and kernel/sched/autogroup.h Date: Tue, 15 Mar 2022 09:42:35 +0100 Message-Id: <20220315084247.40783-4-mingo@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220315084247.40783-1-mingo@kernel.org> References: <20220315084247.40783-1-mingo@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Protect against multiple inclusion. Also include "sched.h" in "stat.h", as it relies on it. Signed-off-by: Ingo Molnar Reviewed-by: Peter Zijlstra --- kernel/sched/autogroup.h | 5 +++++ kernel/sched/stats.h | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/kernel/sched/autogroup.h b/kernel/sched/autogroup.h index 90fcbfdd70c3..90d69f2c5eaf 100644 --- a/kernel/sched/autogroup.h +++ b/kernel/sched/autogroup.h @@ -1,4 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _KERNEL_SCHED_AUTOGROUP_H +#define _KERNEL_SCHED_AUTOGROUP_H + #ifdef CONFIG_SCHED_AUTOGROUP =20 struct autogroup { @@ -59,3 +62,5 @@ static inline int autogroup_path(struct task_group *tg, c= har *buf, int buflen) } =20 #endif /* CONFIG_SCHED_AUTOGROUP */ + +#endif /* _KERNEL_SCHED_AUTOGROUP_H */ diff --git a/kernel/sched/stats.h b/kernel/sched/stats.h index 3a3c826dd83a..edc0d13fc61b 100644 --- a/kernel/sched/stats.h +++ b/kernel/sched/stats.h @@ -1,7 +1,11 @@ /* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _KERNEL_STATS_H +#define _KERNEL_STATS_H =20 #ifdef CONFIG_SCHEDSTATS =20 +#include "sched.h" + extern struct static_key_false sched_schedstats; =20 /* @@ -298,3 +302,5 @@ sched_info_switch(struct rq *rq, struct task_struct *pr= ev, struct task_struct *n # define sched_info_dequeue(rq, t) do { } while (0) # define sched_info_switch(rq, t, next) do { } while (0) #endif /* CONFIG_SCHED_INFO */ + +#endif /* _KERNEL_STATS_H */ --=20 2.32.0 From nobody Mon Jun 22 23:53:34 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 2FC60C433F5 for ; Tue, 15 Mar 2022 08:44:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346157AbiCOIpg (ORCPT ); Tue, 15 Mar 2022 04:45:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346103AbiCOIpG (ORCPT ); Tue, 15 Mar 2022 04:45:06 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D3924D249 for ; Tue, 15 Mar 2022 01:43:54 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id b19so5449786wrh.11 for ; Tue, 15 Mar 2022 01:43:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Gcx72MWyHSTXBVR1A78iWYLCJOULLztlK07nPk9XqZs=; b=C4QpuENnEqCSz5KbPLEsz8To46CB3xmUDuzUFipxwL4OkU9JEhZz6BHzAEju9lMirx WHe5ahaq5vwvlnf5AWOdK2I6Pbyws7DM+iFBJ2c+FPAJMYS3LjyMWrNOvA3gzQvwPAOX lU8nsYZU76W3OYgfHLh+uFN5Jv1vPOREEq65D/vjogPcF4zDav+TDr/QhXuxS/xTrwmj pXgm12P1UTpqPeKYAzBCfU2AVpK23ZgNzvj150D29o1bLblGAZvr6pwj1Otz9oJKKOhX Gj/BfzBglGpvgxIj1gTLVeTcZWOEy0Dw9klJ+G7J2ZFxUGqp6tAqZOAchDjxFpN6mYgn LhRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Gcx72MWyHSTXBVR1A78iWYLCJOULLztlK07nPk9XqZs=; b=hiq+dGsKvnm5axTwRnYkRRwSrEWmr/zgUWo8c0LFQDkB0eEygq9ncFyhmfvP662POD ugJ6V7g9zhNRBkMn0e19LmgGNVYPngqNuyRL3SvKYaPsCTLk6Q2hI7oPlYG61b5OuTPj AmK8M+hDodQ4KT50Fl2daxa1d9C30XqUMRp1y9TPKQ13rZsj8F4E5DDhwlUfgdrRtj3F /qCE75qI4cIKPKKrPEwUDCp9muee3NnLNNWoYmGXfvRk+bNZF2sFVxyMTCIWnReV26Z1 M0Nx3S0sI/UMd41JCj8spYKNwOsJr5zBt8z4Dem0WOVwmkn77InftAJZxBTdSldbQcb6 2z0A== X-Gm-Message-State: AOAM532QBABkuwSnbdU8ql9iQfBHzvM5hZYmFMKlxnfHSjqaxp9KUg4T VUtgXNpQ9kZ5xXxLmPv45JH18t0AmWc= X-Google-Smtp-Source: ABdhPJx5/3utrKW8NsI2O5aGMeGwKB/PwTw9WVSyv5oi47Wjc3gVslIFp7A3gkkL5wfyILjZSKJIdw== X-Received: by 2002:a5d:4392:0:b0:1f1:e683:de90 with SMTP id i18-20020a5d4392000000b001f1e683de90mr20138928wrq.551.1647333832882; Tue, 15 Mar 2022 01:43:52 -0700 (PDT) Received: from kepler.. (0526F1FC.dsl.pool.telekom.hu. [5.38.241.252]) by smtp.gmail.com with ESMTPSA id e6-20020a5d5006000000b0020374784350sm15078503wrt.64.2022.03.15.01.43.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 01:43:52 -0700 (PDT) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Juri Lelli , Andy Lutomirski , Mel Gorman , Andrew Morton , Borislav Petkov , Linus Torvalds , Thomas Gleixner Subject: [PATCH 04/15] sched/headers: sched/clock: Mark all functions 'notrace', remove CC_FLAGS_FTRACE build asymmetry Date: Tue, 15 Mar 2022 09:42:36 +0100 Message-Id: <20220315084247.40783-5-mingo@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220315084247.40783-1-mingo@kernel.org> References: <20220315084247.40783-1-mingo@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Mark all non-init functions in kernel/sched.c as 'notrace', instead of turning them all off via CC_FLAGS_FTRACE. This is going to allow the treatment of this file as any other scheduler file, and it can be #include-ed in compound compilation units as well. Signed-off-by: Ingo Molnar Reviewed-by: Peter Zijlstra --- kernel/sched/Makefile | 3 --- kernel/sched/clock.c | 42 +++++++++++++++++++++--------------------- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/kernel/sched/Makefile b/kernel/sched/Makefile index c83b37af155b..c0c52026ad0d 100644 --- a/kernel/sched/Makefile +++ b/kernel/sched/Makefile @@ -1,7 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 -ifdef CONFIG_FUNCTION_TRACER -CFLAGS_REMOVE_clock.o =3D $(CC_FLAGS_FTRACE) -endif =20 # The compilers are complaining about unused variables inside an if(0) sco= pe # block. This is daft, shut them up. diff --git a/kernel/sched/clock.c b/kernel/sched/clock.c index c2b2859ddd82..540d0e50e31c 100644 --- a/kernel/sched/clock.c +++ b/kernel/sched/clock.c @@ -61,7 +61,7 @@ * This is default implementation. * Architectures and sub-architectures can override this. */ -unsigned long long __weak sched_clock(void) +notrace unsigned long long __weak sched_clock(void) { return (unsigned long long)(jiffies - INITIAL_JIFFIES) * (NSEC_PER_SEC / HZ); @@ -95,28 +95,28 @@ struct sched_clock_data { =20 static DEFINE_PER_CPU_SHARED_ALIGNED(struct sched_clock_data, sched_clock_= data); =20 -static inline struct sched_clock_data *this_scd(void) +notrace static inline struct sched_clock_data *this_scd(void) { return this_cpu_ptr(&sched_clock_data); } =20 -static inline struct sched_clock_data *cpu_sdc(int cpu) +notrace static inline struct sched_clock_data *cpu_sdc(int cpu) { return &per_cpu(sched_clock_data, cpu); } =20 -int sched_clock_stable(void) +notrace int sched_clock_stable(void) { return static_branch_likely(&__sched_clock_stable); } =20 -static void __scd_stamp(struct sched_clock_data *scd) +notrace static void __scd_stamp(struct sched_clock_data *scd) { scd->tick_gtod =3D ktime_get_ns(); scd->tick_raw =3D sched_clock(); } =20 -static void __set_sched_clock_stable(void) +notrace static void __set_sched_clock_stable(void) { struct sched_clock_data *scd; =20 @@ -151,7 +151,7 @@ static void __set_sched_clock_stable(void) * The only way to fully avoid random clock jumps is to boot with: * "tsc=3Dunstable". */ -static void __sched_clock_work(struct work_struct *work) +notrace static void __sched_clock_work(struct work_struct *work) { struct sched_clock_data *scd; int cpu; @@ -177,7 +177,7 @@ static void __sched_clock_work(struct work_struct *work) =20 static DECLARE_WORK(sched_clock_work, __sched_clock_work); =20 -static void __clear_sched_clock_stable(void) +notrace static void __clear_sched_clock_stable(void) { if (!sched_clock_stable()) return; @@ -186,7 +186,7 @@ static void __clear_sched_clock_stable(void) schedule_work(&sched_clock_work); } =20 -void clear_sched_clock_stable(void) +notrace void clear_sched_clock_stable(void) { __sched_clock_stable_early =3D 0; =20 @@ -196,7 +196,7 @@ void clear_sched_clock_stable(void) __clear_sched_clock_stable(); } =20 -static void __sched_clock_gtod_offset(void) +notrace static void __sched_clock_gtod_offset(void) { struct sched_clock_data *scd =3D this_scd(); =20 @@ -246,12 +246,12 @@ late_initcall(sched_clock_init_late); * min, max except they take wrapping into account */ =20 -static inline u64 wrap_min(u64 x, u64 y) +notrace static inline u64 wrap_min(u64 x, u64 y) { return (s64)(x - y) < 0 ? x : y; } =20 -static inline u64 wrap_max(u64 x, u64 y) +notrace static inline u64 wrap_max(u64 x, u64 y) { return (s64)(x - y) > 0 ? x : y; } @@ -262,7 +262,7 @@ static inline u64 wrap_max(u64 x, u64 y) * - filter out backward motion * - use the GTOD tick value to create a window to filter crazy TSC values */ -static u64 sched_clock_local(struct sched_clock_data *scd) +notrace static u64 sched_clock_local(struct sched_clock_data *scd) { u64 now, clock, old_clock, min_clock, max_clock, gtod; s64 delta; @@ -295,7 +295,7 @@ static u64 sched_clock_local(struct sched_clock_data *s= cd) return clock; } =20 -static u64 sched_clock_remote(struct sched_clock_data *scd) +notrace static u64 sched_clock_remote(struct sched_clock_data *scd) { struct sched_clock_data *my_scd =3D this_scd(); u64 this_clock, remote_clock; @@ -362,7 +362,7 @@ static u64 sched_clock_remote(struct sched_clock_data *= scd) * * See cpu_clock(). */ -u64 sched_clock_cpu(int cpu) +notrace u64 sched_clock_cpu(int cpu) { struct sched_clock_data *scd; u64 clock; @@ -386,7 +386,7 @@ u64 sched_clock_cpu(int cpu) } EXPORT_SYMBOL_GPL(sched_clock_cpu); =20 -void sched_clock_tick(void) +notrace void sched_clock_tick(void) { struct sched_clock_data *scd; =20 @@ -403,7 +403,7 @@ void sched_clock_tick(void) sched_clock_local(scd); } =20 -void sched_clock_tick_stable(void) +notrace void sched_clock_tick_stable(void) { if (!sched_clock_stable()) return; @@ -423,7 +423,7 @@ void sched_clock_tick_stable(void) /* * We are going deep-idle (irqs are disabled): */ -void sched_clock_idle_sleep_event(void) +notrace void sched_clock_idle_sleep_event(void) { sched_clock_cpu(smp_processor_id()); } @@ -432,7 +432,7 @@ EXPORT_SYMBOL_GPL(sched_clock_idle_sleep_event); /* * We just idled; resync with ktime. */ -void sched_clock_idle_wakeup_event(void) +notrace void sched_clock_idle_wakeup_event(void) { unsigned long flags; =20 @@ -458,7 +458,7 @@ void __init sched_clock_init(void) local_irq_enable(); } =20 -u64 sched_clock_cpu(int cpu) +notrace u64 sched_clock_cpu(int cpu) { if (!static_branch_likely(&sched_clock_running)) return 0; @@ -476,7 +476,7 @@ u64 sched_clock_cpu(int cpu) * On bare metal this function should return the same as local_clock. * Architectures and sub-architectures can override this. */ -u64 __weak running_clock(void) +notrace u64 __weak running_clock(void) { return local_clock(); } --=20 2.32.0 From nobody Mon Jun 22 23:53:34 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 8B423C433FE for ; Tue, 15 Mar 2022 08:44:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346132AbiCOIpT (ORCPT ); Tue, 15 Mar 2022 04:45:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346114AbiCOIpJ (ORCPT ); Tue, 15 Mar 2022 04:45:09 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A62424D252 for ; Tue, 15 Mar 2022 01:43:55 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id t11so27780901wrm.5 for ; Tue, 15 Mar 2022 01:43:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wzh6PPn3BYYLSOV3r4esv3lBm2eIZKvXqrp9GqW+JaE=; b=dG4RWZdVbBfki25LNw8BUMmcRFIGmE63SNCOVbHa4hmBaTBq5+UI2aRaCvGm7Na9bK V0d4wxWABZgUntQ4psJ4prwm1OmsKJbMC6ZC1po2mciFf3LNp0GwunxtdCAg2lAb1SnG rohx9TGGkTdpcPi1lWYARuL8L6cOHM97UoFCS3X637/l2eK92u8At9AIeQ/vP4uAzItv bc5LN8kaL89rxeNuln09H4SQsoKjmV70BKGf1jImYGne+NzJ4RGlDXG+BEdgYPpmJObV ujn1Lcu5tntbR9jmtrHlBKqhgFbyqTaBXoUyos4GCC7WCLwKnftspDRYgVnll3zbJfX2 I5gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=wzh6PPn3BYYLSOV3r4esv3lBm2eIZKvXqrp9GqW+JaE=; b=Ae2LR6TrjIdRHjzY9njEQRc/7esQLY33hEUO+EO1CH5z2cZe60Va2XbP5PJ+YFTty+ brVScmF+XWeyYQjh9NnyqAcWFjqBxBEg9Zxbm3hXbvxUzM2DsdAjquSVH+u7yLAx6jX8 z7xK2IPz26c3c3XIbMnSsEeNdh084C2207xFHCwf8YFHCOi+pMrpbTSksZV0MKotUTxW eL5R1YCdoCREOtSlY87E93z8qYCYPte61R3v/37qHJ3G6ZU1WrKV6q36X4t72MfeYUtm QQZFxsGfRwnqWKOXe/5d/A410kqq9Y5go4KcVPyYnt0oQrCjX2YuWZjvHyCasmkx0usu U1Ew== X-Gm-Message-State: AOAM533hXrcZIm9J15VyJPve6Pon0DGknTI86rWYqy7qaT/z4AIiai7X hVWm0K+CNPBwDqfDY1PNDcR841fvJrc= X-Google-Smtp-Source: ABdhPJwFo0JopTRwVFWvzEs02cO2cyz7od1Cg81UWCAawetrgpAG9fn3JgwoDebFQck5wQg1DP02Yg== X-Received: by 2002:a5d:4dc5:0:b0:1f0:73e4:2cd9 with SMTP id f5-20020a5d4dc5000000b001f073e42cd9mr19693320wru.212.1647333834026; Tue, 15 Mar 2022 01:43:54 -0700 (PDT) Received: from kepler.. (0526F1FC.dsl.pool.telekom.hu. [5.38.241.252]) by smtp.gmail.com with ESMTPSA id e6-20020a5d5006000000b0020374784350sm15078503wrt.64.2022.03.15.01.43.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 01:43:53 -0700 (PDT) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Juri Lelli , Andy Lutomirski , Mel Gorman , Andrew Morton , Borislav Petkov , Linus Torvalds , Thomas Gleixner Subject: [PATCH 05/15] sched/headers: Add initial new headers as identity mappings Date: Tue, 15 Mar 2022 09:42:37 +0100 Message-Id: <20220315084247.40783-6-mingo@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220315084247.40783-1-mingo@kernel.org> References: <20220315084247.40783-1-mingo@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This allows code sharing between fast-headers tree and the vanilla scheduler tree. Signed-off-by: Ingo Molnar Reviewed-by: Peter Zijlstra --- arch/arm64/include/asm/paravirt_api_clock.h | 1 + arch/x86/include/asm/paravirt_api_clock.h | 1 + include/linux/cgroup_api.h | 1 + include/linux/cpumask_api.h | 1 + include/linux/fs_api.h | 1 + include/linux/gfp_api.h | 1 + include/linux/hashtable_api.h | 1 + include/linux/hrtimer_api.h | 1 + include/linux/kobject_api.h | 1 + include/linux/kref_api.h | 1 + include/linux/ktime_api.h | 1 + include/linux/llist_api.h | 1 + include/linux/lockdep_api.h | 1 + include/linux/mm_api.h | 1 + include/linux/mutex_api.h | 1 + include/linux/perf_event_api.h | 1 + include/linux/pgtable_api.h | 1 + include/linux/ptrace_api.h | 1 + include/linux/rcuwait_api.h | 1 + include/linux/refcount_api.h | 1 + include/linux/sched/affinity.h | 1 + include/linux/sched/cond_resched.h | 1 + include/linux/sched/posix-timers.h | 1 + include/linux/sched/rseq_api.h | 1 + include/linux/sched/task_flags.h | 1 + include/linux/sched/thread_info_api.h | 1 + include/linux/seqlock_api.h | 1 + include/linux/softirq.h | 1 + include/linux/spinlock_api.h | 1 + include/linux/swait_api.h | 1 + include/linux/syscalls_api.h | 1 + include/linux/u64_stats_sync_api.h | 1 + include/linux/wait_api.h | 1 + include/linux/workqueue_api.h | 1 + 34 files changed, 34 insertions(+) diff --git a/arch/arm64/include/asm/paravirt_api_clock.h b/arch/arm64/inclu= de/asm/paravirt_api_clock.h new file mode 100644 index 000000000000..65ac7cee0dad --- /dev/null +++ b/arch/arm64/include/asm/paravirt_api_clock.h @@ -0,0 +1 @@ +#include diff --git a/arch/x86/include/asm/paravirt_api_clock.h b/arch/x86/include/a= sm/paravirt_api_clock.h new file mode 100644 index 000000000000..65ac7cee0dad --- /dev/null +++ b/arch/x86/include/asm/paravirt_api_clock.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/cgroup_api.h b/include/linux/cgroup_api.h new file mode 100644 index 000000000000..d0cfe8025111 --- /dev/null +++ b/include/linux/cgroup_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/cpumask_api.h b/include/linux/cpumask_api.h new file mode 100644 index 000000000000..83bd3ebe82b0 --- /dev/null +++ b/include/linux/cpumask_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/fs_api.h b/include/linux/fs_api.h new file mode 100644 index 000000000000..83be38d6d413 --- /dev/null +++ b/include/linux/fs_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/gfp_api.h b/include/linux/gfp_api.h new file mode 100644 index 000000000000..5a05a2764a86 --- /dev/null +++ b/include/linux/gfp_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/hashtable_api.h b/include/linux/hashtable_api.h new file mode 100644 index 000000000000..c268ac2c5c0e --- /dev/null +++ b/include/linux/hashtable_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/hrtimer_api.h b/include/linux/hrtimer_api.h new file mode 100644 index 000000000000..8d9700894468 --- /dev/null +++ b/include/linux/hrtimer_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/kobject_api.h b/include/linux/kobject_api.h new file mode 100644 index 000000000000..6e36a054c2d6 --- /dev/null +++ b/include/linux/kobject_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/kref_api.h b/include/linux/kref_api.h new file mode 100644 index 000000000000..d67e554721d2 --- /dev/null +++ b/include/linux/kref_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/ktime_api.h b/include/linux/ktime_api.h new file mode 100644 index 000000000000..f697d493960f --- /dev/null +++ b/include/linux/ktime_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/llist_api.h b/include/linux/llist_api.h new file mode 100644 index 000000000000..625bec0393a1 --- /dev/null +++ b/include/linux/llist_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/lockdep_api.h b/include/linux/lockdep_api.h new file mode 100644 index 000000000000..907e66979ab2 --- /dev/null +++ b/include/linux/lockdep_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/mm_api.h b/include/linux/mm_api.h new file mode 100644 index 000000000000..a5ace2b198b8 --- /dev/null +++ b/include/linux/mm_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/mutex_api.h b/include/linux/mutex_api.h new file mode 100644 index 000000000000..85ab9491e13e --- /dev/null +++ b/include/linux/mutex_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/perf_event_api.h b/include/linux/perf_event_api.h new file mode 100644 index 000000000000..c2fd6048b790 --- /dev/null +++ b/include/linux/perf_event_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/pgtable_api.h b/include/linux/pgtable_api.h new file mode 100644 index 000000000000..ff367a4ba8c4 --- /dev/null +++ b/include/linux/pgtable_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/ptrace_api.h b/include/linux/ptrace_api.h new file mode 100644 index 000000000000..26e7d275ad8d --- /dev/null +++ b/include/linux/ptrace_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/rcuwait_api.h b/include/linux/rcuwait_api.h new file mode 100644 index 000000000000..f962e28544dd --- /dev/null +++ b/include/linux/rcuwait_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/refcount_api.h b/include/linux/refcount_api.h new file mode 100644 index 000000000000..5f032589f568 --- /dev/null +++ b/include/linux/refcount_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/sched/affinity.h b/include/linux/sched/affinity.h new file mode 100644 index 000000000000..227f5be81bcd --- /dev/null +++ b/include/linux/sched/affinity.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/sched/cond_resched.h b/include/linux/sched/cond_= resched.h new file mode 100644 index 000000000000..227f5be81bcd --- /dev/null +++ b/include/linux/sched/cond_resched.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/sched/posix-timers.h b/include/linux/sched/posix= -timers.h new file mode 100644 index 000000000000..523a381d6c88 --- /dev/null +++ b/include/linux/sched/posix-timers.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/sched/rseq_api.h b/include/linux/sched/rseq_api.h new file mode 100644 index 000000000000..cf2af72693e1 --- /dev/null +++ b/include/linux/sched/rseq_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/sched/task_flags.h b/include/linux/sched/task_fl= ags.h new file mode 100644 index 000000000000..227f5be81bcd --- /dev/null +++ b/include/linux/sched/task_flags.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/sched/thread_info_api.h b/include/linux/sched/th= read_info_api.h new file mode 100644 index 000000000000..2c60fbc16c08 --- /dev/null +++ b/include/linux/sched/thread_info_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/seqlock_api.h b/include/linux/seqlock_api.h new file mode 100644 index 000000000000..be91e7d3b826 --- /dev/null +++ b/include/linux/seqlock_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/softirq.h b/include/linux/softirq.h new file mode 100644 index 000000000000..c73d7dcb4cb5 --- /dev/null +++ b/include/linux/softirq.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/spinlock_api.h b/include/linux/spinlock_api.h new file mode 100644 index 000000000000..6338b27f98df --- /dev/null +++ b/include/linux/spinlock_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/swait_api.h b/include/linux/swait_api.h new file mode 100644 index 000000000000..1eeaaaaa5ea7 --- /dev/null +++ b/include/linux/swait_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/syscalls_api.h b/include/linux/syscalls_api.h new file mode 100644 index 000000000000..23e012b04db4 --- /dev/null +++ b/include/linux/syscalls_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/u64_stats_sync_api.h b/include/linux/u64_stats_s= ync_api.h new file mode 100644 index 000000000000..c72ca63da44b --- /dev/null +++ b/include/linux/u64_stats_sync_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/wait_api.h b/include/linux/wait_api.h new file mode 100644 index 000000000000..4e930548935a --- /dev/null +++ b/include/linux/wait_api.h @@ -0,0 +1 @@ +#include diff --git a/include/linux/workqueue_api.h b/include/linux/workqueue_api.h new file mode 100644 index 000000000000..77debb5d2760 --- /dev/null +++ b/include/linux/workqueue_api.h @@ -0,0 +1 @@ +#include --=20 2.32.0 From nobody Mon Jun 22 23:53:34 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 429B6C433EF for ; Tue, 15 Mar 2022 08:44:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346151AbiCOIpa (ORCPT ); Tue, 15 Mar 2022 04:45:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346113AbiCOIpJ (ORCPT ); Tue, 15 Mar 2022 04:45:09 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6E404D25D for ; Tue, 15 Mar 2022 01:43:56 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id u10so27808024wra.9 for ; Tue, 15 Mar 2022 01:43:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ET+xzNuDp+rklrBcyzEb7KUpoGOfUFW9oXFXIwsaP18=; b=M4XtYpV5xFKZ4/LNkeOtZBubF/ujdqqBVP0ZGQl7RSTLeL/aG/4xHxy64MpcOIxKAh dMQwxjhM3apB124dNFN06+tNT9zquawoM8m9gwZ6l+PCOVmZzzQJla23s8YlW8EF+JZw /TlkHlulcN597e9nqXWbaly8yS94+YUtf4W/KiKddaJLfjq23stIpdQl/XR2vQUPRtor REwQUbG+PsRShQDmSoZ3jz4d1w+KZZuTVZcVBA3La5bGcFfxZ0MyW0Lu4BIkVGx5w0x0 La1EvHQFx4BsPxB/CBCAyO7qwSjcy4+t/biXrck/wCMBKLzyIR0hYgtAV7Y75TCYAxqP t/ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ET+xzNuDp+rklrBcyzEb7KUpoGOfUFW9oXFXIwsaP18=; b=67T98FfGq9kBJT/WS/JHVsLF7Q+8SVbkr6jb6Pm1EwGicnSqrgnU0CO4c3nLUNS1NQ k8HxSpz8xcjLcQstB3VYNlzqt5Fy1gdL5Yw19ok7/NekZuMavcNMRAGl9OwdGI+Seiv6 UKA5njR4dBxUchmDIzoRRd0Oi5P0Jq62pnyuSckoDonHqY6n7Iujd7bmX8shZBdnXckn x5js5bQ/M+LoDojgUaSbbiozxmD4asmqIINOSnC/8ZNGAjiz4kjPrm9fOeYDLAoEqBoG 8r//s03GtAbCCE8fV5iGqx+5dcNz+4NfCGp4U8g0SFoKv9m+QRS3ae7cNftgWDfH7lk+ 7Lfw== X-Gm-Message-State: AOAM531WDLIsA5+1iBamPtpUoz7QgfXvt+8j5j6XDZV42buQIlPbshby XXUHAXOaAtz6MvCY8IMOgOKHD2mAgzU= X-Google-Smtp-Source: ABdhPJybolAvSP49vOrZeZ9n8J8ok1utvPDcT4CrohBtOagn/YDIxN1Mm9qdhawUQQ4rXQoQUJWBew== X-Received: by 2002:a5d:4dca:0:b0:1f0:2543:e10e with SMTP id f10-20020a5d4dca000000b001f02543e10emr19388697wru.60.1647333835073; Tue, 15 Mar 2022 01:43:55 -0700 (PDT) Received: from kepler.. (0526F1FC.dsl.pool.telekom.hu. [5.38.241.252]) by smtp.gmail.com with ESMTPSA id e6-20020a5d5006000000b0020374784350sm15078503wrt.64.2022.03.15.01.43.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 01:43:54 -0700 (PDT) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Juri Lelli , Andy Lutomirski , Mel Gorman , Andrew Morton , Borislav Petkov , Linus Torvalds , Thomas Gleixner Subject: [PATCH 06/15] sched/headers: Fix comment typo in kernel/sched/cpudeadline.c Date: Tue, 15 Mar 2022 09:42:38 +0100 Message-Id: <20220315084247.40783-7-mingo@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220315084247.40783-1-mingo@kernel.org> References: <20220315084247.40783-1-mingo@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" File name changed. Signed-off-by: Ingo Molnar Reviewed-by: Peter Zijlstra --- kernel/sched/cpudeadline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/cpudeadline.c b/kernel/sched/cpudeadline.c index ceb03d76c0cc..0e196f0de492 100644 --- a/kernel/sched/cpudeadline.c +++ b/kernel/sched/cpudeadline.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * kernel/sched/cpudl.c + * kernel/sched/cpudeadline.c * * Global CPU deadline management * --=20 2.32.0 From nobody Mon Jun 22 23:53:34 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 D9315C433F5 for ; Tue, 15 Mar 2022 08:44:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235615AbiCOIpl (ORCPT ); Tue, 15 Mar 2022 04:45:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346091AbiCOIpM (ORCPT ); Tue, 15 Mar 2022 04:45:12 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25E591EEC5 for ; Tue, 15 Mar 2022 01:43:57 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id d7so757224wrb.7 for ; Tue, 15 Mar 2022 01:43:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vrlnakmn5fLlGT/co3zd6+O92fe3JgVqL1zsEXzLWMY=; b=ekiKDaiPvPmyaAHma2KjNi2hG70kvvZHOu0AyAI+rcQ0NFHAUd9FTfE1W1n4NKORwv Ca+W+ConXG7ciFXJIbfopOHifeisT3X0U/fxljw/6xuI4RaLipQJreuQM9qfubp/pgnG a4XcQ9sWQm5E3/zxBYwNUlpyHpGkEf6qagmjy3+RxbJzO8m2Qs9MBQmsshMMsTrvZ5s9 1XxhuW9tqW5Rp5yagzoO26dlL7Q7/WxbJjVuyfaCPRq2AewGqXDRVEvExRh8Gslpj+YH 45TwrpgqRll3c6QYeMEMC4mnrDyTUJSvNEOKQccGKfL1pOLP0u5WhvOia9ljKdpilQXP Peog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=vrlnakmn5fLlGT/co3zd6+O92fe3JgVqL1zsEXzLWMY=; b=CnwEhpna9IuLfz4qJmeMtIRoHxL9QJkl7eddF2RAh5hzQSd/b+CRyuajsTZz8zk948 9ghXG91kWfqxZUtkR1hVb9yodihkfWu7JBMENbAJc/1j3absGqHOR74Yv8ppcqy5m34i z7iu4D2yyM4lsKgECFCw7Wgd13C4GSKMUDUNvLNT4LqMXSDqDyy6lPTqUZrv/zq4N/GI rE7rEhoLux01dBoN8OhYA2TGChrfUAIf67F0UHFgRNWXZR2jxuTBWBfweweHbv9rLq4i imNtXtsFePzhArhqxScOo7ED/5ivbvettYgbX7QKNze2X9hSS9bVk/dMWnXRPJS6UCc4 be5Q== X-Gm-Message-State: AOAM5326MgDqFvjQgRLLhKDJW2QlYmKtP273boP31ASH6zZG4ggzPTz7 Y/aS2BUBReV3srjUCwH4y3sEFVXt/EY= X-Google-Smtp-Source: ABdhPJzQ+XVKQ/F66KPlrLtzGhy9sc21PAGcwHUkbjZgYcq5BBa2K8solVtOhiURc+kyN9CiS+7GoQ== X-Received: by 2002:a5d:6c67:0:b0:203:bf25:f311 with SMTP id r7-20020a5d6c67000000b00203bf25f311mr5452652wrz.108.1647333836233; Tue, 15 Mar 2022 01:43:56 -0700 (PDT) Received: from kepler.. (0526F1FC.dsl.pool.telekom.hu. [5.38.241.252]) by smtp.gmail.com with ESMTPSA id e6-20020a5d5006000000b0020374784350sm15078503wrt.64.2022.03.15.01.43.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 01:43:55 -0700 (PDT) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Juri Lelli , Andy Lutomirski , Mel Gorman , Andrew Morton , Borislav Petkov , Linus Torvalds , Thomas Gleixner Subject: [PATCH 07/15] sched/headers: Make the header build standalone Date: Tue, 15 Mar 2022 09:42:39 +0100 Message-Id: <20220315084247.40783-8-mingo@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220315084247.40783-1-mingo@kernel.org> References: <20220315084247.40783-1-mingo@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This header depends on various scheduler definitions. Signed-off-by: Ingo Molnar Reviewed-by: Peter Zijlstra --- include/linux/sched/deadline.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/sched/deadline.h b/include/linux/sched/deadline.h index 1aff00b65f3c..7c83d4d5a971 100644 --- a/include/linux/sched/deadline.h +++ b/include/linux/sched/deadline.h @@ -6,6 +6,8 @@ * NORMAL/BATCH tasks. */ =20 +#include + #define MAX_DL_PRIO 0 =20 static inline int dl_prio(int prio) --=20 2.32.0 From nobody Mon Jun 22 23:53:34 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 072CFC433EF for ; Tue, 15 Mar 2022 08:44:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346123AbiCOIpw (ORCPT ); Tue, 15 Mar 2022 04:45:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346126AbiCOIpN (ORCPT ); Tue, 15 Mar 2022 04:45:13 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2681D4D254 for ; Tue, 15 Mar 2022 01:43:58 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id b19so5450064wrh.11 for ; Tue, 15 Mar 2022 01:43:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5bIT+MO6Wzh71jbnQvGmvD9o987UoAOQlI8zhc6bmOc=; b=bOdSmN8V1vL/uYZkouDicXadfeYRX7jkJWfYiGfSGCtVtJDonEkiosHCifVKqC0Ze7 63aryfIcLou4fy0ZLTo5sYnud25NnwGpQnjArKOyHzF0jF7JzOHmpwyrPe+Wy9kD5hTb eEANS2bDrfWIKlcOGRlp+5b/MHOFHW/hYQQtKtJZusU7whqID5dxZstJqh7yN0k3MDff a7NykqDEzBMilO96NDsPPZf8iQASQG9JOINscETIPzVPDiESz6zXdae9h/FKTGwNzzbH lOKYyTkKRviLm8W6cOLOqfK/qF83cdF2pQtAjzDE1KJ3Zr5QwTr4VYPWb97/fiV774FI UJeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=5bIT+MO6Wzh71jbnQvGmvD9o987UoAOQlI8zhc6bmOc=; b=gS53TG63jLD+zKDKIDJM6/IlxXzfN155oaezOD0VpTh0Rg6GUuRRIQ70LzbN+oXpD+ wgh7WZ3haJeV7jm/ErOIc2x3zo0FAzKXCVTccKmSH/zwnJAH8nuMalsyiYcI47+iXyzk xo/TsSCLLDeQ01+2aztz24AEgLFgrNx+xuJJtlYXHJ3OlizMUgSY87tj8aJdvJFs46iq 4lzMY86aWswzsNY7w9ayk0BFPuIOHWOVhc05lBuGr0QP7CdykFIVNnnc5OLSrdHWFl4h NQLoDbcUylxPOWM4AN7VZpRYoYUC/QnUD/jHlJ7+DKB6Bv0QocgiBR6iQ8xGLZK++vCE hmTg== X-Gm-Message-State: AOAM530P0ytSsxOL4hq3LHHR//YB60PsAiTag9zLd5aI/qJSfKQuYP2m kGGL21ooXXtrn28CCRSCFVqgzO1VlMQ= X-Google-Smtp-Source: ABdhPJyJEm5iM15aA4Tv8N5vA/kppxkJfIzaasyyZncHMwW52CYJLXJBG4kfS8bhLrH19qMHzGn+Jg== X-Received: by 2002:a05:6000:1786:b0:1f0:4c5f:63ba with SMTP id e6-20020a056000178600b001f04c5f63bamr19085158wrg.377.1647333837359; Tue, 15 Mar 2022 01:43:57 -0700 (PDT) Received: from kepler.. (0526F1FC.dsl.pool.telekom.hu. [5.38.241.252]) by smtp.gmail.com with ESMTPSA id e6-20020a5d5006000000b0020374784350sm15078503wrt.64.2022.03.15.01.43.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 01:43:56 -0700 (PDT) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Juri Lelli , Andy Lutomirski , Mel Gorman , Andrew Morton , Borislav Petkov , Linus Torvalds , Thomas Gleixner Subject: [PATCH 08/15] sched/headers: Introduce kernel/sched/build_utility.c and build multiple .c files there Date: Tue, 15 Mar 2022 09:42:40 +0100 Message-Id: <20220315084247.40783-9-mingo@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220315084247.40783-1-mingo@kernel.org> References: <20220315084247.40783-1-mingo@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Collect all utility functionality source code files into a single kernel/sc= hed/build_utility.c file, via #include-ing the .c files: kernel/sched/clock.c kernel/sched/completion.c kernel/sched/loadavg.c kernel/sched/swait.c kernel/sched/wait_bit.c kernel/sched/wait.c CONFIG_CPU_FREQ: kernel/sched/cpufreq.c CONFIG_CPU_FREQ_GOV_SCHEDUTIL: kernel/sched/cpufreq_schedutil.c CONFIG_CGROUP_CPUACCT: kernel/sched/cpuacct.c CONFIG_SCHED_DEBUG: kernel/sched/debug.c CONFIG_SCHEDSTATS: kernel/sched/stats.c CONFIG_SMP: kernel/sched/cpupri.c kernel/sched/stop_task.c kernel/sched/topology.c CONFIG_SCHED_CORE: kernel/sched/core_sched.c CONFIG_PSI: kernel/sched/psi.c CONFIG_MEMBARRIER: kernel/sched/membarrier.c CONFIG_CPU_ISOLATION: kernel/sched/isolation.c CONFIG_SCHED_AUTOGROUP: kernel/sched/autogroup.c The goal is to amortize the 60+ KLOC header bloat from over a dozen build u= nits into a single build unit. The build time of build_utility.c also roughly matches the build time of co= re.c and fair.c - allowing better load-balancing of scheduler-only rebuilds. Signed-off-by: Ingo Molnar Reviewed-by: Peter Zijlstra --- kernel/sched/Makefile | 25 +++++++++------------- kernel/sched/autogroup.c | 3 +-- kernel/sched/build_utility.c | 70 ++++++++++++++++++++++++++++++++++++= ++++++++++++++++++++++++ kernel/sched/clock.c | 2 -- kernel/sched/completion.c | 2 +- kernel/sched/core_sched.c | 3 --- kernel/sched/cpuacct.c | 3 +-- kernel/sched/cpufreq.c | 3 --- kernel/sched/cpufreq_schedutil.c | 7 ------ kernel/sched/cpupri.c | 1 - kernel/sched/debug.c | 1 - kernel/sched/isolation.c | 1 - kernel/sched/loadavg.c | 1 - kernel/sched/membarrier.c | 1 - kernel/sched/psi.c | 15 ------------- kernel/sched/sched.h | 57 ++++++++++++++++++++++++++++++++++++= +++++++++++-- kernel/sched/stats.c | 1 - kernel/sched/stop_task.c | 1 - kernel/sched/swait.c | 1 - kernel/sched/topology.c | 1 - kernel/sched/wait.c | 1 - kernel/sched/wait_bit.c | 2 +- 22 files changed, 139 insertions(+), 63 deletions(-) diff --git a/kernel/sched/Makefile b/kernel/sched/Makefile index c0c52026ad0d..4a4785cb3cd2 100644 --- a/kernel/sched/Makefile +++ b/kernel/sched/Makefile @@ -22,18 +22,13 @@ ifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y) CFLAGS_core.o :=3D $(PROFILING) -fno-omit-frame-pointer endif =20 -obj-y +=3D core.o loadavg.o clock.o cputime.o -obj-y +=3D idle.o fair.o rt.o deadline.o -obj-y +=3D wait.o wait_bit.o swait.o completion.o - -obj-$(CONFIG_SMP) +=3D cpupri.o cpudeadline.o topology.o stop_task.o pelt.o -obj-$(CONFIG_SCHED_AUTOGROUP) +=3D autogroup.o -obj-$(CONFIG_SCHEDSTATS) +=3D stats.o -obj-$(CONFIG_SCHED_DEBUG) +=3D debug.o -obj-$(CONFIG_CGROUP_CPUACCT) +=3D cpuacct.o -obj-$(CONFIG_CPU_FREQ) +=3D cpufreq.o -obj-$(CONFIG_CPU_FREQ_GOV_SCHEDUTIL) +=3D cpufreq_schedutil.o -obj-$(CONFIG_MEMBARRIER) +=3D membarrier.o -obj-$(CONFIG_CPU_ISOLATION) +=3D isolation.o -obj-$(CONFIG_PSI) +=3D psi.o -obj-$(CONFIG_SCHED_CORE) +=3D core_sched.o +# +# Build efficiency: +# +# These compilation units have roughly the same size and complexity - so t= heir +# build parallelizes well and finishes roughly at once: +# +obj-y +=3D core.o +obj-y +=3D fair.o +obj-y +=3D build_utility.o +obj-y +=3D idle.o rt.o deadline.o cputime.o cpudeadline.o pelt.o diff --git a/kernel/sched/autogroup.c b/kernel/sched/autogroup.c index 31dd2593145e..16092b49ff6a 100644 --- a/kernel/sched/autogroup.c +++ b/kernel/sched/autogroup.c @@ -1,9 +1,8 @@ // SPDX-License-Identifier: GPL-2.0 + /* * Auto-group scheduling implementation: */ -#include -#include "sched.h" =20 unsigned int __read_mostly sysctl_sched_autogroup_enabled =3D 1; static struct autogroup autogroup_default; diff --git a/kernel/sched/build_utility.c b/kernel/sched/build_utility.c new file mode 100644 index 000000000000..31216ce0b4b3 --- /dev/null +++ b/kernel/sched/build_utility.c @@ -0,0 +1,70 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * These are various utility functions of the scheduler, + * built in a single compilation unit for build efficiency reasons. + * + * ( Incidentally, the size of the compilation unit is roughly + * comparable to core.c, fair.c, smp.c and policy.c, the other + * big compilation units. This helps balance build time, while + * coalescing source files to amortize header inclusion + * cost. ) + */ + +#include "sched.h" +#include "sched-pelt.h" + +#include + +#include "clock.c" + +#ifdef CONFIG_CGROUP_CPUACCT +# include "cpuacct.c" +#endif + +#ifdef CONFIG_CPU_FREQ +# include "cpufreq.c" +#endif + +#ifdef CONFIG_CPU_FREQ_GOV_SCHEDUTIL +# include "cpufreq_schedutil.c" +#endif + +#ifdef CONFIG_SCHED_DEBUG +# include "debug.c" +#endif + +#ifdef CONFIG_SCHEDSTATS +# include "stats.c" +#endif + +#include "loadavg.c" +#include "completion.c" +#include "swait.c" +#include "wait_bit.c" +#include "wait.c" + +#ifdef CONFIG_SMP +# include "cpupri.c" +# include "stop_task.c" +# include "topology.c" +#endif + +#ifdef CONFIG_SCHED_CORE +# include "core_sched.c" +#endif + +#ifdef CONFIG_PSI +# include "psi.c" +#endif + +#ifdef CONFIG_MEMBARRIER +# include "membarrier.c" +#endif + +#ifdef CONFIG_CPU_ISOLATION +# include "isolation.c" +#endif + +#ifdef CONFIG_SCHED_AUTOGROUP +# include "autogroup.c" +#endif diff --git a/kernel/sched/clock.c b/kernel/sched/clock.c index 540d0e50e31c..d9272d9061a3 100644 --- a/kernel/sched/clock.c +++ b/kernel/sched/clock.c @@ -53,8 +53,6 @@ * that is otherwise invisible (TSC gets stopped). * */ -#include "sched.h" -#include =20 /* * Scheduler clock - returns current time in nanosec units. diff --git a/kernel/sched/completion.c b/kernel/sched/completion.c index a778554f9dad..35f15c26ed54 100644 --- a/kernel/sched/completion.c +++ b/kernel/sched/completion.c @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 + /* * Generic wait-for-completion handler; * @@ -11,7 +12,6 @@ * typically be used for exclusion which gives rise to priority inversion. * Waiting for completion is a typically sync point, but not an exclusion = point. */ -#include "sched.h" =20 /** * complete: - signals a single thread waiting on this completion diff --git a/kernel/sched/core_sched.c b/kernel/sched/core_sched.c index c8746a9a7ada..38a2cec21014 100644 --- a/kernel/sched/core_sched.c +++ b/kernel/sched/core_sched.c @@ -1,8 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only =20 -#include -#include "sched.h" - /* * A simple wrapper around refcount. An allocated sched_core_cookie's * address is used to compute the cookie of the task. diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c index 3d06c5e4220d..2c505cf800aa 100644 --- a/kernel/sched/cpuacct.c +++ b/kernel/sched/cpuacct.c @@ -1,12 +1,11 @@ // SPDX-License-Identifier: GPL-2.0 + /* * CPU accounting code for task groups. * * Based on the work by Paul Menage (menage@google.com) and Balbir Singh * (balbir@in.ibm.com). */ -#include -#include "sched.h" =20 /* Time spent by the tasks of the CPU accounting group executing in ... */ enum cpuacct_stat_index { diff --git a/kernel/sched/cpufreq.c b/kernel/sched/cpufreq.c index 7c2fe50fd76d..5252fb191fae 100644 --- a/kernel/sched/cpufreq.c +++ b/kernel/sched/cpufreq.c @@ -5,9 +5,6 @@ * Copyright (C) 2016, Intel Corporation * Author: Rafael J. Wysocki */ -#include - -#include "sched.h" =20 DEFINE_PER_CPU(struct update_util_data __rcu *, cpufreq_update_util_data); =20 diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedu= til.c index 6d65ab6e484e..f68885d049f2 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -6,13 +6,6 @@ * Author: Rafael J. Wysocki */ =20 -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -#include "sched.h" - -#include -#include - #define IOWAIT_BOOST_MIN (SCHED_CAPACITY_SCALE / 8) =20 struct sugov_tunables { diff --git a/kernel/sched/cpupri.c b/kernel/sched/cpupri.c index d583f2aa744e..fa9ce9d83683 100644 --- a/kernel/sched/cpupri.c +++ b/kernel/sched/cpupri.c @@ -22,7 +22,6 @@ * worst case complexity of O(min(101, nr_domcpus)), though the scenario = that * yields the worst case search is fairly contrived. */ -#include "sched.h" =20 /* * p->rt_priority p->prio newpri cpupri diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index 102d6f70e84d..bb3d63bdf4ae 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -6,7 +6,6 @@ * * Copyright(C) 2007, Red Hat, Inc., Ingo Molnar */ -#include "sched.h" =20 /* * This allows printing both to /proc/sched_debug and diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c index b4d10815c45a..373d42c707bc 100644 --- a/kernel/sched/isolation.c +++ b/kernel/sched/isolation.c @@ -7,7 +7,6 @@ * Copyright (C) 2017-2018 SUSE, Frederic Weisbecker * */ -#include "sched.h" =20 enum hk_flags { HK_FLAG_TIMER =3D BIT(HK_TYPE_TIMER), diff --git a/kernel/sched/loadavg.c b/kernel/sched/loadavg.c index 954b229868d9..52c8f8226b0d 100644 --- a/kernel/sched/loadavg.c +++ b/kernel/sched/loadavg.c @@ -6,7 +6,6 @@ * figure. Its a silly number but people think its important. We go through * great pains to make it work on big machines and tickless kernels. */ -#include "sched.h" =20 /* * Global load-average calculations diff --git a/kernel/sched/membarrier.c b/kernel/sched/membarrier.c index 3d2825408e3a..0c5be7ebb1dc 100644 --- a/kernel/sched/membarrier.c +++ b/kernel/sched/membarrier.c @@ -4,7 +4,6 @@ * * membarrier system call */ -#include "sched.h" =20 /* * For documentation purposes, here are some membarrier ordering diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c index 8fb08a12f602..a4fa3aadfcba 100644 --- a/kernel/sched/psi.c +++ b/kernel/sched/psi.c @@ -137,21 +137,6 @@ * sampling of the aggregate task states would be. */ =20 -#include "../workqueue_internal.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "sched.h" - static int psi_bug __read_mostly; =20 DEFINE_STATIC_KEY_FALSE(psi_disabled); diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index eab4a18f71c2..79c7a8a2be65 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -6,7 +6,25 @@ #define _KERNEL_SCHED_SCHED_H =20 #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include =20 +#include + +#include #include #include #include @@ -24,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -31,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -69,8 +89,7 @@ #include #include #include - -#include +#include =20 #ifdef CONFIG_PARAVIRT # include @@ -87,6 +106,40 @@ # 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 "../workqueue_internal.h" + struct rq; struct cpuidle_state; =20 diff --git a/kernel/sched/stats.c b/kernel/sched/stats.c index 07dde2928c79..857f837f52cb 100644 --- a/kernel/sched/stats.c +++ b/kernel/sched/stats.c @@ -2,7 +2,6 @@ /* * /proc/schedstat implementation */ -#include "sched.h" =20 void __update_stats_wait_start(struct rq *rq, struct task_struct *p, struct sched_statistics *stats) diff --git a/kernel/sched/stop_task.c b/kernel/sched/stop_task.c index 0b165a25f22f..d04073a93eb4 100644 --- a/kernel/sched/stop_task.c +++ b/kernel/sched/stop_task.c @@ -7,7 +7,6 @@ * * See kernel/stop_machine.c */ -#include "sched.h" =20 #ifdef CONFIG_SMP static int diff --git a/kernel/sched/swait.c b/kernel/sched/swait.c index e1c655f928c7..76b9b796e695 100644 --- a/kernel/sched/swait.c +++ b/kernel/sched/swait.c @@ -2,7 +2,6 @@ /* * (simple wait queues ) implementation: */ -#include "sched.h" =20 void __init_swait_queue_head(struct swait_queue_head *q, const char *name, struct lock_class_key *key) diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 32841c6741d1..e8af72fd70bd 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -2,7 +2,6 @@ /* * Scheduler topology setup/handling methods */ -#include "sched.h" =20 DEFINE_MUTEX(sched_domains_mutex); =20 diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c index eca38107b32f..9860bb9a847c 100644 --- a/kernel/sched/wait.c +++ b/kernel/sched/wait.c @@ -4,7 +4,6 @@ * * (C) 2004 Nadia Yvette Chambers, Oracle */ -#include "sched.h" =20 void __init_waitqueue_head(struct wait_queue_head *wq_head, const char *na= me, struct lock_class_key *key) { diff --git a/kernel/sched/wait_bit.c b/kernel/sched/wait_bit.c index 02ce292b9bc0..d4788f810b55 100644 --- a/kernel/sched/wait_bit.c +++ b/kernel/sched/wait_bit.c @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-only + /* * The implementation of the wait_bit*() and related waiting APIs: */ -#include "sched.h" =20 #define WAIT_TABLE_BITS 8 #define WAIT_TABLE_SIZE (1 << WAIT_TABLE_BITS) --=20 2.32.0 From nobody Mon Jun 22 23:53:34 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 3C3A0C433EF for ; Tue, 15 Mar 2022 08:44:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346144AbiCOIpt (ORCPT ); Tue, 15 Mar 2022 04:45:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346111AbiCOIpN (ORCPT ); Tue, 15 Mar 2022 04:45:13 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1F5A4D258 for ; Tue, 15 Mar 2022 01:43:59 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id l10so10789894wmb.0 for ; Tue, 15 Mar 2022 01:43:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nlVYMMSP2xWTbAi9uYhO2iUBFbCtcGFMf2JOCAezQ90=; b=IwemIK41Dsrg8TVJykVmeoghF2X+0wRUO9JJOxfU2Eh0gRDPTr01b8s3rCY5Hz7uAE rKWfRZVFwvks/QaPbMjT8+iaja/udQUeDQe0vky3+MSFCqFoi9S3bIoZ6l5lZOgv85El rb/4zQjCnVLqsj0Si7Dv68hZdKaOzujj1CyIPfJE9su1+LpxjQKKm2H2xVDpLQSpvGQg XQnExKBdtWIWOc4C+ubXG4xFPOb8aUzkMmdD+XCiS2e1pU34CI6gJa3j4AwcLux/zp6j xPtlcIXnSIdAWY7CxsCzas/UFOaW3w6I2kuFH3MCBsIfEZh5rdtQJoL8P+FH+pBwj8xR uakw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=nlVYMMSP2xWTbAi9uYhO2iUBFbCtcGFMf2JOCAezQ90=; b=YxWixRXIywjDdtm34cVsLeFHJZB8mo9Dx61V5+RO3bCHoqTq5kup+NSuzeO3V7hmFX H63WLfVSZmPrZRcPio+VVYh4PRw8g11fowwudgChnwUG30+WQ+WF+8FixlcX0eZL13Cs PYD9qizyCMdg5w89ThaBiTb+u2Kv9ytwfpx0/8meIYk7RB1skaSH/vESDlv9IBkTwnqk sthu/DyOalHEODiyrGMTBdIo2mgOK1XADp3x5Hk+qz2ZFWmDN2O0snPWHtC58PhDp0n1 LEEoRJ5ZwzqJkhz80CkSIxaNeDjrAPJMFwLaPg8/KYpDnKpYgHkM+pyBch4k4ZtK1UWD wHaQ== X-Gm-Message-State: AOAM533R8elywXoUM+KNAcqOEwhzfv6QayRrUnQH5zdPnBQql9fbiYKf pFfxfOTbW+DLKy7cn2mGuNf0hw+AwZA= X-Google-Smtp-Source: ABdhPJwjLwJ9GOzz9TxX9I/+xv9p8HLRvBvXZvoczTZgrEU+eh/1QkELA39vtewkcr28fiE3PnmwbQ== X-Received: by 2002:a05:600c:3556:b0:389:f440:50e6 with SMTP id i22-20020a05600c355600b00389f44050e6mr2355961wmq.159.1647333838486; Tue, 15 Mar 2022 01:43:58 -0700 (PDT) Received: from kepler.. (0526F1FC.dsl.pool.telekom.hu. [5.38.241.252]) by smtp.gmail.com with ESMTPSA id e6-20020a5d5006000000b0020374784350sm15078503wrt.64.2022.03.15.01.43.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 01:43:57 -0700 (PDT) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Juri Lelli , Andy Lutomirski , Mel Gorman , Andrew Morton , Borislav Petkov , Linus Torvalds , Thomas Gleixner Subject: [PATCH 09/15] sched/headers: Introduce kernel/sched/build_policy.c and build multiple .c files there Date: Tue, 15 Mar 2022 09:42:41 +0100 Message-Id: <20220315084247.40783-10-mingo@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220315084247.40783-1-mingo@kernel.org> References: <20220315084247.40783-1-mingo@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Similarly to kernel/sched/build_utility.c, collect all 'scheduling policy' = related source code files into kernel/sched/build_policy.c: kernel/sched/idle.c kernel/sched/rt.c kernel/sched/cpudeadline.c kernel/sched/pelt.c kernel/sched/cputime.c kernel/sched/deadline.c With the exception of fair.c, which we continue to build as a separate file for build efficiency and parallelism reasons. Signed-off-by: Ingo Molnar Reviewed-by: Peter Zijlstra --- kernel/sched/Makefile | 2 +- kernel/sched/build_policy.c | 29 +++++++++++++++++++++++++++++ kernel/sched/cpudeadline.c | 1 - kernel/sched/cputime.c | 1 - kernel/sched/deadline.c | 2 -- kernel/sched/idle.c | 3 --- kernel/sched/pelt.c | 4 ---- kernel/sched/rt.c | 3 --- kernel/sched/sched.h | 8 ++++++++ 9 files changed, 38 insertions(+), 15 deletions(-) diff --git a/kernel/sched/Makefile b/kernel/sched/Makefile index 4a4785cb3cd2..976092b7bd45 100644 --- a/kernel/sched/Makefile +++ b/kernel/sched/Makefile @@ -30,5 +30,5 @@ endif # obj-y +=3D core.o obj-y +=3D fair.o +obj-y +=3D build_policy.o obj-y +=3D build_utility.o -obj-y +=3D idle.o rt.o deadline.o cputime.o cpudeadline.o pelt.o diff --git a/kernel/sched/build_policy.c b/kernel/sched/build_policy.c new file mode 100644 index 000000000000..6bb384ddcfab --- /dev/null +++ b/kernel/sched/build_policy.c @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * These are the scheduling policy related scheduler files, built + * in a single compilation unit for build efficiency reasons. + * + * ( Incidentally, the size of the compilation unit is roughly + * comparable to core.c and fair.c, the other two big + * compilation units. This helps balance build time, while + * coalescing source files to amortize header inclusion + * cost. ) + * + * core.c and fair.c are built separately. + */ + +#include "sched.h" +#include "pelt.h" + +#include "idle.c" + +#include "rt.c" + +#ifdef CONFIG_SMP +# include "cpudeadline.c" +# include "pelt.c" +#endif + +#include "cputime.c" +#include "deadline.c" + diff --git a/kernel/sched/cpudeadline.c b/kernel/sched/cpudeadline.c index 0e196f0de492..02d970a879ed 100644 --- a/kernel/sched/cpudeadline.c +++ b/kernel/sched/cpudeadline.c @@ -6,7 +6,6 @@ * * Author: Juri Lelli */ -#include "sched.h" =20 static inline int parent(int i) { diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c index b7ec42732b28..78a233d43757 100644 --- a/kernel/sched/cputime.c +++ b/kernel/sched/cputime.c @@ -2,7 +2,6 @@ /* * Simple CPU accounting cgroup controller */ -#include "sched.h" =20 #ifdef CONFIG_IRQ_TIME_ACCOUNTING =20 diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index d2c072b0ef01..fca2d7de4d3d 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -15,8 +15,6 @@ * Michael Trimarchi , * Fabio Checconi */ -#include "sched.h" -#include "pelt.h" =20 struct dl_bandwidth def_dl_bandwidth; =20 diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c index d17b0a5ce6ac..8f8b5020e76a 100644 --- a/kernel/sched/idle.c +++ b/kernel/sched/idle.c @@ -6,9 +6,6 @@ * (NOTE: these are not related to SCHED_IDLE batch scheduled * tasks which are handled in sched/fair.c ) */ -#include "sched.h" - -#include =20 /* Linker adds these: start and end of __cpuidle functions */ extern char __cpuidle_text_start[], __cpuidle_text_end[]; diff --git a/kernel/sched/pelt.c b/kernel/sched/pelt.c index a554e3bbab2b..0f310768260c 100644 --- a/kernel/sched/pelt.c +++ b/kernel/sched/pelt.c @@ -24,10 +24,6 @@ * Author: Vincent Guittot */ =20 -#include -#include "sched.h" -#include "pelt.h" - /* * Approximate: * val * y^n, where y^32 ~=3D 0.5 (~1 scheduling period) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 7b4f4fbbb404..ff4c044aed12 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -3,9 +3,6 @@ * Real-Time Scheduling Class (mapped to the SCHED_FIFO and SCHED_RR * policies) */ -#include "sched.h" - -#include "pelt.h" =20 int sched_rr_timeslice =3D RR_TIMESLICE; int sysctl_sched_rr_timeslice =3D (MSEC_PER_SEC / HZ) * RR_TIMESLICE; diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 79c7a8a2be65..f7d10b98e911 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -113,8 +114,11 @@ #include #include #include +#include +#include #include #include +#include #include #include #include @@ -126,12 +130,16 @@ #include #include #include +#include #include #include +#include +#include #include #include #include #include +#include #include #include #include --=20 2.32.0 From nobody Mon Jun 22 23:53:34 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 A1B82C433F5 for ; Tue, 15 Mar 2022 08:44:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346170AbiCOIpp (ORCPT ); Tue, 15 Mar 2022 04:45:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346127AbiCOIpN (ORCPT ); Tue, 15 Mar 2022 04:45:13 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2107B4D268 for ; Tue, 15 Mar 2022 01:44:01 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id r6so27369252wrr.2 for ; Tue, 15 Mar 2022 01:44:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Jb1wu8pDJ30xgS1p+JPjCnyezWwWH0sm2Zu2NeRcVsA=; b=hiISU3x0fZ/PLJtBtmT6kraBpYArjPnEZTjKqMEXYBVi5vD1bSvfR0TaB/fakO7xaC 308VW9fw5gqwyPOt5aALo93mgIX2QyXIYmVlguXGPRmUtqPYdoPgIFQ3y2HdVGLTloSq mTrKAnB7pyf9ve12QGtD8JzTa7Rz2+jfFaaQm+fGnqPJZDcsjGdBljgQX52NIurOofxF CYE7VD6o+kAqImxYsLZushXLomhlw1q9LKAR5WEBct8qmvRa9PlqHdla5JH2IEF1rvSj j8hOjMqI4sPov4P5YgjqR9KBmEi/YwYXac+uqVFkFO1Uh8fUd4C0YEw1KPBYGMaQ5awE 6A0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Jb1wu8pDJ30xgS1p+JPjCnyezWwWH0sm2Zu2NeRcVsA=; b=1o+dD1O8hAn1UX/sYpNcDQcJOXXQNudeVmdcvCQPTFIkvyvQxNUmStUKiQ5g6V/h7V /Vjp1QCFGfBZcWKO2OBR7VB/ExsoDOYWJRwk9UL24xLQAokKdIWtGlwOmDgMloJFrOuO YaaHL2PEvybW3BspH6j0lICdmkSc0i33GrqYqcXMVoBuosWUcTREgVTI1Uhix9fioMN3 TWevK1UZk9pBmECzel7lQAiV9MFi5JsitwGrsHu1BZZMxBumRMoTk943A63IRYIuIKSX VdI/+BcVlaNvjGjB/LZmELvUmZxtPwDzJMb5Q8VxmLIGAWr+xBLT9bxA/VKpxoYz9kfY pkkQ== X-Gm-Message-State: AOAM533zmksvC8PUSScDqIq8berkvhBJ765FeKMVPuMmIyZI2iZDgEG4 LTVgKV4ZsLWh6Xs7WGmz5hd5kYm31DI= X-Google-Smtp-Source: ABdhPJy1HhMqexQddfHuV8F1Eb/P08ZosKRgUc5SqbEdhbVmTksB7SahuD4T6EBfFmXjL6+Ok1+itA== X-Received: by 2002:a5d:678f:0:b0:1f0:2471:5a93 with SMTP id v15-20020a5d678f000000b001f024715a93mr19670842wru.164.1647333839676; Tue, 15 Mar 2022 01:43:59 -0700 (PDT) Received: from kepler.. (0526F1FC.dsl.pool.telekom.hu. [5.38.241.252]) by smtp.gmail.com with ESMTPSA id e6-20020a5d5006000000b0020374784350sm15078503wrt.64.2022.03.15.01.43.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 01:43:59 -0700 (PDT) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Juri Lelli , Andy Lutomirski , Mel Gorman , Andrew Morton , Borislav Petkov , Linus Torvalds , Thomas Gleixner Subject: [PATCH 10/15] sched/headers: Standardize kernel/sched/sched.h header dependencies Date: Tue, 15 Mar 2022 09:42:42 +0100 Message-Id: <20220315084247.40783-11-mingo@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220315084247.40783-1-mingo@kernel.org> References: <20220315084247.40783-1-mingo@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 6bb384ddcfab..9a169b2f97e6 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 31216ce0b4b3..8b2b199983bf 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 ef946123e9af..22de53710ee9 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 16874e112fe6..7391c9287503 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 f7d10b98e911..f255ec2afeca 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 edc0d13fc61b..a0df79e6038c 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 /* --=20 2.32.0 From nobody Mon Jun 22 23:53:34 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 3705AC433F5 for ; Tue, 15 Mar 2022 08:44:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346164AbiCOIp7 (ORCPT ); Tue, 15 Mar 2022 04:45:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346139AbiCOIpU (ORCPT ); Tue, 15 Mar 2022 04:45:20 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DE7D4D275 for ; Tue, 15 Mar 2022 01:44:02 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id r10so27820450wrp.3 for ; Tue, 15 Mar 2022 01:44:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fCdjHXVX+BAOQ2yVcrI7SyvzKpdkdL/11OuCDg14XLo=; b=pIoE/HpKDdHiDncMIJAbB18zsxa2+6s5W62t4oa1Y3KZPU1hnm3RlyVbVFTafXOiFi 9uMb9qYgjpDw0JoGpR/Bvmu6DOK8h45ntkOUgnksb63A26Z4bfTPnvW7IbFGwXRUfegE Jq1inoXxj5oFK7e4YRXs9Q46XfSoI+R3/tPl+v5mwGklXKn+17+msaWm9cZLSigUs3jz mdJ5uFQ+IQWdsrFovLn5Z7G/1xIr2dmsqqauhcIJEm0keuqGn6d93f1WbkbAdnXZMLYN VISi88HThFwyPNMekw2oxz7u7PaF5xUw5lCJaH34H99c7XWCaVC7G7sGZ8mBe1sWqLNy 1JaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=fCdjHXVX+BAOQ2yVcrI7SyvzKpdkdL/11OuCDg14XLo=; b=Hd8rBZH++XQdZq6pEmsWraMZWsPU4NLK3gOIYL+1uJOVKAiRsPs8+7T08Utqm+OeN9 e4OTYRiE9Fhg9ewYBt1ayDnrPu4Z8NJMPEAqfL5Al/4Xxf1Nf2ozZxUBuylGH6F/gcdc mtYxrdIVGXftJBWLOX+GaRswi+qtPoLSwajp743iJvKJwYTLDyyW7xfi9rUho9BmTrt4 qZO00j+I0UT1PJtIEMY2oFF+F2KJUYurgyKgDAd0VOdCvbHx9jRzravYGhNRxwhs3JVw XZ81nnu25ltlJxSPbnu1ynx46TyzJ8reQljTIWvYd1UMB/BtyeIUhZ6snyd708b9ElHh xysA== X-Gm-Message-State: AOAM533pQ+Qt6uSox8VgzoaeS+UTGB9P6UL8b9yWvrEhNMbOvC1UJ1nt SJhaThFyyeZXCBZNemWShICvGnbfiWo= X-Google-Smtp-Source: ABdhPJyemeY0/o2nSnMGQ5BDTo0VP4OpLZAfb/wOMSpDMHfsSXqvpvYlGzRedJ6ux92PFPJDYOPQtw== X-Received: by 2002:a5d:6d8a:0:b0:203:6efe:7961 with SMTP id l10-20020a5d6d8a000000b002036efe7961mr19866602wrs.367.1647333840864; Tue, 15 Mar 2022 01:44:00 -0700 (PDT) Received: from kepler.. (0526F1FC.dsl.pool.telekom.hu. [5.38.241.252]) by smtp.gmail.com with ESMTPSA id e6-20020a5d5006000000b0020374784350sm15078503wrt.64.2022.03.15.01.43.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 01:44:00 -0700 (PDT) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Juri Lelli , Andy Lutomirski , Mel Gorman , Andrew Morton , Borislav Petkov , Linus Torvalds , Thomas Gleixner Subject: [PATCH 11/15] sched/headers: Reorganize, clean up and optimize kernel/sched/core.c dependencies Date: Tue, 15 Mar 2022 09:42:43 +0100 Message-Id: <20220315084247.40783-12-mingo@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220315084247.40783-1-mingo@kernel.org> References: <20220315084247.40783-1-mingo@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Use all generic headers from kernel/sched/sched.h that are required for it to build. Sort the sections alphabetically. Signed-off-by: Ingo Molnar Reviewed-by: Peter Zijlstra --- kernel/sched/core.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++++++++---------- 1 file changed, 70 insertions(+), 11 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 22de53710ee9..5eaa4211d93c 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6,7 +6,73 @@ * * Copyright (C) 1991-2002 Linus Torvalds */ +#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_PREEMPT_DYNAMIC +# include +#endif + +#include + +#include +#include + #define CREATE_TRACE_POINTS +#include #include #undef CREATE_TRACE_POINTS =20 @@ -14,22 +80,15 @@ #include "stats.h" #include "autogroup.h" =20 -#include -#include -#include -#include -#include - -#include -#include +#include "autogroup.h" +#include "pelt.h" +#include "smp.h" +#include "stats.h" =20 #include "../workqueue_internal.h" #include "../../fs/io-wq.h" #include "../smpboot.h" =20 -#include "pelt.h" -#include "smp.h" - /* * Export tracepoints that act as a bare tracehook (ie: have no trace event * associated with them) to allow external modules to probe them. --=20 2.32.0 From nobody Mon Jun 22 23:53:34 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 24303C433F5 for ; Tue, 15 Mar 2022 08:45:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346274AbiCOIqL (ORCPT ); Tue, 15 Mar 2022 04:46:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346145AbiCOIpV (ORCPT ); Tue, 15 Mar 2022 04:45:21 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E4944CD7D for ; Tue, 15 Mar 2022 01:44:03 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id p9so27768567wra.12 for ; Tue, 15 Mar 2022 01:44:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KY1G/hNwjUlBePE2ZVsqVFVqg40+RQ73iJFBjzwX3UY=; b=VaQCzPFvc6gtrXjrOVTaHng32EKCgrpOKFRwKXdGHL3vjaqvp9oU8WJuCtXcyeSei8 2j1NVgnIvi/OITGXFHHtvLlc4MZMUIU/Cxj3NrK9+jFTBMZRg2TaU4qOBVHK6W7TlcBn NBWD3a5kxQXCVJpkCBzDndfp+6Em6F8x7yDxoLELdupn3YolG1aoy95JjHXQUZooZ4P1 tVpN6HofIrXiDObrbGASiTx6PWZNxzLaNVVq3yF9H/LhG0aDHmiB7ka4ljpUJiN38v6Y ldWg/Y20y7xR723ld7AxMNcyrX2neBJi/prA44z0pXR64nFyzW5AMmPhHbjPdGAFQ1Dw PtBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=KY1G/hNwjUlBePE2ZVsqVFVqg40+RQ73iJFBjzwX3UY=; b=l2uTHgVZ65MEfv61YYEJy3t/ug/wupihpkFRQ2lfHxRLTU5CyYKUojHGuDEYIVgguT n9jWB2oFvR1RhOnDHfrr7C9BgDcWsmHaH9ul/XzarryO6IWe1COM2e56hacSNQxl9MQT sQplZ3beV3kmN+RNROMOFEqT04U3KQ27ICGWeMx64+w21E6kLvBRZx/HS/kXi6rnQC/n 8l76SOiKWklWvAhHa2blbF0QlZIBE9pNdNB9UIbm5fb+MxQychcMqFQwF5UEnE+coa8/ U59nHutk2/DJgEYwgXndY95kWjGDjAmL6GIvSjKdyqh5DL+rvBRZQPS6y9PU8WWqSBZy 7ImA== X-Gm-Message-State: AOAM532tnj8NZCkOn0JhjG6dd2suZB6Z1nh3C1Kgs9nHdPM6Dd7Z7FOY HIyVmIlsdHvGApcvA8LROUt4Anc9IuI= X-Google-Smtp-Source: ABdhPJyiC5sLyH+DNjtIOlZBRK900kTKx50/7PnRjNGtmI2TrXF4WnahcgPd2dAjf+zzEaTZk+QnnQ== X-Received: by 2002:a5d:62cf:0:b0:203:d97c:3bae with SMTP id o15-20020a5d62cf000000b00203d97c3baemr192727wrv.237.1647333841905; Tue, 15 Mar 2022 01:44:01 -0700 (PDT) Received: from kepler.. (0526F1FC.dsl.pool.telekom.hu. [5.38.241.252]) by smtp.gmail.com with ESMTPSA id e6-20020a5d5006000000b0020374784350sm15078503wrt.64.2022.03.15.01.44.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 01:44:01 -0700 (PDT) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Juri Lelli , Andy Lutomirski , Mel Gorman , Andrew Morton , Borislav Petkov , Linus Torvalds , Thomas Gleixner Subject: [PATCH 12/15] sched/headers: Reorganize, clean up and optimize kernel/sched/fair.c dependencies Date: Tue, 15 Mar 2022 09:42:44 +0100 Message-Id: <20220315084247.40783-13-mingo@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220315084247.40783-1-mingo@kernel.org> References: <20220315084247.40783-1-mingo@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Use all generic headers from kernel/sched/sched.h that are required for it to build. Sort the sections alphabetically. Signed-off-by: Ingo Molnar Reviewed-by: Peter Zijlstra --- kernel/sched/fair.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 7391c9287503..89d21fda106c 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -20,6 +20,35 @@ * Adaptive scheduling granularity, math enhancements by Peter Zijlstra * Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra */ +#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 "sched.h" #include "stats.h" #include "autogroup.h" --=20 2.32.0 From nobody Mon Jun 22 23:53:34 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 96D40C433EF for ; Tue, 15 Mar 2022 08:44:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346197AbiCOIqH (ORCPT ); Tue, 15 Mar 2022 04:46:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346163AbiCOIpn (ORCPT ); Tue, 15 Mar 2022 04:45:43 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63B0A45AC1 for ; Tue, 15 Mar 2022 01:44:04 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id i8so27806751wrr.8 for ; Tue, 15 Mar 2022 01:44:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=77pcSomeQnKShKXrvlesy60okMS3aTQ/Iv6cZiSzCOs=; b=TVJar/qlM8CWQr0Qf2F+gKbWJ+N5OOqoxwsklwdsBn6/BNPUEIxq5kASw1Nh/7Z2qV pXx0PPdF2iqsr41GDFVst36rJLYrMzuHy4Q0MRRGVd7FlJhsFrJ0Cfr9yPCYSzSzas7/ qa8PxPa7XdBbw/w6cN4KJ4fDTS1/dfdg8OdxlZg65zLRQCbT3IYX5+8GftjyJ2rdkLuh GHVk6N2VmIFaRFNdRlTCy6DghvYEetmuiIixw5Dxvl5kLAENyF6lC/KaUdDJvBuKIEs8 emGb1GqXlgGBW7Qjyb2mKEVDwjEafq3MyyWBRN82m6sukqO6acHNl5zmrth/wcAtx9HU BTaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=77pcSomeQnKShKXrvlesy60okMS3aTQ/Iv6cZiSzCOs=; b=atVqDhx8MzM+9Extp/P8FdWCWz/ZARIaIVpA/6pX2Xh78HCiikHALqKyi/g87eAt79 5ms60C4b2Bkz93GyeA+7cDAABiYnRe6S5j4aT8OWqCt6fXm7vQCkvHH8x5kanmuKCPVL mHqze31RRcQYg87pATCTRzOtSJuEGcVpcDTQa2p75gQhH76VrC+4YOUKazGqTyp5acHp Ngctse9QwquIDw56Asxnhz6ryVMZMPzCRYMTKfKM32XftblErAJ0IP71OsYMQEmaQJk2 JqHoAgtyIcJ8UYe7aOokxnc/FMBUyshiWhiZbgkYaCfLPRpJhzIRoCQs2VJ7uTpztg8t gArg== X-Gm-Message-State: AOAM533BPwa7Ghe599VywF4YSmprvOdcBsfd5AA0wiHhYyZ7TSZD7KHX V9BS3azxeHo7ByDWm70xQNoMubzCorQ= X-Google-Smtp-Source: ABdhPJzWKBkPN97RucCYLQEd/Fnc8uNqwHg38moB8k4EYlSdXh/1Ejv6Pl6FdJLYnQI9CHBkAyPynA== X-Received: by 2002:a5d:4dc5:0:b0:1f0:73e4:2cd9 with SMTP id f5-20020a5d4dc5000000b001f073e42cd9mr19693711wru.212.1647333843026; Tue, 15 Mar 2022 01:44:03 -0700 (PDT) Received: from kepler.. (0526F1FC.dsl.pool.telekom.hu. [5.38.241.252]) by smtp.gmail.com with ESMTPSA id e6-20020a5d5006000000b0020374784350sm15078503wrt.64.2022.03.15.01.44.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 01:44:02 -0700 (PDT) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Juri Lelli , Andy Lutomirski , Mel Gorman , Andrew Morton , Borislav Petkov , Linus Torvalds , Thomas Gleixner Subject: [PATCH 13/15] sched/headers: Reorganize, clean up and optimize kernel/sched/build_policy.c dependencies Date: Tue, 15 Mar 2022 09:42:45 +0100 Message-Id: <20220315084247.40783-14-mingo@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220315084247.40783-1-mingo@kernel.org> References: <20220315084247.40783-1-mingo@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Use all generic headers from kernel/sched/sched.h that are required for it to build. Sort the sections alphabetically. Signed-off-by: Ingo Molnar Reviewed-by: Peter Zijlstra --- kernel/sched/build_policy.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/kernel/sched/build_policy.c b/kernel/sched/build_policy.c index 9a169b2f97e6..a2e4023771a0 100644 --- a/kernel/sched/build_policy.c +++ b/kernel/sched/build_policy.c @@ -12,12 +12,36 @@ * core.c and fair.c are built separately. */ =20 +/* Headers: */ +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef CONFIG_PARAVIRT +# include +#endif + +#include + #include "sched.h" =20 #include "autogroup.h" #include "stats.h" #include "pelt.h" =20 +/* Source code modules: */ + #include "idle.c" =20 #include "rt.c" --=20 2.32.0 From nobody Mon Jun 22 23:53:34 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 BD50AC433F5 for ; Tue, 15 Mar 2022 08:45:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346219AbiCOIqR (ORCPT ); Tue, 15 Mar 2022 04:46:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346176AbiCOIpn (ORCPT ); Tue, 15 Mar 2022 04:45:43 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C14F84D613 for ; Tue, 15 Mar 2022 01:44:05 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id m42-20020a05600c3b2a00b00382ab337e14so952369wms.3 for ; Tue, 15 Mar 2022 01:44:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FHw7YrqhEBArbZ7ERU7QUTduUXqoCrfJEvjtPS1rJu4=; b=IhqY7JQbledD2CgBRoKqX6srm+u9SvX8fwHSzDGvklTMtGf3XBZuIxUND7SLKEAm6i 7SGtcRLr7dmxbOYc5FuKgwGqq3nYqzGd883B+513h59ZiQyPGxsxytlbKJqBlLDoLInG R1HardsA0QVFOfnrn7Ev2d8aJODVVXN+IZVykB4H8zRjmC07kSF8BMqvnpbYOFq8HVcb FWEly4AZ56OYGmBXBxiZl/F0wreErXbuIbGttv0IogRzT2lYmD0bzB5s19cFjOqpo3eS dZgHdQEd2GKJrePBUf20ikYmyOIZvMx0LP/lh5meaQTHNvNpJXdFQdSluwO5NxA6pU6a /yMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=FHw7YrqhEBArbZ7ERU7QUTduUXqoCrfJEvjtPS1rJu4=; b=f2/+/kliudK8UUZagdym8UeEs5znliqwfeCzDYfQvU1F52OKKnb5rBxUjSssFGTRyK esBXEROTBTAKERTeD8gs2MFrHMY1o7a8CkeNDJRw+iHIxM6lXTgNdJuZP6Pyf+Fo2Kdm IOxtxuenqAESemkmzStQyu62seRi86EFuUPBBXdW8R6ihHYR7miQ3YrEulxeIx/XXVtk HDokUfN2srmscjPFrqxiYKipynRr2mS09IUjFNjmuKZYKjojLApOvif1b37C28Rkp+3K uKBC6Ovzw3PHsDy67tXi3mcgyTwHHJ4FGRfIfgBTIPp2ElPThx2tQk4VxbmNxuXT9Csf oaKA== X-Gm-Message-State: AOAM532kvWUyivqRaFxoG89GMGScTp1XFK7YWNK/wvVFc71AD3Ro6TKx eBdC8acUQ4i9v3vAm5kT0jn2sVl6H/k= X-Google-Smtp-Source: ABdhPJytDh2neTgked42IY+RyFQq1dv0P2hyPJUYBM/8U9EBEyE/NmaceboOa1zNU5fh3lIBbQW4eg== X-Received: by 2002:a1c:1941:0:b0:38b:4af1:49f8 with SMTP id 62-20020a1c1941000000b0038b4af149f8mr2110200wmz.156.1647333844235; Tue, 15 Mar 2022 01:44:04 -0700 (PDT) Received: from kepler.. (0526F1FC.dsl.pool.telekom.hu. [5.38.241.252]) by smtp.gmail.com with ESMTPSA id e6-20020a5d5006000000b0020374784350sm15078503wrt.64.2022.03.15.01.44.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 01:44:03 -0700 (PDT) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Juri Lelli , Andy Lutomirski , Mel Gorman , Andrew Morton , Borislav Petkov , Linus Torvalds , Thomas Gleixner Subject: [PATCH 14/15] sched/headers: Reorganize, clean up and optimize kernel/sched/build_utility.c dependencies Date: Tue, 15 Mar 2022 09:42:46 +0100 Message-Id: <20220315084247.40783-15-mingo@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220315084247.40783-1-mingo@kernel.org> References: <20220315084247.40783-1-mingo@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Use all generic headers from kernel/sched/sched.h that are required for it to build. Sort the sections alphabetically. Signed-off-by: Ingo Molnar Reviewed-by: Peter Zijlstra --- kernel/sched/build_utility.c | 43 ++++++++++++++++++++++++++++++++++++++++= +-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/kernel/sched/build_utility.c b/kernel/sched/build_utility.c index 8b2b199983bf..bc2f4d648209 100644 --- a/kernel/sched/build_utility.c +++ b/kernel/sched/build_utility.c @@ -9,14 +9,53 @@ * coalescing source files to amortize header inclusion * cost. ) */ +#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 +#include =20 #include "sched.h" #include "sched-pelt.h" #include "stats.h" #include "autogroup.h" =20 -#include - #include "clock.c" =20 #ifdef CONFIG_CGROUP_CPUACCT --=20 2.32.0 From nobody Mon Jun 22 23:53:34 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 0EE98C433EF for ; Tue, 15 Mar 2022 08:45:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346168AbiCOIqV (ORCPT ); Tue, 15 Mar 2022 04:46:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346184AbiCOIpn (ORCPT ); Tue, 15 Mar 2022 04:45:43 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE0674D625 for ; Tue, 15 Mar 2022 01:44:06 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id 7-20020a05600c228700b00385fd860f49so1047779wmf.0 for ; Tue, 15 Mar 2022 01:44:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HtIgN6AdT+17GwfQORoopmuViWKlchoqVYSRUx3tKDQ=; b=WWTl831h1hLrRHyCXf3DytETojLSGftQmq77K3b9N6eMDev4tsL2JkFygqgLTWg0T8 SSYTmW86s5aeqymS+/bdzXS5jBTr9c9k+xMjvYog9Ta3A7u8knfZufuQYCLqCV2J+MDj /y94pG/ew0r8fACxrEUa/6vOd/l7uofCIGpV9cDAMTvSfFTVaPRVdHLLIBMCdU7ABEfR DyuMGuIAMT+warBnYOcVmWtWqLYWeD6Fk60xMim05nVz/9FuXSsXWgSofWlP9/nWIUM6 y5JDj9wiBzcupoK1ANdeEWi+dPnkj7ntUdEwaJhrq0Rptt661684HD8VSF2U+YbLYdCC bd4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=HtIgN6AdT+17GwfQORoopmuViWKlchoqVYSRUx3tKDQ=; b=h/Qf47MAfuHAqvjvhPBv333VChmFSHOGKm0VfhuXv4AbDSFKiwhq2AIfF0xbHQUyeT cQQho0gBhElaZMP21SAhREdwsYhZnBe9Re2AptL+MNiQaaGAJD1s9c3z0LBLvvK0T+2n 5xgC2AExvB1m3X0/tPZ9vMjdgP4Ib7Pnm4y/UHoN0mM3uhqPmYakVH4HowkR9dMejYz9 nfYdi8FJxkRC09dJanugTlTeoBj50CipF1pMmVBifqc+F1H0zJo33qJM9pwYUWpcknYX ogeCEgBdUV8+fuqqQ5oblg7dCspgXW16agIZ7yHwpkBvtTILrE+qQ0wtoUypZNFpC3Z8 wkGg== X-Gm-Message-State: AOAM53374RhRap1Obc288uUydnsxOhfcdcC5PldXlbSXrnEmdGe3ieJO uGYZUZKHMdyduTB5F+Dc1kEXMBWw18U= X-Google-Smtp-Source: ABdhPJzI+uQwQtzHEiBagL8inR3+Kp0cko+5UjrbOcyh997XWjdXRe67i8cO6jBrnWrzU4G7Ulz26g== X-Received: by 2002:a05:600c:3203:b0:381:b544:7970 with SMTP id r3-20020a05600c320300b00381b5447970mr2354447wmp.144.1647333845370; Tue, 15 Mar 2022 01:44:05 -0700 (PDT) Received: from kepler.. (0526F1FC.dsl.pool.telekom.hu. [5.38.241.252]) by smtp.gmail.com with ESMTPSA id e6-20020a5d5006000000b0020374784350sm15078503wrt.64.2022.03.15.01.44.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 01:44:04 -0700 (PDT) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Juri Lelli , Andy Lutomirski , Mel Gorman , Andrew Morton , Borislav Petkov , Linus Torvalds , Thomas Gleixner Subject: [PATCH 15/15] sched/headers: Reorganize, clean up and optimize kernel/sched/sched.h dependencies Date: Tue, 15 Mar 2022 09:42:47 +0100 Message-Id: <20220315084247.40783-16-mingo@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220315084247.40783-1-mingo@kernel.org> References: <20220315084247.40783-1-mingo@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 a2e4023771a0..e0104b45029a 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 bc2f4d648209..eec0849b2aae 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 f255ec2afeca..0d4217965561 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 a0df79e6038c..baa839c1ba96 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; --=20 2.32.0