* [6.1] Please apply cc6003916ed46d7a67d91ee32de0f9138047d55f
@ 2023-10-20 1:27 Luiz Capitulino
2023-10-20 2:46 ` Hyeonggon Yoo
0 siblings, 1 reply; 4+ messages in thread
From: Luiz Capitulino @ 2023-10-20 1:27 UTC (permalink / raw)
To: stable@vger.kernel.org, Greg KH, sashal@kernel.org; +Cc: 42.hyeyoo
Hi,
As reported before[1], we found another regression in 6.1 when doing
performance comparisons with 5.10. This one is caused by CONFIG_DEBUG_PREEMPT
being enabled by default by the following upstream commit if you have the
right config dependencies enabled (commit is introduced in v5.16-rc1):
"""
commit c597bfddc9e9e8a63817252b67c3ca0e544ace26
Author: Frederic Weisbecker <frederic@kernel.org>
Date: Tue Sep 14 12:31:34 2021 +0200
sched: Provide Kconfig support for default dynamic preempt mode
"""
We found up to 8% performance improvement with CONFIG_DEBUG_PREEMPT
disabled in different perf benchmarks (including UnixBench process
creation and redis). The root cause is explained in the commit log
below which is merged in 6.3 and applies (almost) clealy on 6.1.59.
"""
commit cc6003916ed46d7a67d91ee32de0f9138047d55f
Author: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Date: Sat Jan 21 12:39:42 2023 +0900
lib/Kconfig.debug: do not enable DEBUG_PREEMPT by default
In workloads where this_cpu operations are frequently performed,
enabling DEBUG_PREEMPT may result in significant increase in
runtime overhead due to frequent invocation of
__this_cpu_preempt_check() function.
This can be demonstrated through benchmarks such as hackbench where this
configuration results in a 10% reduction in performance, primarily due to
the added overhead within memcg charging path.
"""
[1] https://lore.kernel.org/stable/010edf5a-453d-4c98-9c07-12e75d3f983c@amazon.com/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [6.1] Please apply cc6003916ed46d7a67d91ee32de0f9138047d55f
2023-10-20 1:27 [6.1] Please apply cc6003916ed46d7a67d91ee32de0f9138047d55f Luiz Capitulino
@ 2023-10-20 2:46 ` Hyeonggon Yoo
2023-10-20 6:11 ` Greg KH
2023-10-20 13:49 ` Luiz Capitulino
0 siblings, 2 replies; 4+ messages in thread
From: Hyeonggon Yoo @ 2023-10-20 2:46 UTC (permalink / raw)
To: Luiz Capitulino; +Cc: stable@vger.kernel.org, Greg KH, sashal@kernel.org
On Fri, Oct 20, 2023 at 10:27 AM Luiz Capitulino <luizcap@amazon.com> wrote:
>
> Hi,
>
> As reported before[1], we found another regression in 6.1 when doing
> performance comparisons with 5.10. This one is caused by CONFIG_DEBUG_PREEMPT
> being enabled by default by the following upstream commit if you have the
> right config dependencies enabled (commit is introduced in v5.16-rc1):
>
> """
> commit c597bfddc9e9e8a63817252b67c3ca0e544ace26
> Author: Frederic Weisbecker <frederic@kernel.org>
> Date: Tue Sep 14 12:31:34 2021 +0200
>
> sched: Provide Kconfig support for default dynamic preempt mode
> """
>
> We found up to 8% performance improvement with CONFIG_DEBUG_PREEMPT
> disabled in different perf benchmarks (including UnixBench process
> creation and redis). The root cause is explained in the commit log
> below which is merged in 6.3 and applies (almost) clealy on 6.1.59.
Oh, I should've sent it to the stable. Thanks for sending it!
Yes, DEBUG_PREEMPT was unintentionally enabled after the introduction
of PREEMPT_DYNAMIC. It was already enabled by default for PREEMPTION=y kernels
but PREEMPT_DYNAMIC always enables PREEMPT_BUILD (and hence PREEMPTION)
so distros that were using PREEMPT_VOLUNTARY are silently affected by that.
It looks appropriate to be backported to the stable tree (to me).
Hmm but I think it should be backported to 5.15 too?
> """
> commit cc6003916ed46d7a67d91ee32de0f9138047d55f
> Author: Hyeonggon Yoo <42.hyeyoo@gmail.com>
> Date: Sat Jan 21 12:39:42 2023 +0900
>
> lib/Kconfig.debug: do not enable DEBUG_PREEMPT by default
>
> In workloads where this_cpu operations are frequently performed,
> enabling DEBUG_PREEMPT may result in significant increase in
> runtime overhead due to frequent invocation of
> __this_cpu_preempt_check() function.
>
> This can be demonstrated through benchmarks such as hackbench where this
> configuration results in a 10% reduction in performance, primarily due to
> the added overhead within memcg charging path.
> """
>
> [1] https://lore.kernel.org/stable/010edf5a-453d-4c98-9c07-12e75d3f983c@amazon.com/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [6.1] Please apply cc6003916ed46d7a67d91ee32de0f9138047d55f
2023-10-20 2:46 ` Hyeonggon Yoo
@ 2023-10-20 6:11 ` Greg KH
2023-10-20 13:49 ` Luiz Capitulino
1 sibling, 0 replies; 4+ messages in thread
From: Greg KH @ 2023-10-20 6:11 UTC (permalink / raw)
To: Hyeonggon Yoo; +Cc: Luiz Capitulino, stable@vger.kernel.org, sashal@kernel.org
On Fri, Oct 20, 2023 at 11:46:36AM +0900, Hyeonggon Yoo wrote:
> On Fri, Oct 20, 2023 at 10:27 AM Luiz Capitulino <luizcap@amazon.com> wrote:
> >
> > Hi,
> >
> > As reported before[1], we found another regression in 6.1 when doing
> > performance comparisons with 5.10. This one is caused by CONFIG_DEBUG_PREEMPT
> > being enabled by default by the following upstream commit if you have the
> > right config dependencies enabled (commit is introduced in v5.16-rc1):
> >
> > """
> > commit c597bfddc9e9e8a63817252b67c3ca0e544ace26
> > Author: Frederic Weisbecker <frederic@kernel.org>
> > Date: Tue Sep 14 12:31:34 2021 +0200
> >
> > sched: Provide Kconfig support for default dynamic preempt mode
> > """
> >
> > We found up to 8% performance improvement with CONFIG_DEBUG_PREEMPT
> > disabled in different perf benchmarks (including UnixBench process
> > creation and redis). The root cause is explained in the commit log
> > below which is merged in 6.3 and applies (almost) clealy on 6.1.59.
>
> Oh, I should've sent it to the stable. Thanks for sending it!
>
> Yes, DEBUG_PREEMPT was unintentionally enabled after the introduction
> of PREEMPT_DYNAMIC. It was already enabled by default for PREEMPTION=y kernels
> but PREEMPT_DYNAMIC always enables PREEMPT_BUILD (and hence PREEMPTION)
> so distros that were using PREEMPT_VOLUNTARY are silently affected by that.
>
> It looks appropriate to be backported to the stable tree (to me).
> Hmm but I think it should be backported to 5.15 too?
Now queued up, thanks.
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [6.1] Please apply cc6003916ed46d7a67d91ee32de0f9138047d55f
2023-10-20 2:46 ` Hyeonggon Yoo
2023-10-20 6:11 ` Greg KH
@ 2023-10-20 13:49 ` Luiz Capitulino
1 sibling, 0 replies; 4+ messages in thread
From: Luiz Capitulino @ 2023-10-20 13:49 UTC (permalink / raw)
To: Hyeonggon Yoo; +Cc: stable@vger.kernel.org, Greg KH, sashal@kernel.org
On Fri, Oct 20, 2023 at 11:46:36AM +0900, Hyeonggon Yoo wrote:
> On Fri, Oct 20, 2023 at 10:27 AM Luiz Capitulino <luizcap@amazon.com> wrote:
> >
> > Hi,
> >
> > As reported before[1], we found another regression in 6.1 when doing
> > performance comparisons with 5.10. This one is caused by CONFIG_DEBUG_PREEMPT
> > being enabled by default by the following upstream commit if you have the
> > right config dependencies enabled (commit is introduced in v5.16-rc1):
> >
> > """
> > commit c597bfddc9e9e8a63817252b67c3ca0e544ace26
> > Author: Frederic Weisbecker <frederic@kernel.org>
> > Date: Tue Sep 14 12:31:34 2021 +0200
> >
> > sched: Provide Kconfig support for default dynamic preempt mode
> > """
> >
> > We found up to 8% performance improvement with CONFIG_DEBUG_PREEMPT
> > disabled in different perf benchmarks (including UnixBench process
> > creation and redis). The root cause is explained in the commit log
> > below which is merged in 6.3 and applies (almost) clealy on 6.1.59.
>
> Oh, I should've sent it to the stable. Thanks for sending it!
Thanks for doing the original fix! :)
> Yes, DEBUG_PREEMPT was unintentionally enabled after the introduction
> of PREEMPT_DYNAMIC. It was already enabled by default for PREEMPTION=y kernels
> but PREEMPT_DYNAMIC always enables PREEMPT_BUILD (and hence PREEMPTION)
> so distros that were using PREEMPT_VOLUNTARY are silently affected by that.
>
> It looks appropriate to be backported to the stable tree (to me).
> Hmm but I think it should be backported to 5.15 too?
Yeah, I see that Greg applied it to 5.15 and 5.10 as well.
I posted it only for 6.1 because the worst case seems to happen after
c597bfddc9 where CONFIG_DEBUG_PREEMPT may be enabled automatically.
But having the fix in earlier kernels is certainly good as well.
- Luiz
>
> > """
> > commit cc6003916ed46d7a67d91ee32de0f9138047d55f
> > Author: Hyeonggon Yoo <42.hyeyoo@gmail.com>
> > Date: Sat Jan 21 12:39:42 2023 +0900
> >
> > lib/Kconfig.debug: do not enable DEBUG_PREEMPT by default
> >
> > In workloads where this_cpu operations are frequently performed,
> > enabling DEBUG_PREEMPT may result in significant increase in
> > runtime overhead due to frequent invocation of
> > __this_cpu_preempt_check() function.
> >
> > This can be demonstrated through benchmarks such as hackbench where this
> > configuration results in a 10% reduction in performance, primarily due to
> > the added overhead within memcg charging path.
> > """
> >
> > [1] https://lore.kernel.org/stable/010edf5a-453d-4c98-9c07-12e75d3f983c@amazon.com/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-10-20 13:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-20 1:27 [6.1] Please apply cc6003916ed46d7a67d91ee32de0f9138047d55f Luiz Capitulino
2023-10-20 2:46 ` Hyeonggon Yoo
2023-10-20 6:11 ` Greg KH
2023-10-20 13:49 ` Luiz Capitulino
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox