All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Lynch <nathanl@linux.ibm.com>
To: Scott Cheloha <cheloha@linux.ibm.com>
Cc: "Nathan Fontenont" <ndfont@gmail.com>,
	"David Hildenbrand" <david@redhat.com>,
	"Aneesh Kumar" <aneesh.kumar@linux.ibm.com>,
	"Paul Mackerras" <paulus@samba.org>,
	"Michal Suchánek" <msuchanek@suse.de>,
	linuxppc-dev@lists.ozlabs.org,
	"Rick Lindsley" <ricklind@linux.vnet.ibm.com>
Subject: Re: [RFC PATCH v1] pseries/drmem: don't cache node id in drmem_lmb struct
Date: Mon, 30 Mar 2020 12:07:29 -0500	[thread overview]
Message-ID: <87r1x9ixf2.fsf@linux.ibm.com> (raw)
In-Reply-To: <20200312160704.cmmo7titbh7u4jia@rascal.austin.ibm.com>

Scott Cheloha <cheloha@linux.ibm.com> writes:
> Hi Michal,
>
> On Thu, Mar 12, 2020 at 06:02:37AM +0100, Michal Suchánek wrote:
>> 
>> You basically revert the below which will likely cause the very error
>> that was fixed there:
>> 
>> commit b2d3b5ee66f2a04a918cc043cec0c9ed3de58f40
>> Author: Nathan Fontenot <nfont@linux.vnet.ibm.com>
>> Date:   Tue Oct 2 10:35:59 2018 -0500
>> 
>>     powerpc/pseries: Track LMB nid instead of using device tree
>>     
>>     When removing memory we need to remove the memory from the node
>>     it was added to instead of looking up the node it should be in
>>     in the device tree.
>>     
>>     During testing we have seen scenarios where the affinity for a
>>     LMB changes due to a partition migration or PRRN event. In these
>>     cases the node the LMB exists in may not match the node the device
>>     tree indicates it belongs in. This can lead to a system crash
>>     when trying to DLPAR remove the LMB after a migration or PRRN
>>     event. The current code looks up the node in the device tree to
>>     remove the LMB from, the crash occurs when we try to offline this
>>     node and it does not have any data, i.e. node_data[nid] == NULL.
>
> I'm aware of this patch and that this is a near-total revert.
>
> I'm not reintroducing the original behavior, though.  Instead of going
> to the device tree to recompute the expected node id I'm retrieving it
> from the LMB's corresponding memory_block.
>
> That crucial difference is this chunk:
>
> --- a/arch/powerpc/platforms/pseries/hotplug-memory.c
> +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
> @@ -376,25 +376,29 @@ static int dlpar_add_lmb(struct drmem_lmb *);
>  
>  static int dlpar_remove_lmb(struct drmem_lmb *lmb)
>  {
> +	struct memory_block *mem_block;
>  	unsigned long block_sz;
>  	int rc;
>  
>  	if (!lmb_is_removable(lmb))
>  		return -EINVAL;
>  
> +	mem_block = lmb_to_memblock(lmb);
> +	if (mem_block == NULL)
> +		return -EINVAL;
> +

Assuming lmb_to_memblock() -> find_memory_block() isn't engaging in O(n)
behavior or worse (which is the case in linux-next), then I think
Scott's change makes sense and is a net win.

      reply	other threads:[~2020-03-30 17:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 23:08 [RFC PATCH v1] pseries/drmem: don't cache node id in drmem_lmb struct Scott Cheloha
2020-03-12  5:02 ` Michal Suchánek
2020-03-12 16:07   ` Scott Cheloha
2020-03-30 17:07     ` Nathan Lynch [this message]

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=87r1x9ixf2.fsf@linux.ibm.com \
    --to=nathanl@linux.ibm.com \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=cheloha@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=msuchanek@suse.de \
    --cc=ndfont@gmail.com \
    --cc=paulus@samba.org \
    --cc=ricklind@linux.vnet.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.