From: Nathan Fontenot <nfont@linux.vnet.ibm.com>
To: Michael Bringmann <mwb@linux.vnet.ibm.com>,
linuxppc-dev@lists.ozlabs.org
Cc: Juliet Kim <minkim@us.ibm.com>,
Thomas Falcon <tlfalcon@linux.vnet.ibm.com>,
Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Subject: Re: [PATCH v04 3/5] migration/memory: Add hotplug READD_MULTIPLE
Date: Wed, 10 Oct 2018 11:59:56 -0500 [thread overview]
Message-ID: <d80fc03f-60a8-efc2-2f51-698fe92af1f3@linux.vnet.ibm.com> (raw)
In-Reply-To: <20181009203635.26091.67563.stgit@ltcalpine2-lp9.aus.stglabs.ibm.com>
On 10/09/2018 03:36 PM, Michael Bringmann wrote:
> migration/memory: This patch adds a new pseries hotplug action
> for CPU and memory operations, PSERIES_HP_ELOG_ACTION_READD_MULTIPLE.
> This is a variant of the READD operation which performs the action
> upon multiple instances of the resource at one time. The operation
> is to be triggered by device-tree analysis of updates by RTAS events
> analyzed by 'migation_store' during post-migration processing. It
> will be used for memory updates, initially.
>
> Signed-off-by: Michael Bringmann <mwb@linux.vnet.ibm.com>
> ---
> Changes in v04:
> -- Move init of 'lmb->internal_flags' in init_drmem_v2_lmbs to
> previous patch.
> -- Pull in implementation of dlpar_memory_readd_multiple() to go
> with operation flag.
> ---
> arch/powerpc/include/asm/rtas.h | 1 +
> arch/powerpc/platforms/pseries/hotplug-memory.c | 31 +++++++++++++++++++++++
> 2 files changed, 32 insertions(+)
>
> diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
> index 0183e95..cc00451 100644
> --- a/arch/powerpc/include/asm/rtas.h
> +++ b/arch/powerpc/include/asm/rtas.h
> @@ -333,6 +333,7 @@ struct pseries_hp_errorlog {
> #define PSERIES_HP_ELOG_ACTION_ADD 1
> #define PSERIES_HP_ELOG_ACTION_REMOVE 2
> #define PSERIES_HP_ELOG_ACTION_READD 3
> +#define PSERIES_HP_ELOG_ACTION_READD_MULTIPLE 4
>
> #define PSERIES_HP_ELOG_ID_DRC_NAME 1
> #define PSERIES_HP_ELOG_ID_DRC_INDEX 2
> diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
> index 9a15d39..bf2420a 100644
> --- a/arch/powerpc/platforms/pseries/hotplug-memory.c
> +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
> @@ -546,6 +546,30 @@ 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_remove_lmb(lmb);
> +
> + if (!rc) {
> + rc = dlpar_add_lmb(lmb);
> + if (rc)
> + dlpar_release_drc(lmb->drc_index);
> + }
The work you're doing here is essentially the same that is done in
dlpar_memory_readd_by_index(). Perhaps pulling the commin bits of both
routines into a helper routine. This could include the success/failure
messages in dlpar_memory_readd_by_index()
-Nathan
> +
> + drmem_remove_lmb_update(lmb);
> + }
> + }
> +
> + return rc;
> +}
> +
> static int dlpar_memory_remove_by_ic(u32 lmbs_to_remove, u32 drc_index)
> {
> struct drmem_lmb *lmb, *start_lmb, *end_lmb;
> @@ -646,6 +670,10 @@ static int dlpar_memory_readd_by_index(u32 drc_index)
> {
> return -EOPNOTSUPP;
> }
> +static int dlpar_memory_readd_multiple(void)
> +{
> + return -EOPNOTSUPP;
> +}
>
> static int dlpar_memory_remove_by_ic(u32 lmbs_to_remove, u32 drc_index)
> {
> @@ -923,6 +951,9 @@ int dlpar_memory(struct pseries_hp_errorlog *hp_elog)
> drc_index = hp_elog->_drc_u.drc_index;
> rc = dlpar_memory_readd_by_index(drc_index);
> break;
> + case PSERIES_HP_ELOG_ACTION_READD_MULTIPLE:
> + rc = dlpar_memory_readd_multiple();
> + break;
> default:
> pr_err("Invalid action (%d) specified\n", hp_elog->action);
> rc = -EINVAL;
>
next prev parent reply other threads:[~2018-10-10 17:02 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-09 20:35 [PATCH v04 0/5] powerpc/migration: Affinity fix for memory Michael Bringmann
2018-10-09 20:36 ` [PATCH v04 1/5] powerpc/drmem: Export 'dynamic-memory' loader Michael Bringmann
2018-10-10 16:54 ` Nathan Fontenot
2018-10-10 17:34 ` Michael Bringmann
2018-10-12 1:11 ` Michael Bringmann
2018-10-09 20:36 ` [PATCH v04 2/5] powerpc/drmem: Add internal_flags feature Michael Bringmann
2018-10-09 20:36 ` [PATCH v04 3/5] migration/memory: Add hotplug READD_MULTIPLE Michael Bringmann
2018-10-10 16:59 ` Nathan Fontenot [this message]
2018-10-10 17:58 ` Michael Bringmann
2018-10-09 20:37 ` [PATCH v04 3/4] migration/memory: Evaluate LMB assoc changes Michael Bringmann
2018-10-10 17:24 ` Nathan Fontenot
2018-10-10 18:29 ` Michael Bringmann
2018-10-09 20:37 ` [PATCH v04 4/4] migration/memory: Support 'ibm,dynamic-memory-v2' 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=d80fc03f-60a8-efc2-2f51-698fe92af1f3@linux.vnet.ibm.com \
--to=nfont@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=minkim@us.ibm.com \
--cc=mwb@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).