public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Valentin Schneider <valentin.schneider@arm.com>
To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Cc: mingo@kernel.org, peterz@infradead.org,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	morten.rasmussen@arm.com, Quentin Perret <qperret@google.com>
Subject: [PATCH v6 00/17] sched: Instrument sched domain flags
Date: Mon, 17 Aug 2020 12:29:46 +0100	[thread overview]
Message-ID: <20200817113003.20802-1-valentin.schneider@arm.com> (raw)

Hi,

I've repeatedly stared at an SD flag and asked myself "how should that be
set up in the domain hierarchy anyway?". I figured that if we formalize our
flags zoology a bit, we could also do some runtime assertions on them -
this is what this series is all about.

Patches
=======

The idea is to associate the flags with metaflags that describes how they
should be set in a sched domain hierarchy ("if this SD has it, all its {parents,
children} have it") or how they behave wrt degeneration - details are in the
comments and commit logs. 

The good thing is that the debugging bits go away when CONFIG_SCHED_DEBUG isn't
set. The bad thing is that this replaces SD_* flags definitions with some
unsavoury macros. This is mainly because I wanted to avoid having to duplicate
work between declaring the flags and declaring their metaflags. Conceptually
they are pretty close to the macros used for SCHED_FEAT.

o Patches 1-2 remove a derelict flag and align the arm scheduler topology
  with arm64's
o Patches 3-8 instrument SD flags with metadata and add assertions
o Patches 9-10 are additional topology cleanups
o Patches 11-16 each add a new flag to SD_DEGENERATE_GROUPS_MASK
o Patch 17 leverage the previous 6 patches to further factorize domain
  degeneration

Revisions
=========

v5 -> v6
--------

o Fixed kernelbot warnings
o Tweaked ARM patches changelogs (Ingo)

v4 -> v5
--------

The final git diff between v4 and v5 isn't too big; there is no diff on the
domain degeneration side of things, it has just been split up in more
patches.

o Shuffled the series around to facilitate bisection (Ingo)
  I kept the ARM bits at the start because that was a bit simpler, and in
  the unlikely case that needs to be reverted it won't be too hard.
o Split the degeneration mask tweak into individual commits per new flag
  (Ingo)
o Collected Reviewed-by from Dietmar; since I shuffled the whole lot I
  didn't keep your Tested-by, sorry!

o Turned the SD flags into an enum with automagic power of 2 assignment.
  I poked the dwarves and they assured me the SD flag values haven't
  changed.
o [new patch] Made SD flag debug file output flag names

v3 -> v4
--------

o Reordered the series to have fixes / cleanups first

o Added SD_ASYM_CPUCAPACITY propagation (Quentin)
o Made ARM revert back to the default sched topology (Dietmar)
o Removed SD_SERIALIZE degeneration special case (Peter)

o Made SD_NUMA and SD_SERIALIZE have SDF_NEEDS_GROUPS

  As discussed on v3, I thought this wasn't required, but thinking some more
  about it there can be cases where that changes the current behaviour. For
  instance, in the following wacky triangle:

      0\ 30
      | \
  20  |  2
      | /
      1/ 30

  there are two unique distances thus two NUMA topology levels, however the
  first one for node 2 would have the same span as its child domain and thus
  should be degenerated. If we don't give SD_NUMA and SD_SERIALIZE
  SDF_NEEDS_GROUPS, this domain wouldn't be denegerated since its child
  *doesn't* have either SD_NUMA or SD_SERIALIZE (it's the first NUMA domain),
  and we'd have this weird NUMA domain lingering with a single group.

v2 -> v3
--------

