From: Vlastimil Babka <vbabka@suse.cz>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, Joonsoo Kim <iamjoonsoo.kim@lge.com>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Michal Hocko <mhocko@kernel.org>,
Matthew Wilcox <willy@infradead.org>,
Mel Gorman <mgorman@techsingularity.net>,
Peter Zijlstra <peterz@infradead.org>,
Borislav Petkov <bp@alien8.de>,
Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: [PATCH] mm, debug_pagealloc: don't rely on static keys too early
Date: Mon, 6 Jan 2020 09:37:03 +0100 [thread overview]
Message-ID: <10f6eff4-ab0b-7ad1-1d05-5dcc71bbd0fc@suse.cz> (raw)
In-Reply-To: <20200102190257.bef74c21f31373612160b78f@linux-foundation.org>
On 1/3/20 4:02 AM, Andrew Morton wrote:
> On Thu, 19 Dec 2019 14:06:12 +0100 Vlastimil Babka <vbabka@suse.cz> 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
Hm that's not the _early version. Missing export indeed, can you amend
with Stephen's patch? Thanks!
https://lore.kernel.org/linux-next/20200106164944.063ac07b@canb.auug.org.au/
>
> Odd. Does this happen to you as well?
>
prev parent reply other threads:[~2020-01-06 8:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-19 13:06 [PATCH] mm, debug_pagealloc: don't rely on static keys too early Vlastimil Babka
2019-12-19 13:16 ` Qian Cai
2019-12-19 13:34 ` Vlastimil Babka
2020-01-03 3:02 ` Andrew Morton
2020-01-06 8:37 ` Vlastimil Babka [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=10f6eff4-ab0b-7ad1-1d05-5dcc71bbd0fc@suse.cz \
--to=vbabka@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=iamjoonsoo.kim@lge.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@kernel.org \
--cc=peterz@infradead.org \
--cc=sfr@canb.auug.org.au \
--cc=stable@vger.kernel.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).