Subject: Re: [next] [arm64] kernel BUG at arch/arm64/mm/physaddr.c

From: Miles Chen <[email-masked]>
Date: Wed, 16 Jun 2021 07:40:12 +0800

On Wed, 2021-06-16 at 09:34 +1000, Stephen Rothwell wrote:
> Hi all,
> 
> On Tue, 15 Jun 2021 22:21:32 +0300 Mike Rapoport <[email-masked]> wrote:
> >
> > On Tue, Jun 15, 2021 at 10:50:31AM -0400, Qian Cai wrote:
> > > 
> > > On 6/15/2021 9:19 AM, Mark Rutland wrote:  
> > > > Looking some more, it looks like that's correct in isolation, but it
> > > > clashes with commit:
> > > > 
> > > >   5831eedad2ac6f38 ("mm: replace CONFIG_NEED_MULTIPLE_NODES with CONFIG_NUMA")  
> > > 
> > > Just a data point. Reverting the commit alone fixed the same crash for me.  
> > 
> > Yeah, that commit didn't take into the account the change in
> > pgdat_to_phys().
> > 
> > The patch below should fix it. In the long run I think we should get rid of
> > contig_page_data and allocate NODE_DATA(0) for !NUMA case as well.
> > 
> > Andrew, can you please add this as a fixup to "mm: replace
> > CONFIG_NEED_MULTIPLE_NODES with CONFIG_NUMA"?
> > 
> > 
> > diff --git a/mm/sparse.c b/mm/sparse.c
> > index a0e9cdb5bc38..6326cdf36c4f 100644
> > --- a/mm/sparse.c
> > +++ b/mm/sparse.c
> > @@ -347,7 +347,7 @@ size_t mem_section_usage_size(void)
> >  
> >  static inline phys_addr_t pgdat_to_phys(struct pglist_data *pgdat)
> >  {
> > -#ifndef CONFIG_NEED_MULTIPLE_NODES
> > +#ifndef CONFIG_NUMA
> >  	return __pa_symbol(pgdat);
> >  #else
> >  	return __pa(pgdat);
> 
> Added to linux-next today.
> 

Sorry for my late response.
thanks for doing this. 

Miles