Commit Graph

6 Commits

Author SHA1 Message Date
Phil Auld 5215e85db0 sched/headers: Remove duplicate header inclusions
JIRA: https://issues.redhat.com/browse/RHEL-25535

commit d4d6596b43868a1e05fe5b047e73c3aff96444c6
Author: Yu Liao <liaoyu15@huawei.com>
Date:   Wed Aug 2 10:15:01 2023 +0800

    sched/headers: Remove duplicate header inclusions

    <linux/psi.h> and "autogroup.h" are included twice, remove the duplicate header
    inclusion.

    Signed-off-by: Yu Liao <liaoyu15@huawei.com>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Link: https://lore.kernel.org/r/20230802021501.2511569-1-liaoyu15@huawei.com

Signed-off-by: Phil Auld <pauld@redhat.com>
2024-04-08 09:40:56 -04:00
Phil Auld bb91a8ff6d sched: Fix missing prototype warnings
Bugzilla: https://bugzilla.redhat.com/2120671

commit d664e399128bd78b905ff480917e2c2d4949e101
Author: Thomas Gleixner <tglx@linutronix.de>
Date:   Wed Apr 13 15:31:02 2022 +0200

    sched: Fix missing prototype warnings

    A W=1 build emits more than a dozen missing prototype warnings related to
    scheduler and scheduler specific includes.

    Reported-by: kernel test robot <lkp@intel.com>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Link: https://lore.kernel.org/r/20220413133024.249118058@linutronix.de

Signed-off-by: Phil Auld <pauld@redhat.com>
2022-09-08 11:25:07 -04:00
Phil Auld a66eec0258 sched/headers: Reorganize, clean up and optimize kernel/sched/sched.h dependencies
Bugzilla: http://bugzilla.redhat.com/2069275

commit 4ff8f2ca6ccd9e0cc5665d09f86d631b3ae3a14c
Author: Ingo Molnar <mingo@kernel.org>
Date:   Tue Feb 22 14:51:58 2022 +0100

    sched/headers: Reorganize, clean up and optimize kernel/sched/sched.h dependencies

    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 cycle           ( +-  0.00% )
     |    87,637,847,671      cycles                    #    3.959 GHz                      ( +-  0.30% )
     |         22,136.96 msec cpu-clock                 #    7.499 CPUs utilized            ( +-  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 cycle           ( +-  0.00% )
     |    34,234,322,038      cycles                    #    3.946 GHz                      ( +-  0.31% )
     |          8,675.81 msec cpu-clock                 #    3.053 CPUs utilized            ( +-  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 <mingo@kernel.org>
    Reviewed-by: Peter Zijlstra <peterz@infradead.org>

Signed-off-by: Phil Auld <pauld@redhat.com>
2022-04-11 17:38:23 -04:00
Phil Auld 693dae94be sched/headers: Reorganize, clean up and optimize kernel/sched/build_utility.c dependencies
Bugzilla: http://bugzilla.redhat.com/2069275

commit e81daa7b6489e9810fa699c5104c6fd500e64fb8
Author: Ingo Molnar <mingo@kernel.org>
Date:   Mon Jul 19 12:43:51 2021 +0200

    sched/headers: Reorganize, clean up and optimize kernel/sched/build_utility.c dependencies

    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 <mingo@kernel.org>
    Reviewed-by: Peter Zijlstra <peterz@infradead.org>

Signed-off-by: Phil Auld <pauld@redhat.com>
2022-04-11 17:38:23 -04:00
Phil Auld b0b1db90ca sched/headers: Standardize kernel/sched/sched.h header dependencies
Bugzilla: http://bugzilla.redhat.com/2069275

commit b9e9c6ca6e54b5d58a57663f76c5cb33c12ea98f
Author: Ingo Molnar <mingo@kernel.org>
Date:   Sun Feb 13 08:19:43 2022 +0100

    sched/headers: Standardize kernel/sched/sched.h header dependencies

    kernel/sched/sched.h is a weird mix of ad-hoc headers included
    in the middle of the header.

    Two of them rely on being included in the middle of kernel/sched/sched.h,
    due to definitions they require:

     - "stat.h" needs the rq definitions.
     - "autogroup.h" needs the task_group definition.

    Move the inclusion of these two files out of kernel/sched/sched.h, and
    include them in all files that require them.

    Move of the rest of the header dependencies to the top of the
    kernel/sched/sched.h file.

    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Reviewed-by: Peter Zijlstra <peterz@infradead.org>

Signed-off-by: Phil Auld <pauld@redhat.com>
2022-04-11 17:38:22 -04:00
Phil Auld deee3a961c sched/headers: Introduce kernel/sched/build_utility.c and build multiple .c files there
Bugzilla: http://bugzilla.redhat.com/2069275

commit 801c141955108fb7cf1244dda76e6de8b16fd3ae
Author: Ingo Molnar <mingo@kernel.org>
Date:   Tue Feb 22 13:23:24 2022 +0100

    sched/headers: Introduce kernel/sched/build_utility.c and build multiple .c files there

    Collect all utility functionality source code files into a single kernel/sched/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 units into
    a single build unit.

    The build time of build_utility.c also roughly matches the build time of core.c and
    fair.c - allowing better load-balancing of scheduler-only rebuilds.

    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Reviewed-by: Peter Zijlstra <peterz@infradead.org>

Signed-off-by: Phil Auld <pauld@redhat.com>
2022-04-11 17:38:21 -04:00