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 DE3B5C04AA5 for ; Thu, 25 Aug 2022 06:27:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 49866940008; Thu, 25 Aug 2022 02:27:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 447446B007D; Thu, 25 Aug 2022 02:27:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 336BD940008; Thu, 25 Aug 2022 02:27:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 24BF76B007B for ; Thu, 25 Aug 2022 02:27:55 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id F22F1C0C36 for ; Thu, 25 Aug 2022 06:27:54 +0000 (UTC) X-FDA: 79837134468.26.61B717F Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf31.hostedemail.com (Postfix) with ESMTP id 7D5BF20007 for ; Thu, 25 Aug 2022 06:27:54 +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 F1F205C825; Thu, 25 Aug 2022 06:27:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1661408873; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0spxPtpuY4nMM9lIZ8wJ8lR+BxR1fXRkfAOF1d5glCI=; b=eq/4tfrvxgvx73IX4ZqhksV9e/s3wS8AVykgXRb7pBPsKA4slFdbEyupVAc1d9czG9R3ZE BCB3DiYpY7h9NYjSnG8XdYVLhzSjt4V01q5kNiiFB0qUvA0Zk3Y30HvAyWW7Am7WEC4Nbi dxP6HrKPqeuZvUS6KKdQ0KCOaapCA0g= 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 CB50813A89; Thu, 25 Aug 2022 06:27:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 3hX5LmgWB2N/NwAAMHmgww (envelope-from ); Thu, 25 Aug 2022 06:27:52 +0000 Date: Thu, 25 Aug 2022 08:27:52 +0200 From: Michal Hocko To: lizhe.67@bytedance.com Cc: Jason@zx2c4.com, akpm@linux-foundation.org, corbet@lwn.net, keescook@chromium.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, lizefan.x@bytedance.com, mark-pk.tsai@mediatek.com, mhiramat@kernel.org, rostedt@goodmis.org, vbabka@suse.cz, yuanzhu@bytedance.com Subject: Re: [PATCH v2] page_ext: introduce boot parameter 'early_page_ext' Message-ID: References: <20220825062129.92091-1-lizhe.67@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220825062129.92091-1-lizhe.67@bytedance.com> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661408874; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=0spxPtpuY4nMM9lIZ8wJ8lR+BxR1fXRkfAOF1d5glCI=; b=L//HbgaH+ceC/aAIPBtPcmcle1XL8NwraYW/p9zTbLk5r9N9JiYNz13ApppLomoEFUWEGJ gACu3MjWngP6eB1KsI9YWd6IiraHQKeRF7rN3Yleim6EAUh45gJhMEbrOVp7qUoeP/gPeN aDjpMy7iI/ziLf9m5BG1Hi1ujcRqKzU= ARC-Authentication-Results: i=1; imf31.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b="eq/4tfrv"; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf31.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661408874; a=rsa-sha256; cv=none; b=e91WRhs7vkPGl+Z23k5lDzYwP0vzxxI59PTMXXjEEnhJtLhIOIwhEOfNECZbIJPDLQ0TdU Tih81xE8x91OEfh1A5kdhVG7kj80CtNBkcq65qmm8iNAezchx9jOsJ08VIEpczLAHN80h3 +CiPLIIM+gSckorL2QI0v+RW3u6N9XI= Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b="eq/4tfrv"; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf31.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com X-Rspam-User: X-Rspamd-Queue-Id: 7D5BF20007 X-Rspamd-Server: rspam10 X-Stat-Signature: wy1c1tgutwpizwzweufd8xm9tgfppesa X-HE-Tag: 1661408874-836472 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 25-08-22 14:21:29, lizhe.67@bytedance.com wrote: > On 2022-08-24 8:09 UTC, mhocko@suse.com wrote: [...] > >> diff --git a/init/main.c b/init/main.c > >> index 91642a4e69be..3760c0326525 100644 > >> --- a/init/main.c > >> +++ b/init/main.c > >> @@ -849,6 +849,8 @@ static void __init mm_init(void) > >> pgtable_init(); > >> debug_objects_mem_init(); > >> vmalloc_init(); > >> + /* Should be run after vmap initialization */ > >> + page_ext_init(true); > > > >you can just > > if (early_page_ext) > > page_ext_init(); > > > >> /* Should be run before the first non-init thread is created */ > >> init_espfix_bsp(); > >> /* Should be run after espfix64 is set up. */ > >> @@ -1606,7 +1608,7 @@ static noinline void __init kernel_init_freeable(void) > >> padata_init(); > >> page_alloc_init_late(); > >> /* Initialize page ext after all struct pages are initialized. */ > >> - page_ext_init(); > >> + page_ext_init(false); > > > > if (!early_page_ext) > > page_ext_init(); > > I think we can use an inline function instead of 'early_page_ext' here. The > reason is that if CONFIG_PAGE_EXTENSION=n, 'early_page_ext' is undefined. > Thought we can #define early_page_ext as false, it is ugly. Agreed! -- Michal Hocko SUSE Labs