Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1064444rdh; Mon, 25 Sep 2023 02:01:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFOYFGMjPGqb2Fyjvd9A9qrA5eAUL9Rpnd1Olq70WOVEK9vNmXUEXOuEywPeUm7xsod1qNF X-Received: by 2002:a05:6e02:b48:b0:34f:663d:b9fe with SMTP id f8-20020a056e020b4800b0034f663db9femr8621320ilu.19.1695632478551; Mon, 25 Sep 2023 02:01:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695632478; cv=none; d=google.com; s=arc-20160816; b=L/2+EpS/X2JKQp8iUWgP5Agbmd8W5/gtc5WLHrQdwskoxer251hsp5n16CgGsg3RtW ElIRL/6mLBbD0LootnjovxJwmBkfLMUl4krCkRvwNw2Ql1DZXgM2g8mxVUHIjTUaNLsI qQBI4YMuGwbzHx4nbp/P/w4t58SShTDs1BseFOU+5uJUG0fFivsRyIQ9GnQYj4jdVhVV fEi3qn08boQ7GuAN+MHDDT2A+7vT+cXtZQYBfTSPV87G7fsEqClEu1RFrz/ImFXTSHpV +p9OEIsLZutEiAVeauUEMt96lN4q11IAfQCB6CjFpvJU9sEBJmfAFfO4M3qAcQNpitfU DC1w== 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=hiyFhiaQhm798t4iJIIYjp8j3a3DZ2cBv8q4T6I2PtNBR+zApScXEsZ8Q+uTis814L ThIjR0wp178NSNFx3bR7q5nIVKcdcDRB7kUdwDa28AVwrLW11nKsp9tdkJ71uM6GMdRd Aij9gfaMH4Nre7SRz9Z1IRY3s9w8gNo7fORWhGg7oAbD0oPV/r0xrnDoBjc4C0t/W+7U l7keh1C5IotzCB8Np33IF9yHRvqVSH6g9jpY+zYUa4DHr51ppzylxci/o+E2Mh3LGmCS TyYcceqyn2CHmnESX2pDerB1P3bgviaePBQYGEWcJVmS1vPXd+CZQg5pA0+3pc93wJEE WSqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Pe4cl4at; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id m16-20020a63fd50000000b00578d0b680a8si9485980pgj.824.2023.09.25.02.01.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 02:01:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Pe4cl4at; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id E9B7E802FD17; Mon, 25 Sep 2023 00:22:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230289AbjIYHW1 (ORCPT + 99 others); Mon, 25 Sep 2023 03:22:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229832AbjIYHW0 (ORCPT ); Mon, 25 Sep 2023 03:22:26 -0400 Received: from out-194.mta1.migadu.com (out-194.mta1.migadu.com [95.215.58.194]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DCA3192 for ; Mon, 25 Sep 2023 00:22:15 -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=1695626531; 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=Pe4cl4atEQiQ9Qr4Vs1ri25Wr5RLSc9i6noi+ib0BrhZ7cOI85cev+Qf4qrzLCjkiKzPBL y4WTkVs10+cFYeFIqHLzyYHbPUwe15k9gpQDNtBDV1ZvLKCZSuaMUGdduP8V28kzzgcKy2 h3yaS7/Q/mbue5RK+JzfXzrGZXHrjcs= 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 v2 0/2] mm: Don't set and reset page count in MEMINIT_EARLY Date: Mon, 25 Sep 2023 15:21:48 +0800 Message-Id: <20230925072150.386880-1-yajun.deng@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 25 Sep 2023 00:22:25 -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