linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Bringmann <mwb@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Michael Bringmann <mwb@linux.vnet.ibm.com>,
	Nathan Fontenot <nfont@linux.vnet.ibm.com>,
	John Allen <jallen@linux.vnet.ibm.com>,
	Tyrel Datwyler <tyreld@linux.vnet.ibm.com>,
	Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Subject: [RFC v9 2/4] hotplug/cpu: Add operation queuing function
Date: Sun, 3 Jun 2018 15:04:28 -0500	[thread overview]
Message-ID: <703bd384-b38e-d05a-04ac-aae1d60ae6b8@linux.vnet.ibm.com> (raw)
In-Reply-To: <95c97180-37b7-85da-a82f-17dbc73f5ed6@linux.vnet.ibm.com>

[Testing delayed due to internal SAN problems.]

migration/dlpar: This patch adds function dlpar_queue_action()
which will add information about a CPU/Memory 'readd' operation
according to resource type, action code, and DRC index.  Initial
usage is for the 'readd' CPU and Memory blocks identified as
having changed their associativity during a migration event.

Signed-off-by: Michael Bringmann <mwb@linux.vnet.ibm.com>
---
Changes in RFC:
  -- Correct drc_index for dlpar_queue_action worker invocation
  -- Correct text of notice
  -- Revise queuing model to save up all of the DLPAR actions for
     later execution.
---
 arch/powerpc/platforms/pseries/dlpar.c   |   51 ++++++++++++++++++++++++++++++
 arch/powerpc/platforms/pseries/pseries.h |    2 +
 2 files changed, 53 insertions(+)

diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
index a0b20c0..a1300d2 100644
--- a/arch/powerpc/platforms/pseries/dlpar.c
+++ b/arch/powerpc/platforms/pseries/dlpar.c
@@ -407,6 +407,57 @@ void queue_hotplug_event(struct pseries_hp_errorlog *hp_errlog,
 	}
 }
 
+struct DlparWork {
+	struct list_head list;
+	int resource;
+	int action;
+	u32 drc_index;
+} DlparWorkQ;
+
+int dlpar_delayed_queue_action(int resource, int action, u32 drc_index)
+{
+	struct DlparWork *dwq;
+
+	dwq = kmalloc(sizeof(struct DlparWork), GFP_KERNEL);
+	if (!dwq)
+		return -ENOMEM;
+
+	dwq->resource = resource;
+	dwq->action = action;
+	dwq->drc_index = drc_index;
+
+	list_add_tail(&dwq->list, &DlparWorkQ.list);
+
+	return 0;
+}
+
+int dlpar_schedule_delayed_queue(void)
+{
+	struct DlparWork *iter;
+	struct list_head *pos, *q;
+
+	list_for_each_entry(iter, &DlparWorkQ.list, list) {
+	        struct pseries_hp_errorlog hp_elog;
+
+        	hp_elog.resource = iter->resource;
+        	hp_elog.action = iter->action;
+        	hp_elog.id_type = PSERIES_HP_ELOG_ID_DRC_INDEX;
+        	hp_elog._drc_u.drc_index = cpu_to_be32(iter->drc_index);
+
+		handle_dlpar_errorlog(&hp_elog);
+	}
+
+	list_for_each_safe(pos, q, &DlparWorkQ.list) {
+		struct DlparWork *tmp;
+
+		tmp = list_entry(pos, struct DlparWork, list);
+		list_del(pos);
+		kfree(tmp);
+	}
+
+	return 0;
+}
+
 static int dlpar_parse_resource(char **cmd, struct pseries_hp_errorlog *hp_elog)
 {
 	char *arg;
diff --git a/arch/powerpc/platforms/pseries/pseries.h b/arch/powerpc/platforms/pseries/pseries.h
index 60db2ee..de73fda 100644
--- a/arch/powerpc/platforms/pseries/pseries.h
+++ b/arch/powerpc/platforms/pseries/pseries.h
@@ -61,6 +61,8 @@ extern struct device_node *dlpar_configure_connector(__be32,
 
 void queue_hotplug_event(struct pseries_hp_errorlog *hp_errlog,
 			 struct completion *hotplug_done, int *rc);
+int dlpar_delayed_queue_action(int resource, int action, u32 drc_index);
+int dlpar_schedule_delayed_queue(void);
 #ifdef CONFIG_MEMORY_HOTPLUG
 int dlpar_memory(struct pseries_hp_errorlog *hp_elog);
 #else

  parent reply	other threads:[~2018-06-03 20:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-03 20:03 [RFC v9 0/4] powerpc/hotplug: Update affinity for migrated CPUs Michael Bringmann
2018-06-03 20:04 ` [RFC v9 1/4] hotplug/cpu: Conditionally acquire/release DRC index Michael Bringmann
2018-06-03 20:04 ` Michael Bringmann [this message]
2018-06-03 20:04 ` [RFC v9 3/4] hotplug/dlpar/cpu: Provide CPU readd operation Michael Bringmann
2018-06-03 20:04 ` [RFC v9 4/4] mobility/numa: Ensure numa update does not overlap 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=703bd384-b38e-d05a-04ac-aae1d60ae6b8@linux.vnet.ibm.com \
    --to=mwb@linux.vnet.ibm.com \
    --cc=jallen@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --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).