From: Shrikanth Hegde <sshegde@linux.ibm.com>
To: Christian Loehle <christian.loehle@arm.com>
Cc: x86@kernel.org, Vincent Guittot <vincent.guittot@linaro.org>,
Ingo Molnar <mingo@redhat.com>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Pierre Gondois <pierre.gondois@arm.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
mpe@ellerman.id.au, Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH] sched: Make ASYM_PACKING compile-time arch config
Date: Fri, 18 Oct 2024 19:52:14 +0530 [thread overview]
Message-ID: <e7d7a3d8-4b4a-47ff-8d69-a4c2e75d6818@linux.ibm.com> (raw)
In-Reply-To: <32c0aed9-bae1-4273-938d-36acb420eb56@arm.com>
On 10/18/24 03:16, Christian Loehle wrote:
> Only x86 and Power7 set SD_ASYM_PACKING at boot-time depending on the
Power10 on Shared Processor LPAR also enables that.
> system. All other platforms don't make use of asym-packing anyway,
> so introduce auxiliary ARCH_HAS_SCHED_ASYM_PACKING and guard all the
> related logic behind that so it isn't compiled when not needed.
>
> On arm64 this reduces
> size kernel/sched/fair.o
> text data bss dec hex filename
> 74120 4097 88 78305 131e1 kernel/sched/fair.o
> to
> size kernel/sched/fair.o
> text data bss dec hex filename
> 72896 4065 88 77049 12cf9 kernel/sched/fair.o
>
> Most of that is on the load-balance hot-path, in particular
> need_active_balance() reduces from 141 to 84 instructions.
This patch sprinkes #ifdef across the code. IMHO it makes the code
difficult to read. Its possible to do slight such reductions for other
group types as well, such as group_misfit_task(which allows right load
balancing when SD_ASYM_CPUCAPACITY is on, except for a case when
capacity is reduced due to side activity).
sd->flags should be cache hot and its a percpu variable. Hence the
access to it shouldn't be costly. the branch predictors should do a good
job since it doesn't change often. Correct me if i am wrong.
>
> hackbench -pTl 20000 on a rk3399 goes from
> 58.4664 to 57.6056 (-1.5%), mean over 20 iterations.
>
> Signed-off-by: Christian Loehle <christian.loehle@arm.com>
> ---
> arch/Kconfig | 3 ++
> arch/powerpc/Kconfig | 1 +
> arch/x86/Kconfig | 1 +
> kernel/sched/fair.c | 86 ++++++++++++++++++++++++++++++--------------
> kernel/sched/sched.h | 8 ++++-
> 5 files changed, 71 insertions(+), 28 deletions(-)
>
> diff --git a/arch/Kconfig b/arch/Kconfig
> index 8af374ea1adc..9f6ec10723a3 100644
> --- a/arch/Kconfig
> +++ b/arch/Kconfig
> @@ -1684,4 +1684,7 @@ config CC_HAS_SANE_FUNCTION_ALIGNMENT
> config ARCH_NEED_CMPXCHG_1_EMU
> bool
...
next prev parent reply other threads:[~2024-10-18 14:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-17 21:46 Christian Loehle
2024-10-18 14:22 ` Shrikanth Hegde [this message]
2024-10-23 2:29 ` Michael Ellerman
2024-10-23 10:19 ` Peter Zijlstra
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=e7d7a3d8-4b4a-47ff-8d69-a4c2e75d6818@linux.ibm.com \
--to=sshegde@linux.ibm.com \
--cc=christian.loehle@arm.com \
--cc=dietmar.eggemann@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=peterz@infradead.org \
--cc=pierre.gondois@arm.com \
--cc=tglx@linutronix.de \
--cc=vincent.guittot@linaro.org \
--cc=x86@kernel.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
all inboxes | Powered by JetHome®