linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/powernv: Fix memtrace build when NUMA=n
@ 2018-05-10 13:09 Michael Ellerman
  2018-05-16 13:38 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Ellerman @ 2018-05-10 13:09 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: rashmica.g, anton

Currently memtrace doesn't build if NUMA=n:

  In function ‘memtrace_alloc_node’:
  arch/powerpc/platforms/powernv/memtrace.c:134:6:
  error: the address of ‘contig_page_data’ will always evaluate as ‘true’
    if (!NODE_DATA(nid) || !node_spanned_pages(nid))
        ^

This is because for NUMA=n NODE_DATA(nid) points to an always
allocated structure, contig_page_data.

But even in the NUMA=y case memtrace_alloc_node() is only called for
online nodes, and we should always have a NODE_DATA() allocated for an
online node. So remove the (hopefully) overly paranoid check, which
also means we can build when NUMA=n.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/platforms/powernv/memtrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/powernv/memtrace.c b/arch/powerpc/platforms/powernv/memtrace.c
index fc222a0c2ac4..b99283df8584 100644
--- a/arch/powerpc/platforms/powernv/memtrace.c
+++ b/arch/powerpc/platforms/powernv/memtrace.c
@@ -131,7 +131,7 @@ static u64 memtrace_alloc_node(u32 nid, u64 size)
 	u64 start_pfn, end_pfn, nr_pages;
 	u64 base_pfn;
 
-	if (!NODE_DATA(nid) || !node_spanned_pages(nid))
+	if (!node_spanned_pages(nid))
 		return 0;
 
 	start_pfn = node_start_pfn(nid);
-- 
2.14.1

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

* Re: powerpc/powernv: Fix memtrace build when NUMA=n
  2018-05-10 13:09 [PATCH] powerpc/powernv: Fix memtrace build when NUMA=n Michael Ellerman
@ 2018-05-16 13:38 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2018-05-16 13:38 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev; +Cc: rashmica.g, anton

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 877 bytes --]

On Thu, 2018-05-10 at 13:09:13 UTC, Michael Ellerman wrote:
> Currently memtrace doesn't build if NUMA=n:
> 
>   In function ‘memtrace_alloc_node’:
>   arch/powerpc/platforms/powernv/memtrace.c:134:6:
>   error: the address of ‘contig_page_data’ will always evaluate as ‘true’
>     if (!NODE_DATA(nid) || !node_spanned_pages(nid))
>         ^
> 
> This is because for NUMA=n NODE_DATA(nid) points to an always
> allocated structure, contig_page_data.
> 
> But even in the NUMA=y case memtrace_alloc_node() is only called for
> online nodes, and we should always have a NODE_DATA() allocated for an
> online node. So remove the (hopefully) overly paranoid check, which
> also means we can build when NUMA=n.
> 
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Applied to powerpc next.

https://git.kernel.org/powerpc/c/8ccb442dec0ab53eefb5a607e405f7

cheers

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

end of thread, other threads:[~2018-05-16 13:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-10 13:09 [PATCH] powerpc/powernv: Fix memtrace build when NUMA=n Michael Ellerman
2018-05-16 13:38 ` Michael Ellerman

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).