Re: [PATCH v2 1/3] cacheinfo: Check sib_leaf in cache_leaves_are_shared()

From: Conor Dooley
Date: Wed Apr 12 2023 - 09:50:16 EST


On Wed, Apr 12, 2023 at 03:20:19PM +0200, Pierre Gondois wrote:
> > On Wed, Apr 12, 2023 at 02:34:11PM +0200, Pierre Gondois wrote:

> > Another silly question:
> > For two caches of level M & N; M != N; M, N > 1 should they be detected
> > as shared in the absence of any information in DT/ACPI?
> > The comment (to me) reads as if they should not, but it is rather vague.
>
> I think they should. The naming of cache_leaves_are_shared() might be
> misleading. The function is more trying to find out if 2 cache leaves struct
> are representing the same cache. So maybe renaming the function to
> cache_leaves_identical() might be better?

Nah, I don't think this is really the fault of anything other than the
!DT && !ACPI situation.
I'm just trying to make sure I understand the intended behaviour in that
scenario, that's all.

> If there is no DT/ACPI, it is not possible to identify whether 2 cache leaves
> are representing the same cache. The desired behaviour is just:
> - If this_leaf or sib_leaf is a L1 cache, then the caches are not identical
> (or shared if we use this wording)

> So the meaning of cache_leaves_identical() is a bit bent for this
> configuration.

Fair enough.

Attachment: signature.asc
Description: PGP signature