From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751127AbdAQNHm (ORCPT ); Tue, 17 Jan 2017 08:07:42 -0500 Received: from mx2.suse.de ([195.135.220.15]:59090 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750929AbdAQNHl (ORCPT ); Tue, 17 Jan 2017 08:07:41 -0500 Subject: Re: [PATCH -next] init/main: Init jump_labels before they are used to build zonelists To: Stafford Horne , linux-kernel@vger.kernel.org References: <20170117125624.8535-1-shorne@gmail.com> Cc: Andrew Morton , Thomas Gleixner , Kees Cook , Jessica Yu , Petr Mladek , Rasmus Villemoes , Yang Shi , Tejun Heo , Prarit Bhargava , Yaowei Bai , Andrey Ryabinin , Peter Zijlstra From: Vlastimil Babka Message-ID: Date: Tue, 17 Jan 2017 14:07:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <20170117125624.8535-1-shorne@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [+CC PeterZ] On 01/17/2017 01:56 PM, Stafford Horne wrote: > A recent change in -next introduced static_keys in init zonelists, > details are: > > Author: Vlastimil Babka > Date: Thu Jan 12 12:19:03 2017 +1100 > commit f5adbdff6a1c40e19 ("mm, page_alloc: convert > page_group_by_mobility_disable to static key") > > This causes the following warning in openrisc as reported by Guenter, > and repoduced by me. > > WARNING: CPU: 0 PID: 0 at ./include/linux/jump_label.h:198 0xc02d758c > static_key_slow_inc used before call to jump_label_init > > This fixes this by initialized jump_labels even earlier, I am suprized the > issue is not showing up in other platforms yet. AFAICS it depends on how much memory is available at that point. But maybe I just missed the warning somehow. Anyway I'm not sure if this patch is safe. Hopefully Peter can judge this better... > Cc: Vlastimil Babka > Signed-off-by: Stafford Horne > --- > init/main.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/init/main.c b/init/main.c > index 8b1adb6e..d1ca7cb 100644 > --- a/init/main.c > +++ b/init/main.c > @@ -513,6 +513,7 @@ asmlinkage __visible void __init start_kernel(void) > boot_cpu_state_init(); > smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */ > > + jump_label_init(); > build_all_zonelists(NULL, NULL); > page_alloc_init(); > > @@ -526,8 +527,6 @@ asmlinkage __visible void __init start_kernel(void) > parse_args("Setting init args", after_dashes, NULL, 0, -1, -1, > NULL, set_init_arg); > > - jump_label_init(); > - > /* > * These use large bootmem allocations and must precede > * kmem_cache_init() >