o Reworded comment for SD_OVERLAP (it's about the groups, not the domains)

o Added more flags to the SD degeneration mask
o Added generation of an SD flag mask for the degeneration functions (Peter)

RFC -> v2
---------

o Rebased on top of tip/sched/core
o Aligned wording of comments between flags
o Rectified some flag descriptions (Morten)
o Added removal of SD_SHARE_POWERDOMAIN (Morten)

Valentin Schneider (17):
  ARM, sched/topology: Remove SD_SHARE_POWERDOMAIN
  ARM: Revert back to default scheduler topology.
  sched/topology: Split out SD_* flags declaration to its own file
  sched/topology: Define and assign sched_domain flag metadata
  sched/topology: Verify SD_* flags setup when sched_debug is on
  sched/debug: Output SD flag names rather than their values
  sched/topology: Introduce SD metaflag for flags needing > 1 groups
  sched/topology: Use prebuilt SD flag degeneration mask
  sched/topology: Remove SD_SERIALIZE degeneration special case
  sched/topology: Propagate SD_ASYM_CPUCAPACITY upwards
  sched/topology: Mark SD_PREFER_SIBLING as SDF_NEEDS_GROUPS
  sched/topology: Mark SD_BALANCE_WAKE as SDF_NEEDS_GROUPS
  sched/topology: Mark SD_SERIALIZE as SDF_NEEDS_GROUPS
  sched/topology: Mark SD_ASYM_PACKING as SDF_NEEDS_GROUPS
  sched/topology: Mark SD_OVERLAP as SDF_NEEDS_GROUPS
  sched/topology: Mark SD_NUMA as SDF_NEEDS_GROUPS
  sched/topology: Expand use of SD_DEGENERATE_GROUPS_MASK to flags not
    needing groups

 arch/arm/kernel/topology.c     |  26 ------
 include/linux/sched/sd_flags.h | 156 +++++++++++++++++++++++++++++++++
 include/linux/sched/topology.h |  45 +++++++---
 kernel/sched/debug.c           |  56 +++++++++++-
 kernel/sched/topology.c        |  54 ++++++------
 5 files changed, 268 insertions(+), 69 deletions(-)
 create mode 100644 include/linux/sched/sd_flags.h

--
2.27.0


             reply	other threads:[~2020-08-17 11:30 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-17 11:29 Valentin Schneider [this message]
2020-08-17 11:29 ` [PATCH v6 01/17] ARM, sched/topology: Remove SD_SHARE_POWERDOMAIN Valentin Schneider
2020-08-19 14:02   ` [tip: sched/core] " tip-bot2 for Valentin Schneider
2020-08-17 11:29 ` [PATCH v6 02/17] ARM: Revert back to default scheduler topology Valentin Schneider
2020-08-19 14:02   ` [tip: sched/core] ARM, sched/topology: " tip-bot2 for Valentin Schneider
2020-08-17 11:29 ` [PATCH v6 03/17] sched/topology: Split out SD_* flags declaration to its own file Valentin Schneider
2020-08-19 14:02   ` [tip: sched/core] " tip-bot2 for Valentin Schneider
2020-08-17 11:29 ` [PATCH v6 04/17] sched/topology: Define and assign sched_domain flag metadata Valentin Schneider
2020-08-19 14:02   ` [tip: sched/core] " tip-bot2 for Valentin Schneider
2020-08-17 11:29 ` [PATCH v6 05/17] sched/topology: Verify SD_* flags setup when sched_debug is on Valentin Schneider
2020-08-19 14:02   ` [tip: sched/core] " tip-bot2 for Valentin Schneider
2020-08-17 11:29 ` [PATCH v6 06/17] sched/debug: Output SD flag names rather than their values Valentin Schneider
2020-08-19 14:02   ` [tip: sched/core] " tip-bot2 for Valentin Schneider
2020-08-17 11:29 ` [PATCH v6 07/17] sched/topology: Introduce SD metaflag for flags needing > 1 groups Valentin Schneider
2020-08-19 14:02   ` [tip: sched/core] " tip-bot2 for Valentin Schneider
2020-08-17 11:29 ` [PATCH v6 08/17] sched/topology: Use prebuilt SD flag degeneration mask Valentin Schneider
2020-08-19 14:02   ` [tip: sched/core] " tip-bot2 for Valentin Schneider
2020-08-17 11:29 ` [PATCH v6 09/17] sched/topology: Remove SD_SERIALIZE degeneration special case Valentin Schneider
2020-08-19 14:02   ` [tip: sched/core] " tip-bot2 for Valentin Schneider
2020-08-17 11:29 ` [PATCH v6 10/17] sched/topology: Propagate SD_ASYM_CPUCAPACITY upwards Valentin Schneider
2020-08-19 14:02   ` [tip: sched/core] " tip-bot2 for Valentin Schneider
2020-08-17 11:29 ` [PATCH v6 11/17] sched/topology: Mark SD_PREFER_SIBLING as SDF_NEEDS_GROUPS Valentin Schneider
2020-08-19 14:02   ` [tip: sched/core] " tip-bot2 for Valentin Schneider
2020-08-17 11:29 ` [PATCH v6 12/17] sched/topology: Mark SD_BALANCE_WAKE " Valentin Schneider
2020-08-19 14:02   ` [tip: sched/core] " tip-bot2 for Valentin Schneider
2020-08-17 11:29 ` [PATCH v6 13/17] sched/topology: Mark SD_SERIALIZE " Valentin Schneider
2020-08-19 14:02   ` [tip: sched/core] " tip-bot2 for Valentin Schneider
2020-08-17 11:30 ` [PATCH v6 14/17] sched/topology: Mark SD_ASYM_PACKING " Valentin Schneider
2020-08-19 14:02   ` [tip: sched/core] " tip-bot2 for Valentin Schneider
2020-08-17 11:30 ` [PATCH v6 15/17] sched/topology: Mark SD_OVERLAP " Valentin Schneider
2020-08-19 14:02   ` [tip: sched/core] " tip-bot2 for Valentin Schneider
2020-08-17 11:30 ` [PATCH v6 16/17] sched/topology: Mark SD_NUMA " Valentin Schneider
2020-08-19 14:02   ` [tip: sched/core] " tip-bot2 for Valentin Schneider
2020-08-17 11:30 ` [PATCH v6 17/17] sched/topology: Expand use of SD_DEGENERATE_GROUPS_MASK to flags not needing groups Valentin Schneider

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200817113003.20802-1-valentin.schneider@arm.com \
    --to=valentin.schneider@arm.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=morten.rasmussen@arm.com \
    --cc=peterz@infradead.org \
    --cc=qperret@google.com \
    --cc=vincent.guittot@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox