From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 448FCC32771 for ; Fri, 3 Jan 2020 03:03:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0843A222C3 for ; Fri, 3 Jan 2020 03:03:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="QzNogATh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0843A222C3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 789BE8E000B; Thu, 2 Jan 2020 22:03:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 76DF58E0003; Thu, 2 Jan 2020 22:03:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 64F4F8E000B; Thu, 2 Jan 2020 22:03:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0150.hostedemail.com [216.40.44.150]) by kanga.kvack.org (Postfix) with ESMTP id 4E1EF8E0003 for ; Thu, 2 Jan 2020 22:03:00 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id F2CBB40FE for ; Fri, 3 Jan 2020 03:02:59 +0000 (UTC) X-FDA: 76334826120.08.owl91_5458bce82c632 X-HE-Tag: owl91_5458bce82c632 X-Filterd-Recvd-Size: 3549 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Fri, 3 Jan 2020 03:02:59 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6358621582; Fri, 3 Jan 2020 03:02:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578020578; bh=vt52eM4buQ1/nXw6xZpK+qP9tLkU2kjauxegIfxwUAU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=QzNogAThJ0ghybp7xHd/VqAJWY9/rD85imeifM1yf/Sq0ibB2HUBHpUeRIO6UG2s5 J4dVyiglCc3gJpzLidkKvA494Lz1rJSu1YkDn9MgmcqdX9BkM0bXguhJx3VLthsiYL tWj0rnl2jfRi7uoXJkRQfl0g/cGD9Syl89YYI0PQ= Date: Thu, 2 Jan 2020 19:02:57 -0800 From: Andrew Morton To: Vlastimil Babka Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Joonsoo Kim , "Kirill A. Shutemov" , Michal Hocko , Matthew Wilcox , Mel Gorman , Peter Zijlstra , Borislav Petkov Subject: Re: [PATCH] mm, debug_pagealloc: don't rely on static keys too early Message-Id: <20200102190257.bef74c21f31373612160b78f@linux-foundation.org> In-Reply-To: <20191219130612.23171-1-vbabka@suse.cz> References: <20191219130612.23171-1-vbabka@suse.cz> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, 19 Dec 2019 14:06:12 +0100 Vlastimil Babka wrote: > Commit 96a2b03f281d ("mm, debug_pagelloc: use static keys to enable debugging") > has introduced a static key to reduce overhead when debug_pagealloc is compiled > in but not enabled. It relied on the assumption that jump_label_init() is > called before parse_early_param() as in start_kernel(), so when the > "debug_pagealloc=on" option is parsed, it is safe to enable the static key. > > However, it turns out multiple architectures call parse_early_param() earlier > from their setup_arch(). x86 also calls jump_label_init() even earlier, so no > issue was found while testing the commit, but same is not true for e.g. ppc64 > and s390 where the kernel would not boot with debug_pagealloc=on as found by > our QA. > > To fix this without tricky changes to init code of multiple architectures, this > patch partially reverts the static key conversion from 96a2b03f281d. Init-time > and non-fastpath calls (such as in arch code) of debug_pagealloc_enabled() will > again test a simple bool variable. Fastpath mm code is converted to a new > debug_pagealloc_enabled_static() variant that relies on the static key, which > is enabled in a well-defined point in mm_init() where it's guaranteed that > jump_label_init() has been called, regardless of architecture. I'm seeing this with x86_64 allmodconfig: ERROR: "_debug_pagealloc_enabled_early" [sound/drivers/pcsp/snd-pcsp.ko] undefined! Not sure why. It's there: q:/usr/src/25> nm mm/page_alloc.o|grep _debug_pagealloc_enabled ... 00000000000028a0 B _debug_pagealloc_enabled ... and exported: 0000000000000072 r __kstrtab__debug_pagealloc_enabled Odd. Does this happen to you as well?