From: Michael Bringmann <mwb@linux.vnet.ibm.com>
To: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
linuxppc-dev@lists.ozlabs.org
Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>,
Juliet Kim <minkim@us.ibm.com>,
Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Subject: Re: [PATCH v06 3/5] migration/memory: Add hotplug READD_MULTIPLE
Date: Tue, 16 Oct 2018 16:31:32 -0500 [thread overview]
Message-ID: <8fa9d2c2-97a9-69ac-1e3b-cdf867e225e2@linux.vnet.ibm.com> (raw)
In-Reply-To: <80494db2-6a01-059f-890c-df7c410714f7@linux.vnet.ibm.com>
On 10/16/2018 02:57 PM, Tyrel Datwyler wrote:
> On 10/15/2018 05:39 PM, Michael Ellerman wrote:
>> Michael Bringmann <mwb@linux.vnet.ibm.com> writes:
>>> diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
>>> index 2b796da..9c76345 100644
>>> --- a/arch/powerpc/platforms/pseries/hotplug-memory.c
>>> +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
>>> @@ -541,6 +549,23 @@ static int dlpar_memory_readd_by_index(u32 drc_index)
>>> return rc;
>>> }
>>>
>>> +static int dlpar_memory_readd_multiple(void)
>>> +{
>>> + struct drmem_lmb *lmb;
>>> + int rc;
>>> +
>>> + pr_info("Attempting to update multiple LMBs\n");
>>> +
>>> + for_each_drmem_lmb(lmb) {
>>> + if (drmem_lmb_update(lmb)) {
>>> + rc = dlpar_memory_readd_helper(lmb);
>>> + drmem_remove_lmb_update(lmb);
>>> + }
>>> + }
>>> +
>>> + return rc;
>>> +}
>>
>> This leaves rc potentially uninitialised.
>>
>> What should the result be in that case, -EINVAL ?
>
> On another note if there are multiple LMBs to update the value of rc only reflects the final dlpar_memory_readd_helper() call.
Correct. But that is what happens when we compress common code
between two disparate uses i.e. updating memory association after
a migration event with no reporting mechanism other than the console
log, vs re-adding a single LMB by index for the purposes of DLPAR / drmgr.
I could discard the return value from dlpar_memory_readd_helper entirely
in this function and just return 0, but in my experience, once errors start
to occur in memory dlpar ops, they tend to keep on occurring, so I was
returning the last one. We could also make the code smart enough to
capture and return the first/last non-zero return code. I didn't believe
that the frequency of errors for this operation warranted the overhead.
>
> -Tyrel
Michael
--
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:[~2018-10-16 21:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20181015194738.5705.88953.stgit@ltcalpine2-lp9.aus.stglabs.ibm.com>
2018-10-15 19:53 ` [PATCH v06 3/5] migration/memory: Add hotplug READD_MULTIPLE Michael Bringmann
2018-10-16 0:39 ` Michael Ellerman
2018-10-16 14:07 ` Michael Bringmann
2018-10-16 19:57 ` Tyrel Datwyler
2018-10-16 21:31 ` Michael Bringmann [this message]
2018-10-17 0:48 ` Michael Ellerman
2018-10-17 15:12 ` Michael Bringmann
2018-10-17 0:43 ` Michael Ellerman
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=8fa9d2c2-97a9-69ac-1e3b-cdf867e225e2@linux.vnet.ibm.com \
--to=mwb@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=minkim@us.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=nfont@linux.vnet.ibm.com \
--cc=tlfalcon@linux.vnet.ibm.com \
--cc=tyreld@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 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).