From: Michael Bringmann <mwb@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org, mwb@linux.vnet.ibm.com
Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>,
Juliet Kim <minkim@us.ibm.com>,
Thomas Falcon <tlfalcon@linux.vnet.ibm.com>,
Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Subject: [PATCH] hotplug/cpu: Extend start/stop cpumap lock scope
Date: Sat, 13 Oct 2018 17:04:51 -0500 [thread overview]
Message-ID: <20181013220403.6835.72398.stgit@ltcalpine2-lp9.aus.stglabs.ibm.com> (raw)
The PPC mobility code may receive DLPAR CPU add/remove requests
to perform CPU changes at any time, including during LPAR migration
or RTAS requests or SMT changes. When the operations are received
concurrently, there is an opportunity for DLPAR CPU remove requests
and other requests to overlap, and for one of the requests to be
interrupted after some shared state has been modified. This patch
changes the duration for which cpu maps updates are suppressed
during DLPAR CPU operations made by 'drmgr' are suppressed to
reduce the period in which changes to shared state may occur.
Signed-off-by: Michael Bringmann <mwb@linux.vnet.ibm.com>
---
arch/powerpc/platforms/pseries/hotplug-cpu.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index 2f8e621..fce46c56 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -356,7 +356,6 @@ static int dlpar_online_cpu(struct device_node *dn)
nthreads = len / sizeof(u32);
- cpu_maps_update_begin();
for (i = 0; i < nthreads; i++) {
thread = be32_to_cpu(intserv[i]);
for_each_present_cpu(cpu) {
@@ -378,7 +377,6 @@ static int dlpar_online_cpu(struct device_node *dn)
printk(KERN_WARNING "Could not find cpu to online "
"with physical id 0x%x\n", thread);
}
- cpu_maps_update_done();
out:
return rc;
@@ -523,7 +521,6 @@ static int dlpar_offline_cpu(struct device_node *dn)
nthreads = len / sizeof(u32);
- cpu_maps_update_begin();
for (i = 0; i < nthreads; i++) {
thread = be32_to_cpu(intserv[i]);
for_each_present_cpu(cpu) {
@@ -559,7 +556,6 @@ static int dlpar_offline_cpu(struct device_node *dn)
if (cpu == num_possible_cpus())
printk(KERN_WARNING "Could not find cpu to offline with physical id 0x%x\n", thread);
}
- cpu_maps_update_done();
out:
return rc;
@@ -811,6 +807,7 @@ int dlpar_cpu(struct pseries_hp_errorlog *hp_elog)
drc_index = hp_elog->_drc_u.drc_index;
lock_device_hotplug();
+ cpu_maps_update_begin();
switch (hp_elog->action) {
case PSERIES_HP_ELOG_ACTION_REMOVE:
@@ -835,6 +832,7 @@ int dlpar_cpu(struct pseries_hp_errorlog *hp_elog)
break;
}
+ cpu_maps_update_done();
unlock_device_hotplug();
return rc;
}
@@ -850,7 +848,9 @@ static ssize_t dlpar_cpu_probe(const char *buf, size_t count)
if (rc)
return -EINVAL;
+ cpu_maps_update_begin();
rc = dlpar_cpu_add(drc_index);
+ cpu_maps_update_done();
return rc ? rc : count;
}
@@ -871,7 +871,9 @@ static ssize_t dlpar_cpu_release(const char *buf, size_t count)
return -EINVAL;
}
+ cpu_maps_update_begin();
rc = dlpar_cpu_remove(dn, drc_index);
+ cpu_maps_update_done();
of_node_put(dn);
return rc ? rc : count;
reply other threads:[~2018-10-13 22:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20181013220403.6835.72398.stgit@ltcalpine2-lp9.aus.stglabs.ibm.com \
--to=mwb@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=minkim@us.ibm.com \
--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