lkml.org 
[lkml]   [2023]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 7/7] x86/resctrl: Determine if Sub-NUMA Cluster is enabled and initialize.
Hi Tony,

On Thu, Jan 26, 2023 at 7:42 PM Tony Luck <tony.luck@intel.com> wrote:
> +static __init int find_snc_ways(void)
> +{
> + unsigned long *node_caches;
> + int cpu, node, ret;
> +
> + node_caches = kcalloc(BITS_TO_LONGS(nr_node_ids), sizeof(*node_caches), GFP_KERNEL);
> + if (!node_caches)
> + return 1;
> +
> + cpus_read_lock();
> + for_each_node(node) {

Someone tried this patch on a machine with a CPU-less node...

We need to check for this:

+ if (cpumask_empty(cpumask_of_node(node)))
+ continue;

> + cpu = cpumask_first(cpumask_of_node(node));
> + set_bit(get_cpu_cacheinfo_id(cpu, 3), node_caches);
> + }
> + cpus_read_unlock();

Thanks!
-Peter

\
 
 \ /
  Last update: 2023-03-27 00:37    [W:0.813 / U:0.592 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site