From patchwork Wed May 22 07:29:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13670516 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3559C25B77 for ; Wed, 22 May 2024 07:31:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1B0306B0083; Wed, 22 May 2024 03:31:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 161BC6B0085; Wed, 22 May 2024 03:31:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 027AC6B0088; Wed, 22 May 2024 03:31:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id D8BF06B0083 for ; Wed, 22 May 2024 03:31:16 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 76082141137 for ; Wed, 22 May 2024 07:31:16 +0000 (UTC) X-FDA: 82145210952.01.9962291 Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) by imf07.hostedemail.com (Postfix) with ESMTP id D03C840018 for ; Wed, 22 May 2024 07:31:14 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=e4vZf6DA; spf=pass (imf07.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.53 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716363074; a=rsa-sha256; cv=none; b=bgl+925Y3V/AarYr2/kVUByqePjpBNzXT4hAI4kN8KP7bg/FcTxuLnfGxqmvCaDPvzKqO/ hg5QOKLH76AKlyIYFZe5CVCUqrG9APo5x5JDDPFFh3ZtP6Du8TyLqtxQU7vCs0vdZWLtIA QiREwiqS0aNJ7Si+9wvYubm2vtdL6y4= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=e4vZf6DA; spf=pass (imf07.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.53 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1716363074; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references:dkim-signature; bh=O9yRODsrGBlZbxKCO13AeSxsVtCZSRPTClAZywyOPkM=; b=Iisu4rOc5ktjh004HnPvyhlZIuVl45oRSnPwiHlGnC9FaY0YbnyqbtgsjaoSbxtjgINaAW 8uVCdf6DqiIEYb/HNio3fxr4H5H6f3ZAqTtvje38r+LQYfBB4lduKBAc0rdSOCC4aq6pRM CasKEcseMvcRiLIsOggoa/WtmuJsAqM= Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-574d1a1c36aso9538099a12.3 for ; Wed, 22 May 2024 00:31:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716363073; x=1716967873; darn=kvack.org; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=O9yRODsrGBlZbxKCO13AeSxsVtCZSRPTClAZywyOPkM=; b=e4vZf6DAg553T7mbwiU4iEylOquofmzdHbhWhF4T2esPKLOPXVvOFJ0ZqzmJgCw0cF W2fJB0BOZHBGTTf7PuyYAkylpZcHrcywVuDE8GJ4UD6pTDmtq9XLK/Q+EkVffv+W34fx Y0e0uEVnTVHDRK6xERMlU6IXYZgDGZu39B0o3XUyQri8RDiSxEFwP8xu+IbWcVAI3wvI 2kUrwP6uD+2r49I+edVUFt77qwNTTW85PKOD6NcW5/pIXvF0JMdhxQMgFj6Nc2zNn1W0 uXZHZuUtFh+QgPk67xop53cj/W96gCxzxKWqk3oC++1FeiYo8TPINKRfWmEvB2v0ZLJX x6EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716363073; x=1716967873; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O9yRODsrGBlZbxKCO13AeSxsVtCZSRPTClAZywyOPkM=; b=N/4/+9rX/QxaJPYPBllqYSL/Rqd+dNP4KEuu/0dn/Rsw6z0T9cQ20FXUYle/h27/Hb 9mX+jGWnl+2CRWECu82SNgOZ2oKuTVB1IUvdw9ZVffswV9/NI80hfMJLLTyO664Bet4O MikxpPiZ5fZYyvsZQIetzseGVVz9RZvnlBacEGWXolWl/Gflpwuv3rBLZSb9SwJxw113 zJ4k5LrhBoptrn9kNw3JleVDryxdwWL7XzBPssPupivbA7dPl1GTJTyTpryg7vLs8O+7 4qmidp1kjwVH2iCEaFC7nO7SZ9tlDVW7zNh0fQzLBwvuQhWMrydwUoavMWWdKUmrqXLO xySg== X-Gm-Message-State: AOJu0Yx0WhI0XGrjNGLx1QKl90X2TeXAbs6rKg8ZGRFpEimWKYZGubS2 mEVyHXQi+7gPQvQhQ8/DlWqmXYhJHdiLLgYRXvl1Tuy3RBZ5eKHu X-Google-Smtp-Source: AGHT+IFOd3iL9cZroPPlk3Z0aJZcjx0GKQQwxZCwkwC2Xooblv1NMEWwPS6XSu0VKCiM3vPwNPundw== X-Received: by 2002:a17:907:9702:b0:a62:2b65:1dda with SMTP id a640c23a62f3a-a622b65241amr45069966b.55.1716363072845; Wed, 22 May 2024 00:31:12 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a1787c63bsm1733424866b.51.2024.05.22.00.31.11 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 May 2024 00:31:11 -0700 (PDT) From: Wei Yang To: rppt@kernel.org, akpm@linux-foundation.org Cc: linux-mm@kvack.org, Wei Yang Subject: [PATCH 1/2] mm/mm_init.c: use memblock_region_memory_base_pfn() to get startpfn Date: Wed, 22 May 2024 07:29:58 +0000 Message-Id: <20240522072959.23741-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: D03C840018 X-Stat-Signature: zsnhhxcakjx61apu7jso3896d3tkdnr4 X-HE-Tag: 1716363074-897304 X-HE-Meta: U2FsdGVkX18zxz5XyvnBATBWulisbksBurDbYhK/PgJUdcHhgKuntmRTIuT3KRLJk7JtUiQOvE3RvDLmMJtwwRMY8Fuj3IJD9tcAAbYx0GOhXoH3VNZHXhgjMQmoExzhHhVAjB7SxgSxNCxfEdLpQA7bvE+mQHUN1WykmcGYS+uuhUp5rjvIViDb5MlarbVPf4aayC0imHG6Z4XDEljSKwhFlvdbGUYa06O1bvLMIgNabLShbrSGLljlM0ERPmzS/+PmUOZ3aX1IOiypJ0FMAZoka58qiRhJy4BrqAUv7QNYeP9gbyxr2Ze5IGqtp2CbrPfqyBfWj9I0bzHE+yyrRYP3FJU6hW2rGESWKrvNC8OBkso2OOUbZGjp1B5H92yglRTILG9zLEex1yketfFTBRigIn2/SFa/D11fmEeUsVjbO2E4EME6ZeAtv4szbiXWVQThH6Q/fN9YIlKXB0yXwIF+pavFaEHadnxQFjs6DyjTNuYW3R/p7HFm+8lpjeEnrAT1t09Rrj/Lp6yDsqO/j5/T+k799zRvPVoyvv9ahuvcRoT0Vcz9DYkPBorFm7anpRorQLBI2/z80recekn5zKjfBAcr2+u+4vLgPGhdLMt1wXX4viT3tGjFBwvTIJDtRIhELfghir/47DKq3hnQWoInTIkY6UPwfY0a5ppSe3CVDKa0x/UIIOap/pZ8HPm9WOjy+GANIJdGwUpM7fvQVu+FOhSk0mKK/7kx/Y7NrC5ageX9BrXTHVAl3nObVMDXnIIHSthmWsM4G85htm6rc5Bk0YrHisrFkCI5KL214tpccmTQ1UPKgZCRpVvsySwijYUgRk/7loopEuovsQkP1Ow5DaKSRUeZuD2BSOpnQSke8HPlq9vFkrHylvQM2e3EAsdzVSFIqhyfOhLeIUEP7JeguzhxpTOthqPFF7NClrBtnKuomijt52PonOhiBE+THGzdZWpny1cp9fRqNrt LvwN2g2t mZZ4QXVDp4cW1RqtwqTFEeHq3xVEv2lKCVT1PeObGCqwVvUo+5maJLR2UhW3VNFL5DlVM21EmglSaf7xgMONzP//OtIlcL8RuGabycXb4Ke9djm+gWrjTZzCtGMAtKotsKHEp+Xn6dNq2dUkNqPXDdamHZPsrxodfOCKALB0YTbmIGA+HVxg19xJOsbxzIJkMC7NENpAgjJRV+84D00lOGuOAq8KbdWUa7BAoom+FLYaCraE6oiyWg/fK7dR3TLpvJq+4IUvV9/CXoq/rcpIHXvAwMMKIPxl9MzfCZlCHIn42/GaXdfvlB6VaeA6EVGhThTpU7n3/rQ3N13gt3p/b3Khqvy4qF4KBfofHZIcNRVmhbRlSpRoWvsYEl7HNsCrO2KRBSU4WSqGqqBXkGC8K5DM8T31RNCYS4PzS1RJdERDumMAw32WWQc63p6oxFENIZiOMHScaQGki2JZOJBokLs5j8R4aUBNVQ33jPVneZgfBIZwnIas0XmHHabjsiNzaqFFLiTV5MT0dQuks8Jv9xUUOTB9TfBl3PuxYSssMZcAFArs= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Just like what it does in "if (mirrored_kernelcore)", we should use memblock_region_memory_base_pfn() to get the startpfn. Signed-off-by: Wei Yang --- include/linux/memblock.h | 2 +- mm/mm_init.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/memblock.h b/include/linux/memblock.h index e2082240586d..6cf18dc2b4d0 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h @@ -565,7 +565,7 @@ static inline unsigned long memblock_region_reserved_end_pfn(const struct memblo } /** - * for_each_mem_region - itereate over memory regions + * for_each_mem_region - iterate over memory regions * @region: loop variable */ #define for_each_mem_region(region) \ diff --git a/mm/mm_init.c b/mm/mm_init.c index f72b852bd5b8..2dfb87841fdb 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -363,7 +363,7 @@ static void __init find_zone_movable_pfns_for_nodes(void) nid = memblock_get_region_node(r); - usable_startpfn = PFN_DOWN(r->base); + usable_startpfn = memblock_region_memory_base_pfn(r); zone_movable_pfn[nid] = zone_movable_pfn[nid] ? min(usable_startpfn, zone_movable_pfn[nid]) : usable_startpfn; From patchwork Wed May 22 07:29:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13670517 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AEAC4C25B79 for ; Wed, 22 May 2024 07:31:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3AEC36B0085; Wed, 22 May 2024 03:31:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 35D5D6B0088; Wed, 22 May 2024 03:31:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1D64B6B0089; Wed, 22 May 2024 03:31:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 028636B0085 for ; Wed, 22 May 2024 03:31:17 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id ACACF1610A8 for ; Wed, 22 May 2024 07:31:17 +0000 (UTC) X-FDA: 82145210994.25.D3EA3B8 Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) by imf06.hostedemail.com (Postfix) with ESMTP id ED56E180014 for ; Wed, 22 May 2024 07:31:15 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=c56m8oN2; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf06.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.51 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1716363076; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references:dkim-signature; bh=I9LNlp7Vr9e2XNcPJ8n7JHk//I1lYT3ZDoZEKcoYIV4=; b=DFv66oznHpzcEV9A3kXbZ5+QhsU5N013Ga45hWrL0gS0GPBJ3QINhwXQXqioGNjbml9ooI kinkBTtYtaOPdxuTDA9kVt9V4gKMODyLzHKBJgvbqscb+G2vxxDG6ISboRap198xmpf6EX 3E0+VPqZNsETaOvm561GYkby0tzFjp4= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=c56m8oN2; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf06.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.51 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716363076; a=rsa-sha256; cv=none; b=mHvzpiKnYxuaAvTLWW07+Pu/+0M30bdi00KylGY54M2AS4Godn4S+HY6kHEdjdW/ADqtPo nE5DLW4Xo8jmYNBHLPHCM+Q/AdQYoV24yDtXx6YInJxJ3A+ZoUTooqF6zhPZMhLQ5wrBTE BItaGRTUtptLKV1c+Q/xWssbVqbvNNU= Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-5755fafa5a7so4876193a12.1 for ; Wed, 22 May 2024 00:31:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716363074; x=1716967874; darn=kvack.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=I9LNlp7Vr9e2XNcPJ8n7JHk//I1lYT3ZDoZEKcoYIV4=; b=c56m8oN2cfx3xLDGA7UogQkh/P4C2cUlW/9Kn4IEvTBuhqSEiKg2pwH32Moy3oP4Ch N6V6UT4PALoAAvHJNp67/NdYnzEXNBrxcFvQ1TpiWQ04DbcgXQT50vQvzFI0rWz0MjDQ h7x0Y3c0hU0CB6vYoIJfg7LAn90jyFfM+QP85ZfrFCedQEO+B2dAsSJdM8vleBd4pB8E nQcxzCKZdRV+SQFTyhfGMw5y5P6k4OFInpko9dIGJj8dDERXGjQwgrSCO1Ban+4yJf2C laKk4Pa3WAdM6zCVfgQm2wnQ+lystQK83IIpgSxjoUfmxhBqTBryacvZg7BCEi51yZ+p 9HsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716363074; x=1716967874; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=I9LNlp7Vr9e2XNcPJ8n7JHk//I1lYT3ZDoZEKcoYIV4=; b=LEkmiXklRQ78LwO0+S9PA+i5jQugDo1n/BWRbxX9BvB/oLs4jKnqn3Y0PgHtA4uTxW ahGAAIcSH5KxaTMRzaF1mp6MxUb0WkrtbSkXWw28gpoL8LCLMOS/vadWB7ahA67prWe7 Ii71aa6IWSvyI25FXERGRHIxhauxuRPnFwYXINaMKmHa+gPejFfpY6BohIBzfvuUren6 hFMfLD9Z+nMLQjfosXfveZ80OkPVsW6/wwcD0xbGtvVrP1gh94TYyD4BW8V1VLtJyu0M G2dkaZhAuUdmU+MLXIqlZHZha8YJk/QW+LQGy16L/Tv6uLYVbxucKOlCFefexvmKj8XQ 7sEg== X-Gm-Message-State: AOJu0YwPBVbnUCisv0cV3TeHlteYNem+UPVqvM3xIaEpCiImK7lNSaXP YcCEFdY/xFRohYziOQS0ZIywUagP/qZ5Tly+CGDBb588mLsibDQL X-Google-Smtp-Source: AGHT+IH1mFLdjD7DWiwZUxeY3gF38EWviW3maXIl052pNZl+HIaqf73KzoCPPXwJ/XDvX5ce1KoIJA== X-Received: by 2002:a17:906:6bcb:b0:a61:9c28:f172 with SMTP id a640c23a62f3a-a6228198c0dmr65743766b.51.1716363074397; Wed, 22 May 2024 00:31:14 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a17b015ecsm1757119866b.177.2024.05.22.00.31.13 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 May 2024 00:31:13 -0700 (PDT) From: Wei Yang To: rppt@kernel.org, akpm@linux-foundation.org Cc: linux-mm@kvack.org, Wei Yang Subject: [PATCH 2/2] mm/mm_init.c: count nr_initialised only for last zone Date: Wed, 22 May 2024 07:29:59 +0000 Message-Id: <20240522072959.23741-2-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20240522072959.23741-1-richard.weiyang@gmail.com> References: <20240522072959.23741-1-richard.weiyang@gmail.com> X-Rspamd-Queue-Id: ED56E180014 X-Stat-Signature: poxjof1m9pni4apikhjxu3t35937nqxc X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1716363075-939241 X-HE-Meta: U2FsdGVkX1994gK+B8xS4bppt4H0ArL+t5tv0reX1a1FepD4W4sZpIuQPHwaxabUMjYbNMyt4WlcpZY53OWgwQIZMZQBpA7G7pfWU7V4TtjwmbGRTQIe9IkuTB1gdMA5+KRFs04uRgz1cBL1LhepATgHoK5QmLdJYg++67dWE19ev9IV8QkZCfFrXKc5h2yXG0dQSFJBYqlXr0USWDUvFIvhnkwvDsAwU+U2nKPioDWTdxqrn4AdADtwk+RB1o6PVXe4OIlcDQS/FBLMWwfKf0iX71VSBkUW153akgfFj1i+Pxfc48bnIwH9o6jEqvkVitv7wJEy1+c3YoYgfnxdcwaoySvsigjngKlFSx6QqCFf/mIXFAMcx/WlAvzd+YU5EYpUwQxluBXsLDslRlaI4n/On5T7uAjTQbzmupEkvjTUgxuLtaQJ30+rsZWpnI5NwsemFArrIu7RDJ2fTg37wBHPcy+J34+xuUwsFq3j7Rip3UGZp5tNX0Le7Aw5eBDYUGbpEGREAYDqm+cUR3ot1VgBCWw22d0AZNydRzOm/MpUwiB35TzYpSq7zhiQKSwVwvB7epgkcnhyg6jU9WJZXf66q1m4/Fy5KzmTH1IE6tMw9VjGVFvz3D1fK6DYErC6i4VjGJHRwLsdITgO0Qq1XaVecaMN9Dapm4Ko/B8Sv+dF5B5l+0zH+qgQ3plQKy3mrIT8xBOpIW9+4fhe+xKLq6v86Vyy6SPWmsIVXvwLbWF1bseK1Sf7sNb6pRpsJmwbUAWeGmadvK9F54BIrsURZqVcUm1LANEMzCQvB2UbXJ2UcUJHEDdkt1w+moFEBzkmXiGrowvxpUXlG4YYW4z0/J90K7ryi0NEOSktC4U3l2Nr4b7YSmvHX7xqBnq0xEPkw6tYeTlM2UP/laOo8M0yf1j/aspaTS8wX8nAGkbdupbAPRHT9j0zsk8TIuO31ERNzw0XekhduuIh26KVz4F cUuWfEdn VtFdGbELNCqx8Sv10PiwIMmaWRZj7ZWaem66haNyQz20C2LBiKYShyzgmoexE3fl3znWpSsf54I1mXByz0QuCyb71QgjLBPCZah6twzYwapaKpD64s6C9RSgl7a/TfRAKLvqQzVwfs8sNVoeE42txVDJ5tgJ0EnPqZ0l+E2NoSyk+2f2qiASVBkNoElGyFlyqjUyMPGd8dPIo+4scrusF9FQwHiYQUjb3yFkWcO4C2XvST/lhyy4Smkb/rzvSs0yyzmyi+DH/imN+g3f4c/jU/ToRlBpoEiQ6xEqkqT6tJy9NNN3w1uk61rwywULSoUOOFzPxS+oZXrTiimCzK+B8NMhMG05uHuE1HukR3g1KQ4wx7MQZbdkCkeNR9i7wdn+JdELeF8J3p6jkkWMfnHNXVW5YB+pk1QSoFWaun70wd15b6fgvkMo/x607qdG0tiNUzdRI14Kg+9Bjz7npNgODcWcjkIECEfwN03ujwjE9/MMEK6og4GCFTaE/BGYO3hvRFmbaU6AOTHx0/nrtl9vFdyFGiLXbzQZvGj4V196eSL1QWJM= X-Bogosity: Ham, tests=bogofilter, spamicity=0.041999, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Since we always populate low zones, it is not necessary to count nr_initialised for them. Let's move the last zone check ahead to skip the nr_initialised reset. Assume low zones counts for 4G, this change may reduce 1M times comparison of prev_end_pfn and end_pfn. Signed-off-by: Wei Yang --- mm/mm_init.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mm/mm_init.c b/mm/mm_init.c index 2dfb87841fdb..4cc627b4ebfe 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -676,6 +676,11 @@ defer_init(int nid, unsigned long pfn, unsigned long end_pfn) if (early_page_ext_enabled()) return false; + + /* Always populate low zones for address-constrained allocations */ + if (end_pfn < pgdat_end_pfn(NODE_DATA(nid))) + return false; + /* * prev_end_pfn static that contains the end of previous zone * No need to protect because called very early in boot before smp_init. @@ -685,10 +690,6 @@ defer_init(int nid, unsigned long pfn, unsigned long end_pfn) nr_initialised = 0; } - /* Always populate low zones for address-constrained allocations */ - if (end_pfn < pgdat_end_pfn(NODE_DATA(nid))) - return false; - if (NODE_DATA(nid)->first_deferred_pfn != ULONG_MAX) return true; /*