public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/15] sched/headers: Optimize scheduler build time
@ 2022-03-15  8:42 Ingo Molnar
  2022-03-15  8:42 ` [PATCH 01/15] sched/headers: Fix header to build standalone: <linux/sched_clock.h> Ingo Molnar
                   ` (14 more replies)
  0 siblings, 15 replies; 18+ messages in thread
From: Ingo Molnar @ 2022-03-15  8:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Zijlstra, Vincent Guittot, Dietmar Eggemann, Juri Lelli,
	Andy Lutomirski, Mel Gorman, Andrew Morton, Borislav Petkov,
	Linus Torvalds, Thomas Gleixner

Optimize the kernel scheduler build time by organizing the code into
larger build units. This cuts CPU usage by 60%.

These patches originate from the fast-headers tree.

The numbers:

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.

Ingo Molnar (15):
  sched/headers: Fix header to build standalone: <linux/sched_clock.h>
  sched/headers: Add header guard to kernel/sched/sched.h
  sched/headers: Add header guard to kernel/sched/stats.h and kernel/sched/autogroup.h
  sched/headers: sched/clock: Mark all functions 'notrace', remove CC_FLAGS_FTRACE build asymmetry
  sched/headers: Add initial new headers as identity mappings
  sched/headers: Fix comment typo in kernel/sched/cpudeadline.c
  sched/headers: Make the <linux/sched/deadline.h> header build standalone
  sched/headers: Introduce kernel/sched/build_utility.c and build multiple .c files there
  sched/headers: Introduce kernel/sched/build_policy.c and build multiple .c files there
  sched/headers: Standardize kernel/sched/sched.h header dependencies
  sched/headers: Reorganize, clean up and optimize kernel/sched/core.c dependencies
  sched/headers: Reorganize, clean up and optimize kernel/sched/fair.c dependencies
  sched/headers: Reorganize, clean up and optimize kernel/sched/build_policy.c dependencies
  sched/headers: Reorganize, clean up and optimize kernel/sched/build_utility.c dependencies
  sched/headers: Reorganize, clean up and optimize kernel/sched/sched.h dependencies

 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/deadline.h              |   2 +
 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/sched_clock.h                 |   2 +
 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 +
 kernel/sched/Makefile                       |  28 +++++-------
 kernel/sched/autogroup.c                    |   3 +-
 kernel/sched/autogroup.h                    |   5 +++
 kernel/sched/build_policy.c                 |  52 ++++++++++++++++++++++
 kernel/sched/build_utility.c                | 109 +++++++++++++++++++++++++++++++++++++++++++++
 kernel/sched/clock.c                        |  44 +++++++++----------
 kernel/sched/completion.c                   |   2 +-
 kernel/sched/core.c                         |  81 +++++++++++++++++++++++++++++-----
 kernel/sched/core_sched.c                   |   3 --
 kernel/sched/cpuacct.c                      |   3 +-
 kernel/sched/cpudeadline.c                  |   3 +-
 kernel/sched/cpufreq.c                      |   3 --
 kernel/sched/cpufreq_schedutil.c            |   7 ---
 kernel/sched/cpupri.c                       |   1 -
 kernel/sched/cputime.c                      |   1 -
 kernel/sched/deadline.c                     |   2 -
 kernel/sched/debug.c                        |   1 -
 kernel/sched/fair.c                         |  31 +++++++++++++
 kernel/sched/idle.c                         |   3 --
 kernel/sched/isolation.c                    |   1 -
 kernel/sched/loadavg.c                      |   1 -
 kernel/sched/membarrier.c                   |   1 -
 kernel/sched/pelt.c                         |   4 --
 kernel/sched/psi.c                          |  15 -------
 kernel/sched/rt.c                           |   3 --
 kernel/sched/sched.h                        | 114 ++++++++++++++++++++++++++----------------------
 kernel/sched/stats.c                        |   1 -
 kernel/sched/stats.h                        |   4 ++
 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 +-
 69 files changed, 407 insertions(+), 163 deletions(-)
 create mode 100644 arch/arm64/include/asm/paravirt_api_clock.h
 create mode 100644 arch/x86/include/asm/paravirt_api_clock.h
 create mode 100644 include/linux/cgroup_api.h
 create mode 100644 include/linux/cpumask_api.h
 create mode 100644 include/linux/fs_api.h
 create mode 100644 include/linux/gfp_api.h
 create mode 100644 include/linux/hashtable_api.h
 create mode 100644 include/linux/hrtimer_api.h
 create mode 100644 include/linux/kobject_api.h
 create mode 100644 include/linux/kref_api.h
 create mode 100644 include/linux/ktime_api.h
 create mode 100644 include/linux/llist_api.h
 create mode 100644 include/linux/lockdep_api.h
 create mode 100644 include/linux/mm_api.h
 create mode 100644 include/linux/mutex_api.h
 create mode 100644 include/linux/perf_event_api.h
 create mode 100644 include/linux/pgtable_api.h
 create mode 100644 include/linux/ptrace_api.h
 create mode 100644 include/linux/rcuwait_api.h
 create mode 100644 include/linux/refcount_api.h
 create mode 100644 include/linux/sched/affinity.h
 create mode 100644 include/linux/sched/cond_resched.h
 create mode 100644 include/linux/sched/posix-timers.h
 create mode 100644 include/linux/sched/rseq_api.h
 create mode 100644 include/linux/sched/task_flags.h
 create mode 100644 include/linux/sched/thread_info_api.h
 create mode 100644 include/linux/seqlock_api.h
 create mode 100644 include/linux/softirq.h
 create mode 100644 include/linux/spinlock_api.h
 create mode 100644 include/linux/swait_api.h
 create mode 100644 include/linux/syscalls_api.h
 create mode 100644 include/linux/u64_stats_sync_api.h
 create mode 100644 include/linux/wait_api.h
 create mode 100644 include/linux/workqueue_api.h
 create mode 100644 kernel/sched/build_policy.c
 create mode 100644 kernel/sched/build_utility.c

