mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>, x86@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	rafael.j.wysocki@intel.com, len.brown@intel.com,
	artem.bityutskiy@linux.intel.com, dave.hansen@linux.intel.com
Subject: Re: [PATCH v2 2/3] x86/smp: Allow forcing the mwait hint for play dead loop
Date: Tue, 29 Oct 2024 11:30:30 -0700	[thread overview]
Message-ID: <e332a243-5a98-49ed-81be-b6db305d5dc5@intel.com> (raw)
In-Reply-To: <20241029101507.7188-3-patryk.wlazlyn@linux.intel.com>

On 10/29/24 03:15, Patryk Wlazlyn wrote:
> +void smp_set_mwait_play_dead_hint(unsigned int hint)
> +{
> +	WRITE_ONCE(play_dead_mwait_hint, hint);
> +}

This all feels a bit hacky and unstructured to me.

Could we at least set up a few rules here?  Like, say what the hints
are, what values can they have?  Where do they come from?  Can this get
called more than once?  Does it _need_ to be set?  What's the behavior
when it is not set?  Who is responsible for calling this?

What good does the smp_ prefix do?  I don't think _callers_ care whether
this is getting optimized out or not.

> -	hint = get_deepest_mwait_hint();
> +	hint = READ_ONCE(play_dead_mwait_hint);
> +	if (hint == PLAY_DEAD_MWAIT_HINT_UNSET)
> +		hint = get_deepest_mwait_hint();

This is also rather opaque.

Why are there two hints?  What makes one better than the other one?

  reply	other threads:[~2024-10-29 18:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-29 10:15 [PATCH v2 0/3] SRF: Fix offline CPU preventing pc6 entry Patryk Wlazlyn
2024-10-29 10:15 ` [PATCH v2 1/3] x86/smp: Move mwait hint computation out of mwait_play_dead Patryk Wlazlyn
2024-10-29 10:15 ` [PATCH v2 2/3] x86/smp: Allow forcing the mwait hint for play dead loop Patryk Wlazlyn
2024-10-29 18:30   ` Dave Hansen [this message]
2024-10-30  9:58     ` Artem Bityutskiy
2024-10-30 19:32       ` Dave Hansen
2024-10-30 19:53         ` Rafael J. Wysocki
2024-10-30 20:11           ` Dave Hansen
2024-10-30 20:14             ` Rafael J. Wysocki
2024-11-06  8:14         ` Artem Bityutskiy
2024-11-06 14:46           ` Dave Hansen
2024-10-30 13:33     ` Patryk Wlazlyn
2024-10-30 22:55       ` Dave Hansen
2024-10-29 10:15 ` [PATCH v2 3/3] intel_idle: Identify the deepest cstate for SRF Patryk Wlazlyn

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=e332a243-5a98-49ed-81be-b6db305d5dc5@intel.com \
    --to=dave.hansen@intel.com \
    --cc=artem.bityutskiy@linux.intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=patryk.wlazlyn@linux.intel.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=x86@kernel.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

all inboxes | Powered by JetHome®