From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752144AbdLCGeA (ORCPT ); Sun, 3 Dec 2017 01:34:00 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:42820 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751790AbdLCGd6 (ORCPT ); Sun, 3 Dec 2017 01:33:58 -0500 Date: Sat, 2 Dec 2017 22:33:55 -0800 From: "Paul E. McKenney" To: Lai Jiangshan Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Sebastian Andrzej Siewior , Boris Ostrovsky Subject: Re: [PATCH] cpu/hotplug: merge cpuhp_bp_states&cpuhp_ap_states as cpuhp_hp_states Reply-To: paulmck@linux.vnet.ibm.com References: <20171201135008.21633-1-jiangshanlai@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171201135008.21633-1-jiangshanlai@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 17120306-0044-0000-0000-000003B8C8D6 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008146; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000243; SDB=6.00954686; UDB=6.00482434; IPR=6.00734722; BA=6.00005727; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00018316; XFM=3.00000015; UTC=2017-12-03 06:33:57 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17120306-0045-0000-0000-000007E7FB74 Message-Id: <20171203063355.GO7829@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-12-03_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1712030100 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 01, 2017 at 09:50:05PM +0800, Lai Jiangshan wrote: > cpuhp_bp_states&cpuhp_ap_states have diffent set of steps > without any conflicting configed steps, so that they can > be merged. > > The original `[CPUHP_BRINGUP_CPU] = { },` is removed, because > the new cpuhp_hp_states has CPUHP_ONLINE index which is larger > than CPUHP_BRINGUP_CPU. > > Signed-off-by: Lai Jiangshan Hello, Lai, What is this against? I tried testing it, but it doesn't apply to v4.15-rc1 or v4.14. Thanx, Paul > --- > kernel/cpu.c | 42 +++++++++++++++--------------------------- > 1 file changed, 15 insertions(+), 27 deletions(-) > > diff --git a/kernel/cpu.c b/kernel/cpu.c > index 7891aecc6aec..c27963066333 100644 > --- a/kernel/cpu.c > +++ b/kernel/cpu.c > @@ -124,8 +124,7 @@ struct cpuhp_step { > }; > > static DEFINE_MUTEX(cpuhp_state_mutex); > -static struct cpuhp_step cpuhp_bp_states[]; > -static struct cpuhp_step cpuhp_ap_states[]; > +static struct cpuhp_step cpuhp_hp_states[]; > > static bool cpuhp_is_ap_state(enum cpuhp_state state) > { > @@ -138,10 +137,7 @@ static bool cpuhp_is_ap_state(enum cpuhp_state state) > > static struct cpuhp_step *cpuhp_get_step(enum cpuhp_state state) > { > - struct cpuhp_step *sp; > - > - sp = cpuhp_is_ap_state(state) ? cpuhp_ap_states : cpuhp_bp_states; > - return sp + state; > + return cpuhp_hp_states + state; > } > > /** > @@ -1224,7 +1220,7 @@ int __boot_cpu_id; > #endif /* CONFIG_SMP */ > > /* Boot processor state steps */ > -static struct cpuhp_step cpuhp_bp_states[] = { > +static struct cpuhp_step cpuhp_hp_states[] = { > [CPUHP_OFFLINE] = { > .name = "offline", > .startup.single = NULL, > @@ -1289,24 +1285,6 @@ static struct cpuhp_step cpuhp_bp_states[] = { > .teardown.single = NULL, > .cant_stop = true, > }, > - /* > - * Handled on controll processor until the plugged processor manages > - * this itself. > - */ > - [CPUHP_TEARDOWN_CPU] = { > - .name = "cpu:teardown", > - .startup.single = NULL, > - .teardown.single = takedown_cpu, > - .cant_stop = true, > - }, > -#else > - [CPUHP_BRINGUP_CPU] = { }, > -#endif > -}; > - > -/* Application processor state steps */ > -static struct cpuhp_step cpuhp_ap_states[] = { > -#ifdef CONFIG_SMP > /* Final state before CPU kills itself */ > [CPUHP_AP_IDLE_DEAD] = { > .name = "idle:dead", > @@ -1340,6 +1318,16 @@ static struct cpuhp_step cpuhp_ap_states[] = { > [CPUHP_AP_ONLINE] = { > .name = "ap:online", > }, > + /* > + * Handled on controll processor until the plugged processor manages > + * this itself. > + */ > + [CPUHP_TEARDOWN_CPU] = { > + .name = "cpu:teardown", > + .startup.single = NULL, > + .teardown.single = takedown_cpu, > + .cant_stop = true, > + }, > /* Handle smpboot threads park/unpark */ > [CPUHP_AP_SMPBOOT_THREADS] = { > .name = "smpboot/threads:online", > @@ -1408,11 +1396,11 @@ static int cpuhp_reserve_state(enum cpuhp_state state) > > switch (state) { > case CPUHP_AP_ONLINE_DYN: > - step = cpuhp_ap_states + CPUHP_AP_ONLINE_DYN; > + step = cpuhp_hp_states + CPUHP_AP_ONLINE_DYN; > end = CPUHP_AP_ONLINE_DYN_END; > break; > case CPUHP_BP_PREPARE_DYN: > - step = cpuhp_bp_states + CPUHP_BP_PREPARE_DYN; > + step = cpuhp_hp_states + CPUHP_BP_PREPARE_DYN; > end = CPUHP_BP_PREPARE_DYN_END; > break; > default: > -- > 2.13.6 (Apple Git-96) >