]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
2fc5d1de34d70d023909060f8afd4a30f02623cc
[thirdparty/kernel/stable-queue.git] /
1 From afb5519fdb346201728040cab4e08ce53e7ff4fd Mon Sep 17 00:00:00 2001
2 From: John Allen <jallen@linux.vnet.ibm.com>
3 Date: Wed, 23 Aug 2017 12:18:43 -0500
4 Subject: powerpc/pseries: Don't attempt to acquire drc during memory hot add for assigned lmbs
5
6 From: John Allen <jallen@linux.vnet.ibm.com>
7
8 commit afb5519fdb346201728040cab4e08ce53e7ff4fd upstream.
9
10 Check if an LMB is assigned before attempting to call dlpar_acquire_drc
11 in order to avoid any unnecessary rtas calls. This substantially
12 reduces the running time of memory hot add on lpars with large amounts
13 of memory.
14
15 [mpe: We need to explicitly set rc to 0 in the success case, otherwise
16 the compiler might think we use rc without initialising it.]
17
18 Fixes: c21f515c7436 ("powerpc/pseries: Make the acquire/release of the drc for memory a seperate step")
19 Signed-off-by: John Allen <jallen@linux.vnet.ibm.com>
20 Reviewed-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
21 Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
22 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23
24 ---
25 arch/powerpc/platforms/pseries/hotplug-memory.c | 4 ++++
26 1 file changed, 4 insertions(+)
27
28 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c
29 +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
30 @@ -817,6 +817,9 @@ static int dlpar_memory_add_by_count(u32
31 return -EINVAL;
32
33 for (i = 0; i < num_lmbs && lmbs_to_add != lmbs_added; i++) {
34 + if (lmbs[i].flags & DRCONF_MEM_ASSIGNED)
35 + continue;
36 +
37 rc = dlpar_acquire_drc(lmbs[i].drc_index);
38 if (rc)
39 continue;
40 @@ -859,6 +862,7 @@ static int dlpar_memory_add_by_count(u32
41 lmbs[i].base_addr, lmbs[i].drc_index);
42 lmbs[i].reserved = 0;
43 }
44 + rc = 0;
45 }
46
47 return rc;