Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1650691rdh; Mon, 25 Sep 2023 22:00:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFtR1YGEoNh70fkR2cR3hi6abAfqhxtrsiyXIwVWrTuIVALxdlLs0kjJMLIYuBB1VWGeJdS X-Received: by 2002:a05:6a20:3d8b:b0:15a:bf8:7dfc with SMTP id s11-20020a056a203d8b00b0015a0bf87dfcmr8208584pzi.15.1695704438213; Mon, 25 Sep 2023 22:00:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695704438; cv=none; d=google.com; s=arc-20160816; b=MlBk7l63uQ34zg9hgtuBBup+BKbPsOnoqmhWVGOqIB1XG3Qhygf9aOzJpDYhjjgyS/ Sn7RnqfKdYs5ZIv8rbtjKWt2tnc2ALG4LgLfxmqe8bi7CjYHv9KaoeS108ubAXJhoMg1 0bJImhdeMTCIr3N5cqOOVREeusL7N6WXSAdr4EpsjFPSEjLfYGNZgAg2wp5YaXry6Lqb tcq75WE6IyJAsic1XJ1QUtHZi9C+7HRWr3EFz1D9KHTyUM61g46okE0FrTm6ZFWQr2BS HGgA08g20neiEG1JnBMKWXsbJftDVtoGy90IzaB38JHSzfOb0snHppBXUSpjuoOy90IJ VtvA== 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=xYGJKvwyxelEGCoj1HuYpU6D4jZuMAySPDKkIDk1zzk=; fh=KOqnwf3wLq339F86BgBAUBm2BDBdSDR9Q3xMFmvILoY=; b=IXL4XpkWvif9HPEtv2XPjloqNoIcTb66uuD5IQfe6p+XOIo3Rf+I8++dObuJbn5uIe 4jsJSUxvhOziWpReVw4dtQYv/QmzTBRUf2LJDTnq/VDTkWBZ2kuwi8tfD++EOJTn29Vi iWmMYToazt+kJUwlHwCo5HZnl9TzXzBrkJ9kO8z7acAkJXerb4tsw0kl55p1+lbAalgZ /JUIvEkO8afTLyZhjSAVYPFt6wfKhVLBVw+hnVfuoYXloNnVzfOt9oeBnBcqUudmk1fe +VwPJjuBP6N1MHJD9VytMQYsQwptgVcCM+1ANBXHbAi0Aqp/v2Jd30CfdL9gLc7RjU6t KVvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=dtXZzddd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id u7-20020a17090341c700b001c449fb7bfcsi3075736ple.353.2023.09.25.22.00.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 22:00:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=dtXZzddd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 76C0280EA950; Mon, 25 Sep 2023 19:34:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233434AbjIZCeP (ORCPT + 99 others); Mon, 25 Sep 2023 22:34:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233194AbjIZCeN (ORCPT ); Mon, 25 Sep 2023 22:34:13 -0400 Received: from out-210.mta0.migadu.com (out-210.mta0.migadu.com [IPv6:2001:41d0:1004:224b::d2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99971BF for ; Mon, 25 Sep 2023 19:34:04 -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=1695695642; 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=xYGJKvwyxelEGCoj1HuYpU6D4jZuMAySPDKkIDk1zzk=; b=dtXZzdddcfgmm91xsstxtvbhsnkuaL5tSssrG5UTXNSeMgTm7JdLSYAKxliEbQURWLOQJB h4+dUxOzS/5kuysRV3GAV2gX9yWJwtl6BVv6xCp/P7ywx+Thzkc+fM9Ii2CmYGa9Zm7CCJ YW5vTjm6SaDw8+sbPt1Okx7xiYxoViA= 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 v3 0/2] mm: Don't set and reset page count in MEMINIT_EARLY Date: Tue, 26 Sep 2023 10:33:39 +0800 Message-Id: <20230926023341.991124-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 agentk.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 (agentk.vger.email [0.0.0.0]); Mon, 25 Sep 2023 19:34:42 -0700 (PDT) __init_single_page would set page count and __free_pages_core would reset 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 pass page count and reserved to __init_single_page. It's in preparation for the 2nd patch, it didn't change anything. The 2nd patch only set page count for the reserved region, not all of the region. Yajun Deng (2): mm: pass page count and reserved to __init_single_page mm: Init page count in reserve_bootmem_region when MEMINIT_EARLY mm/hugetlb.c | 2 +- mm/internal.h | 8 +++++++- mm/mm_init.c | 45 ++++++++++++++++++++++++++++----------------- mm/page_alloc.c | 20 ++++++++++++-------- 4 files changed, 48 insertions(+), 27 deletions(-) -- 2.25.1