-- 
2.32.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2022-08-24 15:50 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-15  8:42 [PATCH 00/15] sched/headers: Optimize scheduler build time Ingo Molnar
2022-03-15  8:42 ` [PATCH 01/15] sched/headers: Fix header to build standalone: <linux/sched_clock.h> Ingo Molnar
2022-03-15  8:42 ` [PATCH 02/15] sched/headers: Add header guard to kernel/sched/sched.h Ingo Molnar
2022-03-15  8:42 ` [PATCH 03/15] sched/headers: Add header guard to kernel/sched/stats.h and kernel/sched/autogroup.h Ingo Molnar
2022-03-15  8:42 ` [PATCH 04/15] sched/headers: sched/clock: Mark all functions 'notrace', remove CC_FLAGS_FTRACE build asymmetry Ingo Molnar
2022-03-15  8:42 ` [PATCH 05/15] sched/headers: Add initial new headers as identity mappings Ingo Molnar
2022-03-15  8:42 ` [PATCH 06/15] sched/headers: Fix comment typo in kernel/sched/cpudeadline.c Ingo Molnar
2022-03-15  8:42 ` [PATCH 07/15] sched/headers: Make the <linux/sched/deadline.h> header build standalone Ingo Molnar
2022-03-15  8:42 ` [PATCH 08/15] sched/headers: Introduce kernel/sched/build_utility.c and build multiple .c files there Ingo Molnar
2022-03-15  8:42 ` [PATCH 09/15] sched/headers: Introduce kernel/sched/build_policy.c " Ingo Molnar
2022-08-23  7:47   ` suhui_kernel
2022-08-24 15:50     ` Thomas Gleixner
2022-03-15  8:42 ` [PATCH 10/15] sched/headers: Standardize kernel/sched/sched.h header dependencies Ingo Molnar
2022-03-15  8:42 ` [PATCH 11/15] sched/headers: Reorganize, clean up and optimize kernel/sched/core.c dependencies Ingo Molnar
2022-03-15  8:42 ` [PATCH 12/15] sched/headers: Reorganize, clean up and optimize kernel/sched/fair.c dependencies Ingo Molnar
2022-03-15  8:42 ` [PATCH 13/15] sched/headers: Reorganize, clean up and optimize kernel/sched/build_policy.c dependencies Ingo Molnar
2022-03-15  8:42 ` [PATCH 14/15] sched/headers: Reorganize, clean up and optimize kernel/sched/build_utility.c dependencies Ingo Molnar
2022-03-15  8:42 ` [PATCH 15/15] sched/headers: Reorganize, clean up and optimize kernel/sched/sched.h dependencies Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox