From: Sudeep Holla <sudeep.holla@arm.com>
To: Jeremy Linton <jeremy.linton@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
john.garry@huawei.com, "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Shaokun Zhang <zhangshaokun@hisilicon.com>,
qiuzhenfa@hisilicon.com, guohanjun@huawei.com,
linux-arm-kernel@lists.infradead.org, Len Brown <lenb@kernel.org>
Subject: Re: [PATCH 1/2] ACPI/PPTT: Add variable to record max cache line size
Date: Mon, 29 Apr 2019 12:26:45 +0100 [thread overview]
Message-ID: <20190429112645.GC23929@e107155-lin> (raw)
In-Reply-To: <ec06edc0-f1ec-ef8e-78ad-7bef7ae79931@arm.com>
On Fri, Apr 26, 2019 at 12:02:45PM -0500, Jeremy Linton wrote:
> Hi,
>
>
> On 4/25/19 8:40 PM, Shaokun Zhang wrote:
> > Add coherency_max_size variable to record the maximum cache line size
> > detected from PPTT information for different cache levels. We will
> > synchronize it with CTR_EL0.CWG reporting in cache_line_size() for arm64.
>
> Is the expectation that the largest cache line size will differ from the LLC
> line size?
>
It's always better to assume so. If we are sure that LLC has max cache line
size, then we can simplify, but I don't think we can assure that :)
> Also, will it remain consistent across all PE's? I believe this is required,
> Yes?
>
It would be same as heterogeneous systems, we just choose max value for
the system.
>
> >
> > Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> > Cc: Len Brown <lenb@kernel.org>
> > Cc: Jeremy Linton <jeremy.linton@arm.com>
> > Cc: Catalin Marinas <catalin.marinas@arm.com>
> > To: linux-acpi@vger.kernel.org
> > Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
> > ---
> > drivers/acpi/pptt.c | 7 ++++++-
> > include/linux/acpi.h | 1 +
> > 2 files changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c
> > index 065c4fc245d1..3998621e00ce 100644
> > --- a/drivers/acpi/pptt.c
> > +++ b/drivers/acpi/pptt.c
> > @@ -341,6 +341,8 @@ static struct acpi_pptt_cache *acpi_find_cache_node(struct acpi_table_header *ta
> > return found;
> > }
> > +unsigned int coherency_max_size;
> > +
> > /**
> > * update_cache_properties() - Update cacheinfo for the given processor
> > * @this_leaf: Kernel cache info structure being updated
> > @@ -360,8 +362,11 @@ static void update_cache_properties(struct cacheinfo *this_leaf,
> > this_leaf->fw_token = cpu_node;
> > if (found_cache->flags & ACPI_PPTT_SIZE_PROPERTY_VALID)
> > this_leaf->size = found_cache->size;
> > - if (found_cache->flags & ACPI_PPTT_LINE_SIZE_VALID)
> > + if (found_cache->flags & ACPI_PPTT_LINE_SIZE_VALID) {
> > this_leaf->coherency_line_size = found_cache->line_size;
> > + coherency_max_size = this_leaf->coherency_line_size > coherency_max_size ?
> > + this_leaf->coherency_line_size : coherency_max_size;
> > + }
> > if (found_cache->flags & ACPI_PPTT_NUMBER_OF_SETS_VALID)
> > this_leaf->number_of_sets = found_cache->number_of_sets;
> > if (found_cache->flags & ACPI_PPTT_ASSOCIATIVITY_VALID)
> > diff --git a/include/linux/acpi.h b/include/linux/acpi.h
> > index d5dcebd7aad3..199cde875d5b 100644
> > --- a/include/linux/acpi.h
> > +++ b/include/linux/acpi.h
> > @@ -315,6 +315,7 @@ static inline bool acpi_sci_irq_valid(void)
> > extern int sbf_port;
> > extern unsigned long acpi_realmode_flags;
> > +extern unsigned int coherency_max_size;
>
> Assuming that the LLC doesn't reflect the max cache line size, and it can't
> be pulled directly from the cpu_cacheinfo, I don't think this is the ideal
> place for this code. Given that DT has a cache line property as well, I
> suspect cache_shared_cpu_map_setup() may be a better place. Although, that
> isn't ideal either, as both these pieces of code have the pretense of being
> architecture neutral. Maybe a new call into arch/arm64/cacheinfo.c?
>
Indeed, we need to consider DT systems too. We can just solve the issue
for ACPI based systems.
Or drivers/base/cacheinfo.c if other architectures are also interested or
doesn't affect them if we add one :), but I don't count too much on this
though as it may end up breaking some other archs.
--
Regards,
Sudeep
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-04-29 11:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-26 1:40 [PATCH 1/2] ACPI/PPTT: Add variable to record max cache line size Shaokun Zhang
2019-04-26 1:40 ` [PATCH 2/2] arm64: cacheinfo: Update cache_line_size detected from PPTT Shaokun Zhang
2019-04-26 17:18 ` Jeremy Linton
2019-04-27 16:12 ` Catalin Marinas
2019-04-29 11:12 ` Sudeep Holla
2019-04-29 11:06 ` Sudeep Holla
2019-04-27 16:16 ` Catalin Marinas
2019-04-30 1:32 ` Zhangshaokun
2019-04-26 17:02 ` [PATCH 1/2] ACPI/PPTT: Add variable to record max cache line size Jeremy Linton
2019-04-29 11:26 ` Sudeep Holla [this message]
2019-04-30 2:19 ` Zhangshaokun
2019-04-30 2:13 ` Zhangshaokun
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=20190429112645.GC23929@e107155-lin \
--to=sudeep.holla@arm.com \
--cc=catalin.marinas@arm.com \
--cc=guohanjun@huawei.com \
--cc=jeremy.linton@arm.com \
--cc=john.garry@huawei.com \
--cc=lenb@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=qiuzhenfa@hisilicon.com \
--cc=rjw@rjwysocki.net \
--cc=zhangshaokun@hisilicon.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).