lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e332a243-5a98-49ed-81be-b6db305d5dc5@intel.com>
Date: Tue, 29 Oct 2024 11:30:30 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Patryk Wlazlyn <patryk.wlazlyn@...ux.intel.com>, x86@...nel.org
Cc: linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
 rafael.j.wysocki@...el.com, len.brown@...el.com,
 artem.bityutskiy@...ux.intel.com, dave.hansen@...ux.intel.com
Subject: Re: [PATCH v2 2/3] x86/smp: Allow forcing the mwait hint for play
 dead loop

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?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