From: Michal Hocko <mhocko@suse.com>
To: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, Mel Gorman <mgorman@suse.de>,
Michael Ellerman <mpe@ellerman.id.au>,
Sachin Sant <sachinp@linux.vnet.ibm.com>,
Christopher Lameter <cl@linux.com>,
linuxppc-dev@lists.ozlabs.org,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Kirill Tkhai <ktkhai@virtuozzo.com>,
Vlastimil Babka <vbabka@suse.cz>,
Bharata B Rao <bharata@linux.ibm.com>,
Nathan Lynch <nathanl@linux.ibm.com>
Subject: Re: [PATCH v2 1/4] mm: Check for node_online in node_present_pages
Date: Wed, 18 Mar 2020 12:14:39 +0100 [thread overview]
Message-ID: <20200318111439.GJ21362@dhcp22.suse.cz> (raw)
In-Reply-To: <20200318110215.GC27520@linux.vnet.ibm.com>
On Wed 18-03-20 16:32:15, Srikar Dronamraju wrote:
> * Michal Hocko <mhocko@suse.com> [2020-03-18 11:02:56]:
>
> > On Wed 18-03-20 12:58:07, Srikar Dronamraju wrote:
[...]
> > > -#define node_present_pages(nid) (NODE_DATA(nid)->node_present_pages)
> > > -#define node_spanned_pages(nid) (NODE_DATA(nid)->node_spanned_pages)
> > > +#define node_present_pages(nid) \
> > > + (node_online(nid) ? NODE_DATA(nid)->node_present_pages : 0)
> > > +#define node_spanned_pages(nid) \
> > > + (node_online(nid) ? NODE_DATA(nid)->node_spanned_pages : 0)
> >
> > I believe this is a wrong approach. We really do not want to special
> > case all the places which require NODE_DATA. Can we please go and
> > allocate pgdat for all possible nodes?
> >
>
> I can do that but the question I had was should we make this change just for
> Powerpc or should the change be for other archs.
No, we shouldn't, really. If NODE_DATA is non-null for all possible
nodes then this shouldn't be really necessary and arch specific.
> NODE_DATA initialization always seems to be in arch specific code.
>
> The other archs that are affected seem to be mips, sh and sparc
> These archs seem to have making an assumption that NODE_DATA has to be local
> only,
Which is all good and fine for nodes that hold some memory. If those
architectures support memory less nodes at all then I do not see any
problem to have remote pgdata.
> For example on sparc / arch/sparc/mm/init_64.c in allocate_node_data function.
>
> NODE_DATA(nid) = memblock_alloc_node(sizeof(struct pglist_data),
> SMP_CACHE_BYTES, nid);
> if (!NODE_DATA(nid)) {
> prom_printf("Cannot allocate pglist_data for nid[%d]\n", nid);
> prom_halt();
> }
>
> NODE_DATA(nid)->node_id = nid;
This code is not about memroy less nodes, is it? It looks more like a
allocation failure panic-like handling because there is not enough
memory to hold pgdat. This also strongly suggests that this platform
doesn't really expect memory less nodes in the early init path.
> So even if I make changes to allocate NODE_DATA from fallback node, I may not
> be able to test them.
Please try to focus on the architecture you can test for. From the
existing reports I have seen this looks mostly to be a problem for x86
and ppc
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2020-03-18 11:14 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-18 7:28 [PATCH v2 0/4] Fix kmalloc_node on offline nodes Srikar Dronamraju
2020-03-18 7:28 ` [PATCH v2 1/4] mm: Check for node_online in node_present_pages Srikar Dronamraju
2020-03-18 10:02 ` Michal Hocko
2020-03-18 11:02 ` Srikar Dronamraju
2020-03-18 11:14 ` Michal Hocko [this message]
2020-03-18 11:53 ` Vlastimil Babka
2020-03-18 12:52 ` Michal Hocko
2020-03-19 0:32 ` Michael Ellerman
2020-03-19 1:11 ` Michael Ellerman
2020-03-19 9:38 ` Vlastimil Babka
2020-03-18 7:28 ` [PATCH v2 2/4] mm/slub: Use mem_node to allocate a new slab Srikar Dronamraju
2020-03-18 7:28 ` [PATCH v2 3/4] mm: Implement reset_numa_mem Srikar Dronamraju
2020-03-18 19:20 ` Christopher Lameter
2020-03-19 7:44 ` Michal Hocko
2020-03-18 7:28 ` [PATCH v2 4/4] powerpc/numa: Set fallback nodes for offline nodes Srikar Dronamraju
2020-03-18 14:28 ` kbuild test robot
2020-03-18 18:56 ` kbuild test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200318111439.GJ21362@dhcp22.suse.cz \
--to=mhocko@suse.com \
--cc=akpm@linux-foundation.org \
--cc=bharata@linux.ibm.com \
--cc=cl@linux.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=ktkhai@virtuozzo.com \
--cc=linux-mm@kvack.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mgorman@suse.de \
--cc=mpe@ellerman.id.au \
--cc=nathanl@linux.ibm.com \
--cc=sachinp@linux.vnet.ibm.com \
--cc=srikar@linux.vnet.ibm.com \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox