[PATCH v4 8/8] riscv_cbqri: Add CBQRI capacity allocation platform driver
Drew Fustini
fustini at kernel.org
Wed Jul 8 23:09:47 PDT 2026
Hi Reinette,
(replying in v4 as you suggested)
On Tue, Jul 07, 2026 at 11:18:00AM -0700, Reinette Chatre wrote:
> On 6/28/26 2:18 PM, Drew Fustini wrote:
> > + cache_id = -1;
> > + cpus_read_lock();
> > + for_each_online_cpu(cpu) {
> > + struct cacheinfo *ci = get_cpu_cacheinfo_level(cpu, cache_level);
> > +
> > + if (ci && ci->fw_token == cache_np) {
> > + cache_id = ci->id;
> > + cpumask_copy(cpu_mask, &ci->shared_cpu_map);
>
> The way I understand cacheinfo::shared_cpu_map is that it only contains the
> online CPUs that share the cache with this CPU and if the CPU is offline
> then shared_cpu_map only contains the CPU self.
>
> It is thus not clear to me that this handles all the possible CPU online vs
> offline scenarios. For example, if all or some CPUs of a domain are offline
> during cbqri_capacity_probe() and then come online later. It is not clear
> to me whether cbqri_controller_info::cache_id,
> cbqri_controller::cache_controller::cache_id, or
> cbqri_controller::cache_controller::cpu_mask are needed. Could the cache ID
> associated with a CPU at the time it comes online to dynamically associate
> it with the resctrl domain that is indexed by the cache ID? This may
> simplify a couple of flows.
Thank you for the suggestion, it does simplify things. I will drop the
probe-time cpu_mask and associate CPUs with domains the way you suggest,
from the CPU's own cache id at hotplug time.
Thanks,
Drew
More information about the linux-riscv
mailing list