linux-coco.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: "Kalra, Ashish" <ashish.kalra@amd.com>
To: Borislav Petkov <bp@alien8.de>
Cc: tglx@kernel.org, mingo@redhat.com, dave.hansen@linux.intel.com,
	x86@kernel.org, hpa@zytor.com, seanjc@google.com,
	peterz@infradead.org, thomas.lendacky@amd.com,
	herbert@gondor.apana.org.au, davem@davemloft.net,
	ardb@kernel.org, pbonzini@redhat.com, aik@amd.com,
	Michael.Roth@amd.com, KPrateek.Nayak@amd.com,
	Tycho.Andersen@amd.com, Nathan.Fontenot@amd.com,
	ackerleytng@google.com, jackyli@google.com, pgonda@google.com,
	rientjes@google.com, jacobhxu@google.com, xin@zytor.com,
	pawan.kumar.gupta@linux.intel.com, babu.moger@amd.com,
	dyoung@redhat.com, nikunj@amd.com, darwi@linutronix.de,
	linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
	kvm@vger.kernel.org, linux-coco@lists.linux.dev
Subject: Re: [PATCH v13 4/5] x86/sev: Add support to perform RMP optimizations asynchronously
Date: Wed, 9 Sep 2026 08:55:14 -0500	[thread overview]
Message-ID: <84497e1a-7e07-4c56-8996-45d2e897af38@amd.com> (raw)
In-Reply-To: <20260909015228.GBaqC73LJDUow_Xu6v@fat_crate.local>


On 9/8/2026 8:52 PM, Borislav Petkov wrote:
> On Tue, Sep 08, 2026 at 03:21:31PM -0500, Kalra, Ashish wrote:
>>>> Suggested-by: Thomas Lendacky <thomas.lendacky@amd.com>
>>>> Suggested-by: Dave Hansen <dave.hansen@linux.intel.com>
>>>> Suggested-by: K Prateek Nayak <kprateek.nayak@amd.com>
>>>> Suggested-by: Borislav Petkov (AMD) <bp@alien8.de>
>>>> Reviewed-by: Ackerley Tng <ackerleytng@google.com>
>>>> Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
>>>
>>> R-by's need to get dropped when a patch changes in more or less significant
>>> way.
>>
>> Tom and Dave gave their R-by's on v12/v13 series, so probably i will keep their
>> R-b's.
> 
> Tom gave you a R-by on v12 before I asked you to axe off a bunch of stuff from
> that patch. Dave gave you a R-by to this revision which is still under
> discussion and you wanna keep it regardless.
> 
> There's a R-by Ackerley which you carry at least since v5:
> 
> https://lore.kernel.org/r/6f1ec3d8ebcf3aaceccc099c07d0deb545dd4ab9.1779133590.git.ashish.kalra@amd.com
> 
> to which Ackerley is STILL GIVING YOU review feedback ON THAT SAME THREAD:
> 
> https://lore.kernel.org/r/CAEvNRgGfyb7zvZ1u1j7YLomD%2BJdAxnVW36gtvNG9gxgZ80vMyQ@mail.gmail.com
> 
> and yet you're still debating.
> 
> From where I'm standing, it looks like you don't understand how those tags
> should be used.
> 
> Do you need to go refresh up on the docs:
> 
> "Both Tested-by and Reviewed-by tags, once received on mailing list from tester
> or reviewer, should be added by author to the applicable patches when sending
> next versions.  However if the patch has changed substantially in following
> version, these tags might not be applicable anymore and thus should be removed.
> Usually removal of someone's Acked-by, Tested-by or Reviewed-by tags should be
> mentioned in the patch changelog with an explanation (after the '---'
> separator)."
> 
> ?
> 
> You're using Suggested-by tags also willy-nilly:
> 
> "A Suggested-by: tag indicates that the patch idea is suggested by the person
> named and ensures credit to the person for the idea: if we diligently credit
> our idea reporters, they will, hopefully, be inspired to help us again in the
> future. Note, this is one of only three tags you might be able to use without
> explicit permission of the person named (see 'Tagging people requires
> permission' below for details)."
> 
> So all 4 people have suggested this patch?
> 
> No, ofc not. You have simply received review comments from them which you've
> decided to integrate into your patch. This doesn't need a Suggested-by tag.
> This is normal patch review process. You should try it sometimes.
> 
> And this is damn well documented but you're still debating.
> 
> Well, you can debate all you want - those patches are not going anywhere until
> you do them right. This is solely your call.

Thanks, Boris for the explanation and for quoting the documentation, I'll get these right in v14.

Tags: you're right, I was crediting reviewers as if they'd suggested the approach, when they were just reviewing.

I'll drop the Reviewed-by tags that no longer apply to this patch -Tom's (from v12, before the rework you asked for) and Ackerley's
and note the removals in the changelog under the '---'. 

On Suggested-by, I'll keep it only where the approach was actually proposed and drop the ones that
were really just review comments, including my mis-tagging of your own feedback. 

I'll apply the same cleanup across the rest of the series.

> 
>> So the fix is: keep the setup allocated once, but make setup always
>> (re)program RMPOPT_BASE — then we never need to clear it on disable, and the
>> cycle case is covered on re-init. Proposed fix: 
> 
> Yes, you basically do the *minimal* work that is absolutely necessary and
> leave everything else untouched because it is unnecessary complication to all
> the code and if one is going to toggle SNP and hotplug, then one has bigger
> problems than some leftover facilities.

Re-init / hotplug: agreed - I'll do only the minimal work that's
necessary and leave the rest untouched. Setup programs RMPOPT_BASE once
and simply re-arms the pass on re-init; the disable path only cancels
the pending work - no tearing down the queue or clearing MSRs/state.
And I'll drop the re-init reprogramming I was defending: as you say, if
SNP and hotplug are being toggled underneath this, that's a bigger
problem than some leftover facilities.

> 
>> A full‑physmem RMPOPT pass is a warm‑up scan plus an IPI fan‑out over up to 2TB. The default system_wq is per‑CPU and concurrency‑managed,
>> a long‑running item there runs on the queueing CPU's worker pool and can stall (or be stalled by) other work on that pool. So we wanted it
>> off system_wq and use a dedicated RMPOPT specific workqueue.
>>
>> Another thing i looked at is for long-running unbound work, probably the standard shared queue is system_unbound_wq, which is probably built
>> for this use case and won't clog the per-CPU system_wq.
> 
> You can't:
> 
> system_unbound_wq = alloc_workqueue("events_unbound", WQ_UNBOUND | __WQ_DEPRECATED, WQ_MAX_ACTIVE);
> 								   ^^^^^^^^^^^^^^^
> 
> 	__WQ_DEPRECATED         = 1 << 19, /* internal: workqueue is deprecated */
> 
> So if you do an unbound workqueue and then block migration around it, you're
> basically doing a WQ_PERCPU one. So why don't you do one of those and drop the
> migration toggles around it?
> 
> All this talking is to get you to get the hint that *whatever* you do, it
> needs to have a good comment above it explaining why it has been chosen this
> way. Or put that info in the commit message.
> 
> So that people who look at that code in the future, can change it after
> knowing why.
> 
> And you should not do excessive commenting - it suffices if you put a couple
> of key comments which explain non-trivial things only. The rest people can
> figure out by simply reading the code.
> 

Workqueue: As you indicated system_unbound_wq is __WQ_DEPRECATED, so I
won't use it. And you're right that migrate_disable() around the local
scan makes an unbound queue pointless, so I'll switch to a WQ_PERCPU
workqueue and drop the migration toggles. I'll add a short comment on
why it's per-CPU (the warm-up scan runs pinned and primes the shared
RMPOPT table so the on_each_cpu_mask() fan-out is only cache hits), and
trim the redundant comments rather than over-commenting.

