mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "André Eikmeyer" <dev@deq.rocks>
To: Borislav Petkov <bp@alien8.de>
Cc: tglx@kernel.org, mingo@redhat.com, dave.hansen@linux.intel.com,
	x86@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org,
	rafael@kernel.org, linux-pm@vger.kernel.org, lukas@wunner.de,
	yu.c.chen@intel.com
Subject: Re: [PATCH] x86/cache: Restore AP cache state while bringing CPUs online on resume
Date: Sat, 28 Nov 2026 10:25:14 +0100	[thread overview]
Message-ID: <20261128102514.30252d9b@kait2en-mbp15-1> (raw)
In-Reply-To: <20261128011842.GBawor8g-JODmLyVCY@fat_crate.local>

On Fri, 27 Nov 2026 17:18:42 -0800
Borislav Petkov <bp@alien8.de> wrote:

> Yes, why is your change correct for all x86 out there?
> 
> Yu Chen in his original patch at least tried to do some git
> archeology, you're simply axing them off because works-for-me.
> 
> Sorry.

Hi Boris,

No worries, I get you. I should have provided more background info. I am
not trying to axe them off. I could simply use your help.

The patch refers to this discussion with Lukas and Chen Yu on a patch I
sent for early CPU offlining on T2 Macs

https://lore.kernel.org/all/aoCJGj8HixmJ9oaZ@wunner.de/

This is what I found in the history

- d0af9eed5aa9 made each AP init a stop_machine() rendezvous as the SDM
  requires. Boot and resume delay the AP init until all APs are up. So
  one rendezvous covers all of them.

- The delay assumes that the APs come back from S3 with usable MTRRs.
  Some firmware leaves them uncached and each AP then runs uncached
  until thaw_secondary_cpus() ends. Lukas saw this on his older
  Macbook Pro 9,1, I see it on the T2 Macs.

- Chen Yu's v4 from 2018 did one rendezvous per AP on resume and
  reprogrammed only the incoming CPU. It slipped through the cracks.

- Since 0b9a6a8bedb, a rendezvous outside the delayed phase
  reprograms only the incoming CPU. Without the thaw hooks resume
  takes the same path as CPU hotplug.

You will agree that a resume from S3 taking longer than rebooting is
annoying. Especially on a portable device. It's getting worse the more
cores a CPU has. Like exponentially worse. We see 30 seconds on a 10th
gen I5 and around 3 minutes on a Coffee Lake I9.

However, the only drawback I see is one rendezvous per AP instead of one
for all. I can only test what the T2 community and I have. If this has a
downside on systems that are not affected, please point me to it. As
is, the patch is small and fixes our stuff, from what I thought was a
good thing to begin with. And we could go from here.

Best,
Andre

  reply	other threads:[~2026-11-28  9:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11 12:37 Andre Eikmeyer
2026-11-27 15:00 ` Andre Eikmeyer
2026-11-28  1:18   ` Borislav Petkov
2026-11-28  9:25     ` André Eikmeyer [this message]
2026-12-01 23:48 ` Dave Hansen

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=20261128102514.30252d9b@kait2en-mbp15-1 \
    --to=dev@deq.rocks \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=mingo@redhat.com \
    --cc=rafael@kernel.org \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    --cc=yu.c.chen@intel.com \
    /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®