From patchwork Fri May 24 01:19:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13672595 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 73E60C25B75 for ; Fri, 24 May 2024 01:19:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B0B736B0085; Thu, 23 May 2024 21:19:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ABB6C6B0088; Thu, 23 May 2024 21:19:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9AA586B0089; Thu, 23 May 2024 21:19:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 7CFE36B0085 for ; Thu, 23 May 2024 21:19:57 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id E3071120832 for ; Fri, 24 May 2024 01:19:56 +0000 (UTC) X-FDA: 82151532792.10.8F46E44 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) by imf05.hostedemail.com (Postfix) with ESMTP id 4E0EC100013 for ; Fri, 24 May 2024 01:19:55 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=YT+Sa3Uc; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf05.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.45 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=1716513595; 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=D7L5j+ZcLI0ZeHV1jTXaRatzGuKvpztwU1nRlWREyY9HXU+Xe0Z854J2vwFu+eCG6yFo47 NnxpL7cu3T92HsIoyUKu51OVgEiIvRAb7s3DPvOeKx3Wd7PYQ0FKPQpU1JG/fefwyUyfrd GbDI5wyTPDoqJP2yX2nFHwHkAoFN81c= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=YT+Sa3Uc; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf05.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.45 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716513595; a=rsa-sha256; cv=none; b=as53qWOmnQgvBxZMG3gHOTe7ZTUqAhYukD+QAzuLURrtl2jAVHcVyyTtFCSS78EE9H1pY+ CabBgrNZMzQf+LEG0Jaye/AvXCvVmLprsimYXURUNThlQrDrOkShFcHRrM38V2OKOQsBb4 RsXFPZ5o364NJGg74g95TIw35kEAiaE= Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a6265d3ccf7so28615166b.0 for ; Thu, 23 May 2024 18:19:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716513594; x=1717118394; darn=kvack.org; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=O9yRODsrGBlZbxKCO13AeSxsVtCZSRPTClAZywyOPkM=; b=YT+Sa3UcQKcfso9aNiOWQuv22x29F5OX7JEobyKZ2rVTHzlbMAhvB1PEJPRWqKnkWL KsELdwRGQ0T+rOt6kcAqTw9W69co7rbFNvqpQ2tIGCqu6jHG4Akpf8mfbYa/l9AOw0mq eIDxxrOJO1XFEfEDb4o8oFEcJvL8iMUgh/FgC2pqdRN4El1CGbxkObcM2qt4IRaCXB4t wvWoMjxl4yShHE8QofbrFAExapXimlALEzkmEN6pIg27jPTFQqvbCy9AaRKMsYKln7/6 XMrdCx+eiFTOrpZTempus4Zm8a3U5Uyn49e/zhWtupGvU1cadSVXB+YYt9tKiyN9SBVE Yoqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716513594; x=1717118394; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O9yRODsrGBlZbxKCO13AeSxsVtCZSRPTClAZywyOPkM=; b=cOZjP6+ucRxnrf/BLdGrKwKd5eMCDl2HnNaW+rN4Xd0nVWY2myt6OOslKJtlUjiF+F VCVFdtPeratbL6W5DzK7fJDxutySoFbPlebNWPOxiUUGJ2dKopzfHKnPL016VKphMwbm V99HK01YQKNyxJyAUmfioCcT/pMSoqnZNAqAIU3Rn9U9jFgWmE6cOUKOfx8xvYz9Guhz CJxTrO6z+wQO8S/869ggbGLinAiI0EvUUPlbe2Kxl9LbodRrJevjqq8qvAHTciNe6cCI 7gKjdYud43ckuJGSzdkjFNcimIibzfC8p7daLvbECLcg70FQA2csz1NOxSCumY8Dx4Pb +ZIw== X-Gm-Message-State: AOJu0Yy1DwXWIYIknJVlO9l3zwyJwg0Or8cdp/EXSau/TlWwsBQxs//F Ribl9Kubnv507Z/CcSZuJdkmtZaeyn0FxADi/Bqy5dnC3zC/FoVFym8Kjg== X-Google-Smtp-Source: AGHT+IEcq3wQuW6mKYbkLS8J6NbP0aHeICi6kd2ZYNw8yrC2SNs/HjrIsfedFce5g+SqQBCdU1uzJA== X-Received: by 2002:a17:906:874c:b0:a59:c3e2:712f with SMTP id a640c23a62f3a-a6264192ff3mr52312166b.9.1716513593756; Thu, 23 May 2024 18:19:53 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626c817b0asm40013466b.3.2024.05.23.18.19.52 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2024 18:19:53 -0700 (PDT) From: Wei Yang To: rppt@kernel.org, akpm@linux-foundation.org Cc: linux-mm@kvack.org, Wei Yang Subject: [Patch v2 1/2] mm/mm_init.c: use memblock_region_memory_base_pfn() to get startpfn Date: Fri, 24 May 2024 01:19:13 +0000 Message-Id: <20240524011914.27854-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 X-Rspamd-Queue-Id: 4E0EC100013 X-Stat-Signature: q1nr91gjgn4ekx8gzgkw4ewwu56zocxs X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1716513595-577408 X-HE-Meta: U2FsdGVkX198DbSVaJTzyKKUBIsyPtN8rsLih2SWZTSmw2eATKkPCcWWes/XHMzW4UEngaQ5nbJKvWlnxSIgJGwUvRD1DEl9KCak2zpjzXVSBlFcOR9tivef5p3Fc9xRUj6NmYIB2UE1Bsx05xGtfzsMUwRwykrdZZTknSJmKFNuSmp7RMF0BaQmDvgyIjji2oLrV20Lnk5aGddqt2Jms1L7JBDq0pLrdzSjTU/i8zndbtAcI+Rb7PmIBAByGH4FR7HyHOIGOUatn0izT+4zBiqP3CSWD5YgEWaIrQpymnnncAjoI77wITAyVNbNuAHYwmIIjaxjd7peKCwDT0HFnyWeo/UCE2/g5HonpdoraQgSUfPpRz2muarr1EKMf+RPYCZuv/g5ybmqiAuPjC/XIKufwnkhncAET38/xRILs3RZhzfX4evotYn9jjHMkoCy2BdTxrDXyNS9sbewXNIqeRWQO9K9EvSco2v5TOYi7Jwrk3cjI1jTvpgTvrOdYo9RhMG+pcrS7+PaeJSY/3aUIPcn1ychxQYMrWub/XM66yY0lRj+LSDC6PxSC+Pg6bzE8SFQ/k0JIbT45JlyCt5smFkIXReWuVAEC+yc+0Y5CazsuHfZRL+6tzP+jWKZBU1V3BLOQeqx51e+cFSozeTc75nGijMUfeDKBMq5qUxK29Kp81xEZ+0bQTy/PdKcQtJ8WPYagUA2shJQMk00CRhI5IxPiEXHVsmhKD9fYdoZG4bIgk5eohYc7vbXcK/TEembVIHjv8ll9LDrouvaEJC/M7hrN7q4BAkb1foLraE1QlSqq/09nPGP1/qxS9a4EvMUP2DLd0uR9s5qT4pZZ4FSVwBV0QDY0+hGOy7GUD5gNsuL37PHWlzLlqlWgbPzdhwWJoPIubYqsrRfRJRVclOHWVmBID/rJsaSPyPz0grvwXhvN45LTyESA129P88ASi6tXo5wFfHzCyRQhxgfzTy zA0PNU0D BH8+O+kFPk/IM6GeFV2uA4Z2HuawRxJciUT1YmrIOcx1u9YEBabAjnplr1jQHK+788LsKM9NKfYW5F6a4Kx9VlTNijDIWyC1KX6kOLxGfpjYwNw70CI9/+JAWt8bwOdR+Hf6alvcv6VCKhgPULKun9a5vsf6aS8I0tayB+RTpkR/KOeYG5GrAoC4Lbr5XdayKcXb+ZZQo7hm9qxWjyo5Vq5mBamAyXFeQBDYtV3z0ZHQSuFesXplh3TB7LcxUWfyeNZwi2e8fU8SsUnpYVDOkuhqUEA9w06klwxv7HZIJu9Ym18WRQaQGCyfskA1tuhoX4xFu9oQLlOOv8htAFLfOI3MKOTllXvUYunTRXhgIidznKtqbvL/4E13TaZLuprK5G4QmxmU1phsTT+iUZw8RQOecO+WGwfmQ9oLASdrC/5+0v/AViBgS1fOmhtMD7lf7M0Ph5OR5U2bVSum3gJ3YsLz8if4o5aq3ZPXE4fqsi8VQ99g6Eg/v1ekCgQivKngjT4SWIfGJsOXNx8nWTBZRnl/I5aBtERHrJpZxrBPHKiAWJvQ= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000338, 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;