Will respin with all of this.

Thanks,
Ashish

  reply	other threads:[~2026-09-09 13:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02 21:27 [PATCH v13 0/5] Add RMPOPT support Ashish Kalra
2026-09-02 21:27 ` [PATCH v13 1/5] x86/cpufeatures: Add X86_FEATURE_RMPOPT feature flag Ashish Kalra
2026-09-02 21:28 ` [PATCH v13 2/5] x86/sev: Disable CPU hotplug while SNP is active Ashish Kalra
2026-09-02 21:28 ` [PATCH v13 3/5] x86/sev: Initialize RMPOPT configuration MSRs Ashish Kalra
2026-09-02 21:28 ` [PATCH v13 4/5] x86/sev: Add support to perform RMP optimizations asynchronously Ashish Kalra
2026-09-02 21:36   ` Dave Hansen
2026-09-05  1:29   ` Borislav Petkov
2026-09-08 20:21     ` Kalra, Ashish
2026-09-09  1:52       ` Borislav Petkov
2026-09-09 13:55         ` Kalra, Ashish [this message]
2026-09-02 21:29 ` [PATCH v13 5/5] x86/sev: Re-enable RMP optimizations on SNP guest shutdown Ashish Kalra
2026-09-02 21:37   ` Dave Hansen
2026-09-06 17:24   ` Borislav Petkov

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=84497e1a-7e07-4c56-8996-45d2e897af38@amd.com \
    --to=ashish.kalra@amd.com \
    --cc=KPrateek.Nayak@amd.com \
    --cc=Michael.Roth@amd.com \
    --cc=Nathan.Fontenot@amd.com \
    --cc=Tycho.Andersen@amd.com \
    --cc=ackerleytng@google.com \
    --cc=aik@amd.com \
    --cc=ardb@kernel.org \
    --cc=babu.moger@amd.com \
    --cc=bp@alien8.de \
    --cc=darwi@linutronix.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=dyoung@redhat.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=hpa@zytor.com \
    --cc=jackyli@google.com \
    --cc=jacobhxu@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=nikunj@amd.com \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=pgonda@google.com \
    --cc=rientjes@google.com \
    --cc=seanjc@google.com \
    --cc=tglx@kernel.org \
    --cc=thomas.lendacky@amd.com \
    --cc=x86@kernel.org \
    --cc=xin@zytor.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;
as well as URLs for NNTP newsgroup(s).