linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: numa: Don't check node against MAX_NUMNODES
@ 2022-07-18  6:42 Gavin Shan
  2022-07-19 18:09 ` Will Deacon
  2022-07-19 19:56 ` Will Deacon
  0 siblings, 2 replies; 3+ messages in thread
From: Gavin Shan @ 2022-07-18  6:42 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux-kernel, catalin.marinas, will, shan.gavin

When the NUMA nodes are sorted by checking ACPI SRAT (GICC AFFINITY)
sub-table, it's impossible for acpi_map_pxm_to_node() to return
any value, which is greater than or equal to MAX_NUMNODES. Lets drop
the unnecessary check in acpi_numa_gicc_affinity_init().

No functional change intended.

Signed-off-by: Gavin Shan <gshan@redhat.com>
---
 arch/arm64/kernel/acpi_numa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/acpi_numa.c b/arch/arm64/kernel/acpi_numa.c
index fdfecf0991ce..e51535a5f939 100644
--- a/arch/arm64/kernel/acpi_numa.c
+++ b/arch/arm64/kernel/acpi_numa.c
@@ -109,7 +109,7 @@ void __init acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa)
 	pxm = pa->proximity_domain;
 	node = acpi_map_pxm_to_node(pxm);
 
-	if (node == NUMA_NO_NODE || node >= MAX_NUMNODES) {
+	if (node == NUMA_NO_NODE) {
 		pr_err("SRAT: Too many proximity domains %d\n", pxm);
 		bad_srat();
 		return;
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm64: numa: Don't check node against MAX_NUMNODES
  2022-07-18  6:42 [PATCH] arm64: numa: Don't check node against MAX_NUMNODES Gavin Shan
@ 2022-07-19 18:09 ` Will Deacon
  2022-07-19 19:56 ` Will Deacon
  1 sibling, 0 replies; 3+ messages in thread
From: Will Deacon @ 2022-07-19 18:09 UTC (permalink / raw)
  To: Gavin Shan; +Cc: linux-arm-kernel, linux-kernel, catalin.marinas, shan.gavin

On Mon, Jul 18, 2022 at 02:42:32PM +0800, Gavin Shan wrote:
> When the NUMA nodes are sorted by checking ACPI SRAT (GICC AFFINITY)
> sub-table, it's impossible for acpi_map_pxm_to_node() to return
> any value, which is greater than or equal to MAX_NUMNODES. Lets drop
> the unnecessary check in acpi_numa_gicc_affinity_init().
> 
> No functional change intended.
> 
> Signed-off-by: Gavin Shan <gshan@redhat.com>
> ---
>  arch/arm64/kernel/acpi_numa.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/acpi_numa.c b/arch/arm64/kernel/acpi_numa.c
> index fdfecf0991ce..e51535a5f939 100644
> --- a/arch/arm64/kernel/acpi_numa.c
> +++ b/arch/arm64/kernel/acpi_numa.c
> @@ -109,7 +109,7 @@ void __init acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa)
>  	pxm = pa->proximity_domain;
>  	node = acpi_map_pxm_to_node(pxm);
>  
> -	if (node == NUMA_NO_NODE || node >= MAX_NUMNODES) {
> +	if (node == NUMA_NO_NODE) {
>  		pr_err("SRAT: Too many proximity domains %d\n", pxm);
>  		bad_srat();
>  		return;

This isn't "obviously" correct, but it does look like the way in which
acpi_map_pxm_to_node() allocates nodes in 'nodes_found_map' means that this
check is redundant, so I'll pick it up.

Will

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm64: numa: Don't check node against MAX_NUMNODES
  2022-07-18  6:42 [PATCH] arm64: numa: Don't check node against MAX_NUMNODES Gavin Shan
  2022-07-19 18:09 ` Will Deacon
@ 2022-07-19 19:56 ` Will Deacon
  1 sibling, 0 replies; 3+ messages in thread
From: Will Deacon @ 2022-07-19 19:56 UTC (permalink / raw)
  To: linux-arm-kernel, Gavin Shan
  Cc: catalin.marinas, kernel-team, Will Deacon, linux-kernel, shan.gavin

On Mon, 18 Jul 2022 14:42:32 +0800, Gavin Shan wrote:
> When the NUMA nodes are sorted by checking ACPI SRAT (GICC AFFINITY)
> sub-table, it's impossible for acpi_map_pxm_to_node() to return
> any value, which is greater than or equal to MAX_NUMNODES. Lets drop
> the unnecessary check in acpi_numa_gicc_affinity_init().
> 
> No functional change intended.
> 
> [...]

Applied to arm64 (for-next/misc), thanks!

[1/1] arm64: numa: Don't check node against MAX_NUMNODES
      https://git.kernel.org/arm64/c/9e26cac5f82b

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-19 19:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-18  6:42 [PATCH] arm64: numa: Don't check node against MAX_NUMNODES Gavin Shan
2022-07-19 18:09 ` Will Deacon
2022-07-19 19:56 ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).