From: Borislav Petkov <bp@alien8.de>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Stuart Hayes <stuart.w.hayes@gmail.com>,
Viresh Kumar <viresh.kumar@linaro.org>,
Kyle Meyer <kyle.meyer@hpe.com>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cpufreq: acpi: Defer setting boost MSRs
Date: Sun, 4 Dec 2022 19:29:09 +0100 [thread overview]
Message-ID: <Y4zm9T+WYmyWwik4@zn.tnic> (raw)
In-Reply-To: <CAJZ5v0iM28y2YSWOv81VCB9vqh2xwJcz36wnR7PujDehvrkN-Q@mail.gmail.com>
On Thu, Nov 03, 2022 at 07:19:47PM +0100, Rafael J. Wysocki wrote:
> On Wed, Nov 2, 2022 at 9:01 PM Stuart Hayes <stuart.w.hayes@gmail.com> wrote:
> >
> > When acpi-cpufreq is loaded, boost is enabled on every CPU (by setting an
> > MSR) before the driver is registered with cpufreq. This can be very time
> > consuming, because it is done with a CPU hotplug startup callback, and
> > cpuhp_setup_state() schedules the callback (cpufreq_boost_online()) to run
> > on each CPU one at a time, waiting for each to run before calling the next.
> >
> > If cpufreq_register_driver() fails--if, for example, there are no ACPI
> > P-states present--this is wasted time.
> >
> > Since cpufreq already sets up a CPU hotplug startup callback if and when
> > acpi-cpufreq is registered, set the boost MSRs in acpi_cpufreq_cpu_init(),
> > which is called by the cpufreq cpuhp callback. This allows acpi-cpufreq to
> > exit quickly if it is loaded but not needed.
> >
> > On one system with 192 CPUs, this patch speeds up boot by about 30 seconds.
> >
> > Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com>
> > ---
> > drivers/cpufreq/acpi-cpufreq.c | 31 +++----------------------------
> > 1 file changed, 3 insertions(+), 28 deletions(-)
...
> Applied as 6.2 material, thanks!
My 32-bit Atom doesn't like this one. Reverting fixes it ofc.
[ 22.780260] unchecked MSR access error: WRMSR to 0x1a0 (tried to write 0x0000004364950488) at rIP: 0xf80b37d4 (boost_set_msr.isra.0+0x9c/0x114 [acpi_cpufreq])
[ 22.781186] Call Trace:
[ 22.781186] boost_set_msr_each+0x15/0x1c [acpi_cpufreq]
[ 22.781186] __flush_smp_call_function_queue+0x132/0x1cc
[ 22.781186] ? sysvec_call_function+0x30/0x30
[ 22.781186] generic_smp_call_function_single_interrupt+0x12/0x18
[ 22.781186] __sysvec_call_function_single.constprop.0+0x43/0x1d8
[ 22.781186] sysvec_call_function_single+0x18/0x30
[ 22.781186] handle_exception+0x133/0x133
[ 22.781186] EIP: finish_task_switch.isra.0+0x124/0x3a8
[ 22.781186] Code: d8 e8 8c 16 92 00 85 f6 75 e8 a1 04 24 6c c2 85 c0 0f 8f 9b 00 00 00 89 d8 e8 e4 02 92 00 e8 53 9e 0b 00 fb 64 a1 40 f9 69 c2 <8b> 80 5c 0f 00 00 85 c0 0f 85 72 01 00 00 a1 28 24 6c c2 64 8b 15
[ 22.781186] EAX: c32e2700 EBX: f748af40 ECX: 00000000 EDX: c1c3876e
[ 22.781186] ESI: 00000000 EDI: 00000000 EBP: c3241f90 ESP: c3241f78
[ 22.781186] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 EFLAGS: 00000206
[ 22.781186] ? uevent_seqnum_show+0x1b/0x28
[ 22.781186] ? pid_list_refill_irq+0x128/0x1c0
[ 22.781186] ? sysvec_call_function+0x30/0x30
[ 22.781186] ? pid_list_refill_irq+0x128/0x1c0
[ 22.781186] ? sysvec_call_function+0x30/0x30
[ 22.781186] ? finish_task_switch.isra.0+0x124/0x3a8
[ 22.781186] schedule_tail+0x12/0x78
[ 22.781186] schedule_tail_wrapper+0x9/0x10
[ 22.781186] ret_from_fork+0x5/0x28
[ 22.781186] EIP: 0xb7fba549
[ 22.781186] Code: Unable to access opcode bytes at 0xb7fba51f.
[ 22.781186] EAX: 00000000 EBX: 01200011 ECX: 00000000 EDX: 00000000
[ 22.781186] ESI: 00000000 EDI: b7bfe868 EBP: 00000000 ESP: bfcfedc0
[ 22.781186] DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b EFLAGS: 00000246
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
next prev parent reply other threads:[~2022-12-04 18:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-02 19:59 [PATCH] cpufreq: acpi: Defer setting boost MSRs Stuart Hayes
2022-11-03 18:19 ` Rafael J. Wysocki
2022-12-04 18:29 ` Borislav Petkov [this message]
2022-12-04 19:20 ` stuart hayes
2022-12-05 12:43 ` Rafael J. Wysocki
2022-12-05 22:57 ` stuart hayes
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=Y4zm9T+WYmyWwik4@zn.tnic \
--to=bp@alien8.de \
--cc=kyle.meyer@hpe.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=stuart.w.hayes@gmail.com \
--cc=viresh.kumar@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;
as well as URLs for NNTP newsgroup(s).