Patch "arm64/mm: return cpu_all_mask when node is NUMA_NO_NODE" has been added to the 5.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    arm64/mm: return cpu_all_mask when node is NUMA_NO_NODE

to the 5.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     arm64-mm-return-cpu_all_mask-when-node-is-numa_no_no.patch
and it can be found in the queue-5.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 5e85d2382df7708d08e338a710d3255c414d7fe6
Author: Zhengyuan Liu <liuzhengyuan@xxxxxxxxxxxxx>
Date:   Mon Sep 21 10:39:36 2020 +0800

    arm64/mm: return cpu_all_mask when node is NUMA_NO_NODE
    
    [ Upstream commit a194c5f2d2b3a05428805146afcabe5140b5d378 ]
    
    The @node passed to cpumask_of_node() can be NUMA_NO_NODE, in that
    case it will trigger the following WARN_ON(node >= nr_node_ids) due to
    mismatched data types of @node and @nr_node_ids. Actually we should
    return cpu_all_mask just like most other architectures do if passed
    NUMA_NO_NODE.
    
    Also add a similar check to the inline cpumask_of_node() in numa.h.
    
    Signed-off-by: Zhengyuan Liu <liuzhengyuan@xxxxxxxxxxxxx>
    Reviewed-by: Gavin Shan <gshan@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20200921023936.21846-1-liuzhengyuan@xxxxxxxxxxxxx
    Signed-off-by: Will Deacon <will@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/arm64/include/asm/numa.h b/arch/arm64/include/asm/numa.h
index 626ad01e83bf0..dd870390d639f 100644
--- a/arch/arm64/include/asm/numa.h
+++ b/arch/arm64/include/asm/numa.h
@@ -25,6 +25,9 @@ const struct cpumask *cpumask_of_node(int node);
 /* Returns a pointer to the cpumask of CPUs on Node 'node'. */
 static inline const struct cpumask *cpumask_of_node(int node)
 {
+	if (node == NUMA_NO_NODE)
+		return cpu_all_mask;
+
 	return node_to_cpumask_map[node];
 }
 #endif
diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c
index 73f8b49d485c2..88e51aade0da0 100644
--- a/arch/arm64/mm/numa.c
+++ b/arch/arm64/mm/numa.c
@@ -46,7 +46,11 @@ EXPORT_SYMBOL(node_to_cpumask_map);
  */
 const struct cpumask *cpumask_of_node(int node)
 {
-	if (WARN_ON(node >= nr_node_ids))
+
+	if (node == NUMA_NO_NODE)
+		return cpu_all_mask;
+
+	if (WARN_ON(node < 0 || node >= nr_node_ids))
 		return cpu_none_mask;
 
 	if (WARN_ON(node_to_cpumask_map[node] == NULL))



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux