[PATCH] arm64/mm: return cpu_all_mask when node is NUMA_NO_NODE
Zhengyuan Liu
liuzhengyuan at tj.kylinos.cn
Sun Sep 20 05:15:45 EDT 2020
On 2020/9/20 上午8:09, Gavin Shan wrote:
> On 9/18/20 11:15 AM, Zhengyuan Liu wrote:
>> Filter out NUMA_NO_NODE before returning cpumask of a node, otherwise
>> it will triger the following WARN_ON(node >= nr_node_ids).
>>
>> Signed-off-by: Zhengyuan Liu <liuzhengyuan at tj.kylinos.cn>
>> ---
>
> With two improvements as discussed:
>
> - Explain how the following WARN_ON() is triggered because of
> mismatched data types of @node and @nr_node_ids in change log.
> - Similar changes to cpumask_of_node() in numa.h
>
> With these fixed:
>
> Reviewed-by: Gavin Shan <gshan at redhat.com>
Thanks for review, I will resend a V2 with the two improvements.
>
>> arch/arm64/mm/numa.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c
>> index 73f8b49d485c..78f9b7dab656 100644
>> --- a/arch/arm64/mm/numa.c
>> +++ b/arch/arm64/mm/numa.c
>> @@ -46,6 +46,9 @@ EXPORT_SYMBOL(node_to_cpumask_map);
>> */
>> const struct cpumask *cpumask_of_node(int node)
>> {
>> + if (node == NUMA_NO_NODE)
>> + return cpu_all_mask;
>> +
>> if (WARN_ON(node >= nr_node_ids))
>> return cpu_none_mask;
>>
>
>
More information about the linux-arm-kernel
mailing list