From patchwork Tue Sep 26 02:33:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yajun Deng X-Patchwork-Id: 14508 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp1650695vqu; Mon, 25 Sep 2023 20:47:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEnoalPyNWiqYBbT+hTMjmRz626/UKivcGzxwjEZxI4V/29VxQI4rKoUnFIyXi4YN17dhC1 X-Received: by 2002:a17:90b:1d05:b0:274:4f21:deae with SMTP id on5-20020a17090b1d0500b002744f21deaemr5986448pjb.35.1695700065093; Mon, 25 Sep 2023 20:47:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695700065; cv=none; d=google.com; s=arc-20160816; b=xgfLI3R3RZXQwN+P458U1tlihfi6PguyAAyZUCzCNOjxKsqtmg/FwMFgIZDSEnX1kL UmuBXto503cuqXa22x1MwdhxfYdp4QZpePWiE76n4s0q4K2eWgh6G4sGSxR9vEQWSWNm VH0H/QJ4RgbzDp31F2w9GaoRw7NKXeq3XmZ3hDrs5GRDaBFtFj68nfjeqY8lEqz4bRut 55KPETYo8DJ9Gb+YP8i89q0fa09mZZrt5w7W4zueljh4RDJZ3nXzn6MrAGAxhruXrCGC dCNZ4ajm98lJGnMno4bo8ApeZGlS2/Ly57TOPNkkc65yw8wEQ5ARZZkHWW9o2ydh7BAk LvxQ== 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 Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id f4-20020a170902684400b001befd0512ecsi10746681pln.314.2023.09.25.20.47.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 20:47:45 -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 84D38809D47C; Mon, 25 Sep 2023 19:34:24 -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 S233439AbjIZCeP (ORCPT + 27 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 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:24 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778070391358489955 X-GMAIL-MSGID: 1778070391358489955 __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(-)