From patchwork Thu Sep 28 08:33:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yajun Deng X-Patchwork-Id: 14658 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3324251vqu; Thu, 28 Sep 2023 06:48:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEVfobgTdrRJ/hJbUcREpHz6pyAMJqz/EvtVd0fQKxF65pEiayZU1zRB0v+FsrgodSkJ7t0 X-Received: by 2002:a05:6808:3086:b0:3ac:a4ec:e136 with SMTP id bl6-20020a056808308600b003aca4ece136mr1536124oib.51.1695908908502; Thu, 28 Sep 2023 06:48:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695908908; cv=none; d=google.com; s=arc-20160816; b=msy7sDIL+fC6sOgKuGkJKp7FIwfIIBJl6bsqU3BM1PG5fxevCLgq016FxgwHsztr+4 dxC+0t8+It8dJuRYgx40HLtQX2ANl8/53YwJYin/adCk1UVxkfqQExdagH6AOzGUnA8e 3DPjsifCN8gTNeCq0doN0GmqLbZxSNx26reGjUvskCIYmqC4KFYZA668VjFhM1HM4bWU dJZYmaCwL7hi9hiwMUliWfUsvanK18He5acYXSJIVQ0RhEo84/9B2Vgeh5oN2BFrxQEF vft1iWwyIMlLmMFBFdBS92H86DoOF3fMaMo68AT/WH/DSFjDri5wGuNw0HGnM8d1wG97 S3aQ== 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=EK+Jf0tqtbrhgvVtYbc6M1gK2luKPcAwtjtGkN+0G7E=; fh=KOqnwf3wLq339F86BgBAUBm2BDBdSDR9Q3xMFmvILoY=; b=zuRfZFRARMS/n9+1nt//ClCoklcMft3GhP2C/nlUNK6D8fXgx920C2NW2+Wrp1xtnQ iRTUCgvg6sroV8caste4EBefPGS9lhwXoRKOFE4ERpnp41Im3L9SRhMBF9q4yMkEML2m jkr/Wt+5QIHiuQx3iS+XXFFfyNJMkMOh2kPN7sON81Qh1A8u5/l+XWc38VR/GBv8iZUF JLI6Qgp8oj09B84FgGT+HlidMk7L7B9V7QADZP3mtwZhsGECS9qMOhq7gx87VohQBrPZ M3/5QpbrZ8wAozgHYECkogb+j7av41uPJvqGfvT4r/sva5lsFtknboD5iwe3ByPGU+Yx X5+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=DyrIRUf2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id bt22-20020a056a00439600b00690dc61cc93si18669514pfb.403.2023.09.28.06.48.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 06:48:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=DyrIRUf2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 EC7BD8232677; Thu, 28 Sep 2023 01:33:49 -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 S231248AbjI1IdX (ORCPT + 20 others); Thu, 28 Sep 2023 04:33:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229639AbjI1IdU (ORCPT ); Thu, 28 Sep 2023 04:33:20 -0400 Received: from out-195.mta1.migadu.com (out-195.mta1.migadu.com [95.215.58.195]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1893B7 for ; Thu, 28 Sep 2023 01:33:18 -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=1695889997; 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=EK+Jf0tqtbrhgvVtYbc6M1gK2luKPcAwtjtGkN+0G7E=; b=DyrIRUf26UR/UJTU1Ws6FpvKsQg1V3IOLHQBP6BKhTzqv3DgfxHgWIVDmW9HhYKlmfWGRf cOFntnToBVir4TJMYBQsKAdjlCmjdhRrW1zo3tgjZZoATXInL4qUVAVLFU+7q4QrVuHual DwKiW7TDEJuWib4S5r80VzNQaEeY3J4= 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 v4 0/2] mm: Don't set and reset page count in MEMINIT_EARLY Date: Thu, 28 Sep 2023 16:33:00 +0800 Message-Id: <20230928083302.386202-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 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]); Thu, 28 Sep 2023 01:33:50 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778289379347889582 X-GMAIL-MSGID: 1778289379347889582 __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 | 38 ++++++++++++++++++++++++-------------- mm/page_alloc.c | 20 ++++++++++++-------- 4 files changed, 44 insertions(+), 24 deletions(-)