Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1738384

[PATCH 4.13 042/109] powerpc/pseries: Dont attempt to acquire drc during memory hot add for assigned lmbs

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.13 042/109] powerpc/pseries: Dont attempt to acquire drc during memory hot add for assigned lmbs
Date 2017-09-24 22:50 +0200
Message-ID <utm0G-4Xd-39@gated-at.bofh.it> (permalink)
References <utm0F-4Xd-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


4.13-stable review patch.  If anyone has any objections, please let me know.

------------------

From: John Allen <jallen@linux.vnet.ibm.com>

commit afb5519fdb346201728040cab4e08ce53e7ff4fd upstream.

Check if an LMB is assigned before attempting to call dlpar_acquire_drc
in order to avoid any unnecessary rtas calls. This substantially
reduces the running time of memory hot add on lpars with large amounts
of memory.

[mpe: We need to explicitly set rc to 0 in the success case, otherwise
 the compiler might think we use rc without initialising it.]

Fixes: c21f515c7436 ("powerpc/pseries: Make the acquire/release of the drc for memory a seperate step")
Signed-off-by: John Allen <jallen@linux.vnet.ibm.com>
Reviewed-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/powerpc/platforms/pseries/hotplug-memory.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -817,6 +817,9 @@ static int dlpar_memory_add_by_count(u32
 		return -EINVAL;
 
 	for (i = 0; i < num_lmbs && lmbs_to_add != lmbs_added; i++) {
+		if (lmbs[i].flags & DRCONF_MEM_ASSIGNED)
+			continue;
+
 		rc = dlpar_acquire_drc(lmbs[i].drc_index);
 		if (rc)
 			continue;
@@ -859,6 +862,7 @@ static int dlpar_memory_add_by_count(u32
 				lmbs[i].base_addr, lmbs[i].drc_index);
 			lmbs[i].reserved = 0;
 		}
+		rc = 0;
 	}
 
 	return rc;

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 4.13 042/109] powerpc/pseries: Dont attempt to acquire drc during memory hot add for assigned lmbs Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:50 +0200

csiph-web