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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B6C9ECAAD4 for ; Fri, 26 Aug 2022 10:49:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CB86C6B0074; Fri, 26 Aug 2022 06:49:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C672D6B0075; Fri, 26 Aug 2022 06:49:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B2E9C940007; Fri, 26 Aug 2022 06:49:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id A4EC26B0074 for ; Fri, 26 Aug 2022 06:49:28 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 781F580645 for ; Fri, 26 Aug 2022 10:49:28 +0000 (UTC) X-FDA: 79841422416.13.0C21EF3 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf02.hostedemail.com (Postfix) with ESMTP id 1787D8002A for ; Fri, 26 Aug 2022 10:49:27 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id A934E1FD70; Fri, 26 Aug 2022 10:49:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1661510966; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aGXZZ/m7SoogwzlUL+uXlfvJVcmYUkZYvpET1c52fwk=; b=dwm/N0A79JigO03wc29QRnnKo/WSIUXnaFMh6W8OD0ASGhDUPMeoZm0sIQadsjrGn3oWej uLTlUgzhboyA04fizKUvw8nlWqy3s+5GGpUt91emgsuaijIPTULCxxPCt+dveAH3IhxW/e nOgcIsBd7tMg4ADA3T+ry1w2Vfv4tiM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1661510966; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aGXZZ/m7SoogwzlUL+uXlfvJVcmYUkZYvpET1c52fwk=; b=rXAPNaQ6Yv6S62E1pJTbEPNgFg2K/pvVmit+ULFartQQMhb/dIC9+yCYQn3iGRjqf+V3Pn OsdTzXoZFi/YsCBA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 744BC13A7E; Fri, 26 Aug 2022 10:49:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id IFJ0GzalCGP9ZAAAMHmgww (envelope-from ); Fri, 26 Aug 2022 10:49:26 +0000 Message-ID: <68133fc4-7034-c07b-f14b-5b4e73e04d2c@suse.cz> Date: Fri, 26 Aug 2022 12:49:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.1.2 Subject: Re: [PATCH v4] page_ext: introduce boot parameter 'early_page_ext' Content-Language: en-US To: Andrew Morton , lizhe.67@bytedance.com Cc: mhocko@suse.com, mhiramat@kernel.org, keescook@chromium.org, Jason@zx2c4.com, mark-pk.tsai@mediatek.com, rostedt@goodmis.org, corbet@lwn.net, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, lizefan.x@bytedance.com References: <20220825102714.669-1-lizhe.67@bytedance.com> <20220825212338.e541d29ca3c4d602221f4925@linux-foundation.org> From: Vlastimil Babka In-Reply-To: <20220825212338.e541d29ca3c4d602221f4925@linux-foundation.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661510968; a=rsa-sha256; cv=none; b=dL+AZ/dgLK+um1w77JqxIEu+cEv905E52uMIbSnprHlqVQ/HUpMBLd1PkC52RBR7MBH4RL sDTx5f4FTRVExF3Ut0iMuMaXbrZY+L4Xv26DtE9CQcqT+X8G3Zcn8Pyo6Y92o/Vbf9ehcX h7AoR3ezaFI6iRJCkVunWkdOms/5yP0= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="dwm/N0A7"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=rXAPNaQ6; dmarc=none; spf=pass (imf02.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661510968; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=aGXZZ/m7SoogwzlUL+uXlfvJVcmYUkZYvpET1c52fwk=; b=dIUV4FfE9RP5pwC1L/sgjMVU5/RC99AgVCenQ9YfdjKk5IWqg3bGzvo51uePhrmBFC9p8K yaqgZ3w1Q2GOhGliAL2MUwWpPNYVImwApxCPYQKsQJ+ECNEeUoZPbNfPL5rb3D7kQwxd5Y 3RMPIN1u9s0LAKGC8TNRoFHkaCWh0pw= Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="dwm/N0A7"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=rXAPNaQ6; dmarc=none; spf=pass (imf02.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Rspam-User: X-Rspamd-Queue-Id: 1787D8002A X-Rspamd-Server: rspam08 X-Stat-Signature: k67bf6qztbcawu4bysp8gnxp3izm968n X-HE-Tag: 1661510967-740190 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 8/26/22 06:23, Andrew Morton wrote: > On Thu, 25 Aug 2022 18:27:14 +0800 lizhe.67@bytedance.com wrote: > >> From: Li Zhe >> >> In 'commit 2f1ee0913ce5 ("Revert "mm: use early_pfn_to_nid in page_ext_init"")', >> we call page_ext_init() after page_alloc_init_late() to avoid some panic >> problem. It seems that we cannot track early page allocations in current >> kernel even if page structure has been initialized early. >> >> This patch introduce a new boot parameter 'early_page_ext' to resolve this >> problem. If we pass it to kernel, function page_ext_init() will be moved >> up and feature 'deferred initialization of struct pages' will be disabled >> to initialize the page allocator early and prevent from the panic problem >> above. It can help us to catch early page allocations. This is useful >> especially when we find that the free memory value is not the same right >> after different kernel booting. >> > > WARNING: modpost: vmlinux.o: section mismatch in reference: early_page_ext_enabled (section: .text.unlikely) -> early_page_ext (section: .meminit.data) > WARNING: modpost: vmlinux.o: section mismatch in reference: early_page_ext_enabled (section: .text.unlikely) -> early_page_ext (section: .meminit.data) Hm it's a very small static inline, shouldn't exist separately anywhere. Maybe it's due to that new debug info level thing? Would this work instead? ----8<---- diff --git a/include/linux/page_ext.h b/include/linux/page_ext.h index 884282a7f03a..4bf4e58cf2d4 100644 --- a/include/linux/page_ext.h +++ b/include/linux/page_ext.h @@ -40,7 +40,7 @@ extern bool early_page_ext; extern unsigned long page_ext_size; extern void pgdat_page_ext_init(struct pglist_data *pgdat); -static inline bool early_page_ext_enabled(void) +static inline bool __meminit early_page_ext_enabled(void) { return early_page_ext; }