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;