Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp90327rdb; Fri, 29 Sep 2023 18:18:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFzFjyKnyRreGxJbYbNgM4ICegVuBHelqA7P/7Efx5syiueP7bHCdLip5bkKoCeB7ZuKqtB X-Received: by 2002:a05:6a20:7283:b0:15e:bf2b:e6c8 with SMTP id o3-20020a056a20728300b0015ebf2be6c8mr6257420pzk.2.1696036722263; Fri, 29 Sep 2023 18:18:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696036722; cv=none; d=google.com; s=arc-20160816; b=0LZe+eNLMADuj7DtxhAXDg/x2VSXSJMR9s4bvdwQ3GJGy+OBL9aeM0RqoQjc6v0+0/ dw6cBqPGtioa6eOHUtLLmfdGCbbeB4xDFUK0WPoey0iWB9BZlEKzIGR5lU+yPUdu306J DpNYJ1x3Fu9EhZYIEbzZ1CNFM+zUebC9EqfXDMH7x2nVesR1lldTqErssXGcT7KzSr8V 900I5atjLMtd6fmlRA9FCorzmspuAzUY9SwLC42d3GaBz7XHCj8ZceD0KrY3ikfYIfJz oLyJVyN4+mBByFVvXFxxNTEEs7fV4lXcg3DvjlErm7K2qsVj+wyYSGS01pQuaeJ14036 y4rA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=TzFyE8zAwEgs0Q4irFkzPCcaXtODzp9uLW3nkoQP7WY=; fh=KOqnwf3wLq339F86BgBAUBm2BDBdSDR9Q3xMFmvILoY=; b=Tt8RYDM9JJohyV5CyVqZfkDMJBJWIt4daJpri0c6RmfV4V90VFA4VlzX4P7BFSvwFF AetA8mCG+w5UwZhL7DD6yViJ7yYtVjR7CJevDGvOvAVrRqhK15zTN2Va6IVszaMNdwR1 GI5Xbuv8zk+3KtVweyE3FMEmQ9KX0He/vAdzik7lqmGlXG4cUzyckckKUbGyai6cMt0Q THQcYhGpdxcPIHopE9Hg6fefPT92I46lcOBNRXSfqiTcILyXy9A0NujpTd91uyOYvgVu Yb5Zs+BcHcNtbj2y6C9QzKhvURB2IUIPDUZCce7EWm/Z2tshWpqtDZhB/XiLPLn5IBHq fp6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=wIX935S8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id kx14-20020a170902f94e00b001c71f14ba7fsi9040433plb.247.2023.09.29.18.18.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 18:18:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=wIX935S8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 105F0809A781; Fri, 29 Sep 2023 10:01:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233239AbjI2RAv (ORCPT + 99 others); Fri, 29 Sep 2023 13:00:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233233AbjI2RAt (ORCPT ); Fri, 29 Sep 2023 13:00:49 -0400 Received: from out-196.mta0.migadu.com (out-196.mta0.migadu.com [IPv6:2001:41d0:1004:224b::c4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BCFC1A7 for ; Fri, 29 Sep 2023 10:00:47 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1696006845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=TzFyE8zAwEgs0Q4irFkzPCcaXtODzp9uLW3nkoQP7WY=; b=wIX935S8qYqHMzheBghLWseBwTXg1uA6G99i7X59ETLXg1hy/6hwE4578pGY4pr18oxGDf 0YBtfXEc0iFfRQ0YupoeS45PloX5DqzXXqAxUFCYFttQ8eiY63kaH83kIsffU+GPMqThXC oE8YAze/wzkyARxLUmy9qG0feJF3/8M= From: Yajun Deng To: akpm@linux-foundation.org, rppt@kernel.org Cc: mike.kravetz@oracle.com, muchun.song@linux.dev, willy@infradead.org, david@redhat.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yajun Deng Subject: [PATCH v5 0/2] mm: Don't init and clear page count when MEMINIT_EARLY Date: Sat, 30 Sep 2023 01:00:24 +0800 Message-Id: <20230929170026.2520216-1-yajun.deng@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 29 Sep 2023 10:01:10 -0700 (PDT) __init_single_page would init page count and __free_pages_core would clear it. A lot of pages don't need to do this when in MEMINIT_EARLY context. It's unnecessary and time-consuming. The 1st patch is allow optional initialization of page count and PG_reserved flag. It's in preparation for the 2nd patch, it didn't change anything. The 2nd patch only init page count for the reserved region, not all of the region when MEMINIT_EARLY. Yajun Deng (2): mm: allow optional initialization of page count and PG_reserved flag mm: Init page count in reserve_bootmem_region when MEMINIT_EARLY mm/hugetlb.c | 2 +- mm/internal.h | 8 +++++++- mm/mm_init.c | 40 ++++++++++++++++++++++++++-------------- mm/page_alloc.c | 20 ++++++++++++-------- 4 files changed, 46 insertions(+), 24 deletions(-) -- 2.25.1