public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Conor Dooley <conor.dooley@microchip.com>
To: Pierre Gondois <pierre.gondois@arm.com>
Cc: <linux-kernel@vger.kernel.org>, Radu Rendec <rrendec@redhat.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Sudeep Holla <sudeep.holla@arm.com>,
	Oliver Upton <oliver.upton@linux.dev>,
	Akihiko Odaki <akihiko.odaki@daynix.com>,
	Palmer Dabbelt <palmer@rivosinc.com>,
	Gavin Shan <gshan@redhat.com>,
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 1/3] cacheinfo: Check sib_leaf in cache_leaves_are_shared()
Date: Mon, 27 Mar 2023 15:04:15 +0100	[thread overview]
Message-ID: <267f5e37-2cfd-4833-a74c-bfc56fe3671c@spud> (raw)
In-Reply-To: <20230327115953.788244-2-pierre.gondois@arm.com>


[-- Attachment #1.1: Type: text/plain, Size: 1680 bytes --]

On Mon, Mar 27, 2023 at 01:59:49PM +0200, Pierre Gondois wrote:
> If 'this_leaf' is a L2 cache (or higher) and 'sib_leaf' is a L1 cache,
> the caches are detected as shared.
> Indeed, cache_leaves_are_shared() only checks the cache level of
> 'this_leaf' when 'sib_leaf''s cache level should also be checked.

nit: this commit message reads quite weirdly as there's a missing "do
foo" statement, followed by "also do bar".

> 
> Also update the comment: the function is called when populating
> 'shared_cpu_map'.
> 
> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
> ---
>  drivers/base/cacheinfo.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c
> index f6573c335f4c..4ca117574af1 100644
> --- a/drivers/base/cacheinfo.c
> +++ b/drivers/base/cacheinfo.c
> @@ -38,11 +38,10 @@ static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf,
>  {
>  	/*
>  	 * For non DT/ACPI systems, assume unique level 1 caches,
> -	 * system-wide shared caches for all other levels. This will be used
> -	 * only if arch specific code has not populated shared_cpu_map
> +	 * system-wide shared caches for all other levels.
>  	 */
>  	if (!(IS_ENABLED(CONFIG_OF) || IS_ENABLED(CONFIG_ACPI)))
> -		return !(this_leaf->level == 1);
> +		return (this_leaf->level != 1) || (sib_leaf->level != 1);

So this is
Fixes: f16d1becf96f ("cacheinfo: Use cache identifiers to check if the caches are shared if available")
then?

Cheers,
Conor.

>  
>  	if ((sib_leaf->attributes & CACHE_ID) &&
>  	    (this_leaf->attributes & CACHE_ID))
> -- 
> 2.25.1
> 
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-03-27 13:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-27 11:59 [PATCH 0/3] cacheinfo: Correctly fallback to using clidr_el1's information Pierre Gondois
2023-03-27 11:59 ` [PATCH 1/3] cacheinfo: Check sib_leaf in cache_leaves_are_shared() Pierre Gondois
2023-03-27 14:04   ` Conor Dooley [this message]
2023-03-27 11:59 ` [PATCH 2/3] cacheinfo: Check cache properties are present in DT Pierre Gondois
2023-03-27 14:13   ` Conor Dooley
2023-04-04 19:29   ` Conor Dooley
2023-04-06  7:31     ` Pierre Gondois
2023-03-27 11:59 ` [PATCH 3/3] cacheinfo: Add use_arch[|_cache]_info field/function Pierre Gondois
2023-03-27 12:17   ` Will Deacon
2023-04-06  7:28     ` Pierre Gondois

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=267f5e37-2cfd-4833-a74c-bfc56fe3671c@spud \
    --to=conor.dooley@microchip.com \
    --cc=akihiko.odaki@daynix.com \
    --cc=catalin.marinas@arm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gshan@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=palmer@rivosinc.com \
    --cc=pierre.gondois@arm.com \
    --cc=rafael@kernel.org \
    --cc=rrendec@redhat.com \
    --cc=sudeep.holla@arm.com \
    --cc=will@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