Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp304946rwe; Thu, 25 Aug 2022 00:00:22 -0700 (PDT) X-Google-Smtp-Source: AA6agR4v3ykqpZcGJSg+k3kZaysG13Rk86g6YLGPT9bp+e3j+h+1np7KctviG7CR77GilPg+yDMz X-Received: by 2002:a05:6a00:2354:b0:536:c154:1ffc with SMTP id j20-20020a056a00235400b00536c1541ffcmr2777827pfj.28.1661410821786; Thu, 25 Aug 2022 00:00:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661410821; cv=none; d=google.com; s=arc-20160816; b=gZwmwbM/UqUvEYW/EdJkI6YN3DJe8nbtaovFrLhb24O00ZQ7ynJYyAAJg8wM2wLXDJ hYsL3iME+BT/0kxPCJkzCUtzNa8I+7wT4J7xP73wwaYqezG84sElBnm+cHW20f/LGiNV cLlG4wv7ujstXEdbESdv7nxA0Qj0lrrwQBPVrrjUtCCLHTDlUPAjdyNwPXF9N6wu14k3 rf9tjCkqwL0yrclj9I1wqwBgs0cwBJ846t4DLB5YTyaBNSJ2/EvJSSNDVNLj32jLtLla 4Y1/rznwmLUkU1OXrUaY9O+vMUSV6d2LPmXSbSrXnAslyLzxKhZcG874y115ZqcjNhhj XG/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=0spxPtpuY4nMM9lIZ8wJ8lR+BxR1fXRkfAOF1d5glCI=; b=N5Et9Yw1YrLdJV9sxBUPJa8e9baCh8ZrkN6qnXLOpnRDE+I2WKJAbSBGbCQhVN6gvJ F0rOIQ90s/xCkGkEz4EBRkOulVWa8V0Aj/ShVFSQ8USPxvvnCxv+ECOwJbOQ2yncWsUa 0mTYdkg4loT3sU9nMTwRwNu95A+i5oNST0IbeDEC4+Vbs7MXnIB3siRXgWjGBHbc7Rpb PglORXJsbIOZKQjO0x1adVM8cQWO/Jv+BKYqG4ncSCCM+8RdfY2O8YAmTelICXer7c4o oOCrbYlTBcQvEsqtMDJm/HOkFUDIFuItGwxvwDy1DrFLmGbmRPR0YgVLQkREweFNVDZ3 UBGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="eq/4tfrv"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p10-20020a056a000a0a00b0052e75042898si22530934pfh.313.2022.08.24.23.59.42; Thu, 25 Aug 2022 00:00:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="eq/4tfrv"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234248AbiHYG14 (ORCPT + 99 others); Thu, 25 Aug 2022 02:27:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230127AbiHYG1z (ORCPT ); Thu, 25 Aug 2022 02:27:55 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 437439F77C; Wed, 24 Aug 2022 23:27:54 -0700 (PDT) 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> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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