From: David Laight <David.Laight@ACULAB.COM>
To: 'K Prateek Nayak' <kprateek.nayak@amd.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "rafael@kernel.org" <rafael@kernel.org>,
"lenb@kernel.org" <lenb@kernel.org>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
"bp@alien8.de" <bp@alien8.de>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"andi@lisas.de" <andi@lisas.de>,
"puwen@hygon.cn" <puwen@hygon.cn>,
"mario.limonciello@amd.com" <mario.limonciello@amd.com>,
"peterz@infradead.org" <peterz@infradead.org>,
"rui.zhang@intel.com" <rui.zhang@intel.com>,
"gpiccoli@igalia.com" <gpiccoli@igalia.com>,
"daniel.lezcano@linaro.org" <daniel.lezcano@linaro.org>,
"ananth.narayan@amd.com" <ananth.narayan@amd.com>,
"gautham.shenoy@amd.com" <gautham.shenoy@amd.com>,
Calvin Ong <calvin.ong@amd.com>,
"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: RE: [PATCH v2] x86,acpi: Limit "Dummy wait" workaround to older AMD and Intel processors
Date: Mon, 26 Sep 2022 08:19:40 +0000 [thread overview]
Message-ID: <93705b7dab2f4d6db7f4631648daf16f@AcuMS.aculab.com> (raw)
In-Reply-To: <20220923153801.9167-1-kprateek.nayak@amd.com>
From: K Prateek Nayak
> Sent: 23 September 2022 16:38
....
>
> This workaround is very painful on modern systems with a large number of
> cores. The "inl()" can take thousands of cycles. Sampling certain
> workloads with IBS on AMD Zen3 system shows that a significant amount of
> time is spent in the dummy op, which incorrectly gets accounted as
> C-State residency. A large C-State residency value can prime the cpuidle
> governor to recommend a deeper C-State during the subsequent idle
> instances, starting a vicious cycle, leading to performance degradation
> on workloads that rapidly switch between busy and idle phases.
> (For the extent of the performance degradation refer link [2])
Isn't that a horrid bug itself?
Sounds like it affects any code that is doing pio reads of hardware buffers.
While they are slow they are necessary.
IIRC any PCIe read into an Altera fpga takes about 128 cycles of the 125MHz
clock. The Intel cpu I've checked will only execute one concurrent PCIe read
for each cpu core - so the cpu soon stalls for thousands of clocks.
> The dummy wait is unnecessary on processors based on the Zen
> microarchitecture (AMD family 17h+ and HYGON). Skip it to prevent
> polluting the C-state residency information. Among the pre-family 17h
> AMD processors, there has been at least one report of an AMD Athlon on a
> VIA chipset (circa 2006) where this this problem was seen (see [3] for
> report by Andreas Mohr).
>
> Modern Intel processors use MWAIT based C-States in the intel_idle driver
> and are not impacted by this code path. For older Intel processors that
> use the acpi_idle driver, a workaround was suggested by Dave Hansen and
> Rafael J. Wysocki to regard all Intel chipsets using the IOPORT based
> C-state management as being affected by this problem (see [4] for
> workaround proposed).
Can you use a surrogate (maybe AVX support?) to exclude large groups
on modern cpu?
Another possibility is that is the io address doesn't really matter
are there any locations that have moved on-die and are now executed
much faster than the ISA bus speed of older systems?
Or do all the 'originally ISA' peripherals still run at ISA speeds?
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2022-09-26 8:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-23 15:38 [PATCH v2] x86,acpi: Limit "Dummy wait" workaround to older AMD and Intel processors K Prateek Nayak
2022-09-23 15:46 ` Borislav Petkov
2022-09-23 16:25 ` K Prateek Nayak
2022-09-23 16:30 ` Borislav Petkov
2022-09-23 16:52 ` K Prateek Nayak
2022-09-26 8:19 ` David Laight [this message]
2022-09-26 12:07 ` Peter Zijlstra
2022-09-26 16:32 ` K Prateek Nayak
2022-09-26 19:55 ` Andreas Mohr
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=93705b7dab2f4d6db7f4631648daf16f@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=ananth.narayan@amd.com \
--cc=andi@lisas.de \
--cc=bp@alien8.de \
--cc=calvin.ong@amd.com \
--cc=daniel.lezcano@linaro.org \
--cc=dave.hansen@linux.intel.com \
--cc=gautham.shenoy@amd.com \
--cc=gpiccoli@igalia.com \
--cc=kprateek.nayak@amd.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=peterz@infradead.org \
--cc=puwen@hygon.cn \
--cc=rafael.j.wysocki@intel.com \
--cc=rafael@kernel.org \
--cc=rui.zhang@intel.com \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
/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