From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751376AbdKMWZj (ORCPT ); Mon, 13 Nov 2017 17:25:39 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:59846 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751370AbdKMWZf (ORCPT ); Mon, 13 Nov 2017 17:25:35 -0500 Date: Mon, 13 Nov 2017 14:15:26 -0800 From: "Paul E. McKenney" To: Jason Baron Cc: rostedt@goodmis.org, peterz@infradead.org, linux-kernel@vger.kernel.org, Ingo Molnar Subject: Re: [PATCH] jump_label: invoke jump_label_test() via early_initcall() Reply-To: paulmck@linux.vnet.ibm.com References: <1510609727-2238-1-git-send-email-jbaron@akamai.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1510609727-2238-1-git-send-email-jbaron@akamai.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 17111322-0024-0000-0000-000002F219D1 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008064; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000240; SDB=6.00945442; UDB=6.00477141; IPR=6.00725739; BA=6.00005689; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017998; XFM=3.00000015; UTC=2017-11-13 22:15:27 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17111322-0025-0000-0000-000046059FD5 Message-Id: <20171113221526.GL3624@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-13_13:,, 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-1707230000 definitions=main-1711130311 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 13, 2017 at 04:48:47PM -0500, Jason Baron wrote: > Fengguang Wu reported that running the rcuperf test during boot can cause > the jump_label_test() to hit a WARN_ON(). The issue is that the core jump > label code relies on kernel_text_address() to detect when it can no longer > update branches that may be contained in __init sections. The > kernel_text_address() in turn assumes that if the system_state variable is > greter than or equal to SYSTEM_RUNNING then __init sections are no longer > valid (since the assumption is that they have been freed). However, when > rcuperf is setup to run in early boot it can call kernel_power_off() which > sets the system_state to SYSTEM_POWER_OFF. > > Since rcuperf initialization is invoked via a module_init(), we can make > the dependency of jump_label_test() needing to complete before rcuperf > explicit by calling it via early_initcall(). > > Reported-by: Fengguang Wu > Cc: "Paul E. McKenney" > Cc: Peter Zijlstra > Cc: Steven Rostedt > Cc: Ingo Molnar > Signed-off-by: Jason Baron Looks way simpler than handling this three times in rcuperf, rcutorture, and locktorture! Acked-by: Paul E. McKenney > --- > kernel/jump_label.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/jump_label.c b/kernel/jump_label.c > index 0bf2e8f5..7c3774a 100644 > --- a/kernel/jump_label.c > +++ b/kernel/jump_label.c > @@ -769,7 +769,7 @@ static __init int jump_label_test(void) > > return 0; > } > -late_initcall(jump_label_test); > +early_initcall(jump_label_test); > #endif /* STATIC_KEYS_SELFTEST */ > > #endif /* HAVE_JUMP_LABEL */ > -- > 2.6.1 >