Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp5675312rwb; Tue, 17 Jan 2023 17:24:30 -0800 (PST) X-Google-Smtp-Source: AMrXdXvcI7YSOuNwCFM2LnX5eCxnjIz2ZcXuIC40fIQNiwpaSQCFwmO4jaFqXIhDZv1HkaAoCGzv X-Received: by 2002:a17:907:2159:b0:849:e96f:521b with SMTP id rk25-20020a170907215900b00849e96f521bmr1221159ejb.32.1674005069841; Tue, 17 Jan 2023 17:24:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674005069; cv=none; d=google.com; s=arc-20160816; b=0zFR3akmMZb3I0X7tG44LWEPcZCRK9Vf4EGjHw86sLCxymCTmU9l1vCBGM9tVEDaok qOPsU4TMZlfqmaqB5/iMdXfNGwE/WyHP61JEBJaPRwHPE/R+vC7qwZ4Ou0tTodL/9Zq/ OHVwvrk4U3nXLrZpdAvgQsPUwJLeffYiD6G2lNiuDkUWIbz50dgQXXb7e0ftE4ngwwIM gV+vp7FK7ETkwpnJ0MMV+5oW4YltaOAtMF/dxnzox2AF1+6a7wH+T9YOlSDnatp5HwjT B57JfLSAsdjAjIX7sZK4eD3+2C5v43zFUZNsyC6ZwdzQt5nCiZBfGKAz7xNiedJj2s3h Cx1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=vLOav8IWgAmaKQZbJD+cSG1xqosYpeI1k43+Q2XvQNA=; b=ouwS2Xhyj6Bxhq81C73j+u54REyIbSPTeBZfKdq3aphnNBX+KMZMlJgLvlcN1vJCEa KOHCU8hNDlWRTwheftY8EjjA8VNmw3McR/0SW722B1qg3DJuQ0+qbb5KYNj8VaiG6WH8 uKydqBylDcDvSVe9+9lKCvhQAmOd938xJbCr76Y1dMOL6+MTX3jA1MGYIvqvp+v4IU9E IzT3WsV210QucPhnHoIdhrtVvuCmwKG4GDzj1k5VcS5vFowXEAqMk7Yj6O81PcEqn0Im Em6zATDkIPmwFwqwM6hsYpR1zmEblbMg3LTta0/tUM5EsKhW46Isgcv3uUx7GhN0WwuL Efxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=udnOuwa2; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs19-20020a1709072d1300b008715af934f2si6651985ejc.244.2023.01.17.17.24.18; Tue, 17 Jan 2023 17:24:29 -0800 (PST) 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=@linux-foundation.org header.s=korg header.b=udnOuwa2; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229581AbjARBSA (ORCPT + 46 others); Tue, 17 Jan 2023 20:18:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230132AbjARBRT (ORCPT ); Tue, 17 Jan 2023 20:17:19 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5E603CE2C for ; Tue, 17 Jan 2023 17:13:14 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7268F615BE for ; Wed, 18 Jan 2023 01:13:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80C26C433EF; Wed, 18 Jan 2023 01:13:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1674004393; bh=fk4xm4Y+i17NbExuukutS9RENCIwEMlB9MvB7cPidDg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=udnOuwa2DgChr43Fas+3JsfXU8FXPXmZZItIeMR1KQsKzFO3WKQnmx+Tn9YvGSK4M TC5XO+gDXnyi7PMjefEbaicTZy3MkIJuOS83b1yuQ734sk/0rwKYw6/PA3CPsGyS6u NZNH9QA02Rav+slBL3DsMdXkNS40OfeRqe5FPZXQ= Date: Tue, 17 Jan 2023 17:13:12 -0800 From: Andrew Morton To: Pasha Tatashin Cc: rppt@kernel.org, mhocko@suse.com, vbabka@suse.cz, david@redhat.com, quic_charante@quicinc.com, lizhe.67@bytedance.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] mm/page_ext: init page_ext early if there are no deferred struct pages Message-Id: <20230117171312.13bdb3b2673bdac3c93c2ab7@linux-foundation.org> In-Reply-To: <20230117204617.1553748-1-pasha.tatashin@soleen.com> References: <20230117204617.1553748-1-pasha.tatashin@soleen.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Tue, 17 Jan 2023 20:46:17 +0000 Pasha Tatashin wrote: > page_ext must be initialized after all struct pages are initialized. > Therefore, page_ext is initialized after page_alloc_init_late(), and > can optionally be initialized earlier via early_page_ext kernel > parameter which as a side effect also disables deferred struct pages. > > Allow to automatically init page_ext early when there are no deferred > struct pages in order to be able to use page_ext during kernel boot > and track for example page allocations early. Compilation blows up with CONFIG_PAGE_EXTENSION=n. I did --- a/include/linux/page_ext.h~mm-page_ext-init-page_ext-early-if-there-are-no-deferred-struct-pages-fix +++ a/include/linux/page_ext.h @@ -92,6 +92,7 @@ static inline struct page_ext *page_ext_ #else /* !CONFIG_PAGE_EXTENSION */ struct page_ext; +#define deferred_struct_pages (0) static inline bool early_page_ext_enabled(void) { but it then blew up differently.