From: Gregory CLEMENT <gregory.clement@bootlin.com>
To: Jiaxun Yang <jiaxun.yang@flygoat.com>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: "Vladimir Kondratiev" <vladimir.kondratiev@mobileye.com>,
"Théo Lebrun" <theo.lebrun@bootlin.com>,
"Tawfik Bayouk" <tawfik.bayouk@mobileye.com>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
"linux-mips@vger.kernel.org" <linux-mips@vger.kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] MIPS: CPS: Optimise delay CPU calibration for SMP
Date: Thu, 22 May 2025 17:02:14 +0200 [thread overview]
Message-ID: <87iklsofih.fsf@BLaptop.bootlin.com> (raw)
In-Reply-To: <105ed884-9ee8-429a-9937-d8f58a221faa@app.fastmail.com>
Hello Jiaxun Yang,
> 在2025年5月21日周三 上午8:47,Gregory CLEMENT写道:
>> Hello Jiaxun,
>>
>>> 在2025年5月20日周二 下午4:21,Gregory CLEMENT写道:
>>> [...]
>>>>
>>>> This allows to implement calibrate_delay_is_known(), which will return
>>>> 0 (triggering calibration) only for the primary CPU of each
>>>> cluster. For other CPUs, we can simply reuse the value from their
>>>> cluster's primary CPU core.
>>>
>>> Is __cpu_primary_cluster_mask really necessary?
>>>
>>> Maybe we can just test if current CPU is the first powered up CPU
>>> in the cluster?
>>
>> That is exactly the point of __cpu_primary_cluster_mask: setting in an
>> efficient way the first powered-up CPU for each cluster. This adds only
>> a single variable (which is actually just a long) and allows for minimal
>> impact during boot time, by doing the minimum write and read operations
>>
>> I don't see a better alternative. What do you have in mind ?
>
> Maybe we can try mips_cps_first_online_in_cluster()?
I didn't notice this function initially, but upon closer inspection, it
appears that although the scan process is optimized, it still performs a
full scan for each CPU during boot. In contrast, with the mask, the
information is created only once and within an existing loop.
I believe this function would benefit from __cpu_primary_cluster_mask,
which is why I prefer my current implementation over using
mips_cps_first_online_in_cluster().
Regards,
Thanks
>
> [...]
>
> Thanks
>
> --
> - Jiaxun
--
Grégory CLEMENT, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2025-05-22 15:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-20 15:21 [PATCH] MIPS: CPS: Optimise delay CPU calibration for SMP Gregory CLEMENT
2025-05-20 15:35 ` Jiaxun Yang
2025-05-21 7:47 ` Gregory CLEMENT
2025-05-22 13:03 ` Jiaxun Yang
2025-05-22 15:02 ` Gregory CLEMENT [this message]
2025-05-22 15:10 ` Jiaxun Yang
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=87iklsofih.fsf@BLaptop.bootlin.com \
--to=gregory.clement@bootlin.com \
--cc=jiaxun.yang@flygoat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=tawfik.bayouk@mobileye.com \
--cc=theo.lebrun@bootlin.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=tsbogend@alpha.franken.de \
--cc=vladimir.kondratiev@mobileye.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.