From: Michael Bringmann <mwb@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>,
Reza Arbab <arbab@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, Paul Mackerras <paulus@samba.org>,
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
Bharata B Rao <bharata@linux.vnet.ib>,
Shailendra Singh <shailendras@nvidia.com>,
Thomas Gleixner <tglx@linutronix.de>,
linuxppc-dev@lists.ozlabs.org,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: Re: [Patch 2/2]: powerpc/hotplug/mm: Fix hot-add memory node assoc
Date: Wed, 24 May 2017 18:55:08 -0500 [thread overview]
Message-ID: <8e2417d8-d108-2949-40f2-997d53a3f367@linux.vnet.ibm.com> (raw)
In-Reply-To: <87poeya4dt.fsf@concordia.ellerman.id.au>
On 05/24/2017 06:19 AM, Michael Ellerman wrote:
> Michael Bringmann <mwb@linux.vnet.ibm.com> writes:
>
>> On 05/23/2017 04:49 PM, Reza Arbab wrote:
>>> On Tue, May 23, 2017 at 03:05:08PM -0500, Michael Bringmann wrote:
>>>> On 05/23/2017 10:52 AM, Reza Arbab wrote:
>>>>> On Tue, May 23, 2017 at 10:15:44AM -0500, Michael Bringmann wrote:
>>>>>> +static void setup_nodes(void)
>>>>>> +{
>>>>>> + int i, l = 32 /* MAX_NUMNODES */;
>>>>>> +
>>>>>> + for (i = 0; i < l; i++) {
>>>>>> + if (!node_possible(i)) {
>>>>>> + setup_node_data(i, 0, 0);
>>>>>> + node_set(i, node_possible_map);
>>>>>> + }
>>>>>> + }
>>>>>> +}
>>>>>
>>>>> This seems to be a workaround for 3af229f2071f ("powerpc/numa: Reset node_possible_map to only node_online_map").
>>>>
>>>> They may be related, but that commit is not a replacement. The above patch ensures that
>>>> there are enough of the nodes initialized at startup to allow for memory hot-add into a
>>>> node that was not used at boot. (See 'setup_node_data' function in 'numa.c'.) That and
>>>> recording that the node was initialized.
>>>
>>> Is it really necessary to preinitialize these empty nodes using setup_node_data()? When you do memory hotadd into a node that was not used at boot, the node data already gets set up by
>>>
>>> add_memory
>>> add_memory_resource
>>> hotadd_new_pgdat
>>> arch_alloc_nodedata <-- allocs the pg_data_t
>>> ...
>>> free_area_init_node <-- sets NODE_DATA(nid)->node_id, etc.
>>>
>>> Removing setup_node_data() from that loop leaves only the call to node_set(). If 3af229f2071f (which reduces node_possible_map) was reverted, you wouldn't need to do that either.
>>
>> With or without 3af229f2071f, we would still need to add something, somewhere to add new
>> bits to the 'node_possible_map'. That is not being done.
>
> You mustn't add bits to the possible map after boot.
>
> That's its purpose, to tell you what nodes could ever *possibly* exist.
The problem that I have been encountering is that the 'possible map' did *not*
show all of the possible nodes. Rather, it showed only the nodes that were
assigned memory at boot-up. If more memory were hot-added to the kernel, it
could be assigned into one of the nodes that were skipped at boot. However,
nothing was updating the 'node_possible_map' correctly in the kernel memory
code.
Reza pointed out a code change in commit 3af229f2071f that has not made it into
the 4.12 checkout i.e. removing the instruction that reduces the node_possible_map.
This may well be a suitable replacement for the code that I have here, and I
will test it here next.
>
> cheers
>
>
Later.
--
Michael W. Bringmann
Linux Technology Center
IBM Corporation
Tie-Line 363-5196
External: (512) 286-5196
Cell: (512) 466-0650
mwb@linux.vnet.ibm.com
next prev parent reply other threads:[~2017-05-24 23:55 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-23 15:15 Michael Bringmann
2017-05-23 15:52 ` Reza Arbab
2017-05-23 20:05 ` Michael Bringmann
2017-05-23 21:49 ` Reza Arbab
2017-05-23 22:41 ` Michael Bringmann
2017-05-23 22:44 ` Michael Bringmann
2017-05-24 11:19 ` Michael Ellerman
2017-05-24 23:55 ` Michael Bringmann [this message]
2017-05-25 6:19 ` Michael Ellerman
2017-05-25 13:40 ` Michael Bringmann
2017-05-25 15:10 ` Reza Arbab
2017-05-25 15:26 ` Michael Bringmann
2017-05-26 3:46 ` Balbir Singh
2017-05-26 3:46 ` Michael Ellerman
2017-05-26 12:31 ` Michael Bringmann
2017-05-26 14:31 ` Reza Arbab
2017-05-29 5:32 ` Michael Ellerman
2017-05-31 14:05 ` Michael Bringmann
2017-06-01 9:36 ` Michael Ellerman
2017-06-01 21:33 ` Reza Arbab
2017-06-07 8:06 ` Balbir Singh
2017-06-07 12:07 ` Michael Ellerman
2017-06-02 5:24 ` Michael Bringmann
2017-06-06 9:48 ` Michael Ellerman
2017-06-06 16:16 ` Michael Bringmann
2017-06-07 12:08 ` Michael Ellerman
2017-06-07 17:28 ` RESEND " Michael Bringmann
2017-06-13 10:45 ` Michael Ellerman
2017-06-13 22:21 ` Michael Bringmann
[not found] ` <CAKTCnz==4vA4PevndTLF7p2PPKCM8ZkqpuCXPp9kFcjn+CqUKA@mail.gmail.com>
2017-06-14 5:27 ` Balbir Singh
2017-06-14 13:41 ` Michael Bringmann
2017-05-24 14:36 ` Reza Arbab
2017-05-24 23:41 ` Michael Bringmann
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=8e2417d8-d108-2949-40f2-997d53a3f367@linux.vnet.ibm.com \
--to=mwb@linux.vnet.ibm.com \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=arbab@linux.vnet.ibm.com \
--cc=bharata@linux.vnet.ib \
--cc=bigeasy@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
--cc=shailendras@nvidia.com \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®