From patchwork Sat May 25 02:30:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13673884 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 18432C25B74 for ; Sat, 25 May 2024 02:30:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 89B876B0085; Fri, 24 May 2024 22:30:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 84BFB6B0088; Fri, 24 May 2024 22:30:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7133A6B0089; Fri, 24 May 2024 22:30:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 482B16B0085 for ; Fri, 24 May 2024 22:30:55 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id BB31E1A0CDC for ; Sat, 25 May 2024 02:30:54 +0000 (UTC) X-FDA: 82155340428.28.AA80FA2 Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) by imf21.hostedemail.com (Postfix) with ESMTP id 1F1031C000C for ; Sat, 25 May 2024 02:30:52 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=ReyDZTdx; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf21.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.47 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=1716604253; 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=LkaH4V5hejO+ggpaDCnqXbAuFzqB7lV/uZ1Ur5d0vfg=; b=RF8GJYqiCXVgh+SCcB6nx24kcXLD2ZWuOBwIhB2y9SdAun1wWkVvtfcpchngHIo7QABjQr tlyTVFCP/bZE8Ii/+1Pjwfdb4fgxw1pyhysDOFXY1uHktS3FePe5hRnLsM7tv2qW4zhs61 QpYVa/mMspuu7QkgA6jnzRJnWLTmaQU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716604253; a=rsa-sha256; cv=none; b=grm5oGYrpHEble2Srd32a/kXBeHe66D5Kz/r6iQ61LozQUkMHYlIBG9CHIBPXN/AZl62WD G63F/J5SVO0nvi4FeRCg/7xUN6ZJvWKp5+xUsvxnw9pOaAFvAT8i+7cHMjq1zKb/acJCnL d3yPzrpUeY7eY0CLTTjh69T3VT9y3Ds= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=ReyDZTdx; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf21.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.47 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-5785e443cf4so1353490a12.3 for ; Fri, 24 May 2024 19:30:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716604251; x=1717209051; darn=kvack.org; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LkaH4V5hejO+ggpaDCnqXbAuFzqB7lV/uZ1Ur5d0vfg=; b=ReyDZTdx9P15umn9jV0T9vAkAgOPmi/M08X1VGqtJ7JQoAZQ3EiBL92JMHrCzVM/ic nUHWZzDfpL3pTU9VzWq+MXViXV8IOyFOFB0/WHCJkMbaGnKhA1xMpdGKzMuz2CaHMCB+ S8FgGRDUoJeRB+hfEOMJ6ccw++McXLUErYPYov1UKfRnbqiJU9nPS7WTlfyRRRC+Dawp c/vj3NHEyXXDlZv399q4cwAx3O/OGpmkOf6XUT/U7hj/ur6SOxL39P+c6EB5gDECJju+ ilVNFMRit98NLGvSV0x2EOyIthSbzjOk47NuaD8ccSUIeH4vfBhcBI9beyNDiJokNl5k OQjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716604251; x=1717209051; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LkaH4V5hejO+ggpaDCnqXbAuFzqB7lV/uZ1Ur5d0vfg=; b=uQQ3d0aaffiH0ALdSEoNrZ9nYxCM99+mxoDTKUWRr0HjYT59RiKUzPgiuqbvhDnBu3 THvDIfoX7G6WCnWb1CR4mckelwPZJ26U2vuYjWqP0Ac0xr7jhP4TeegpuoiAO4uN1ims 379ROJ5D3jqWMbCCBvq3PQ0xaIKdJPk8FQI/cnANsiaUFBtDn0upM+V2pBMNpWhgN8B0 mie/086d8Mw95TVuecb7i/YDr+l0jey7uVXefSAkLOl+oyeRrKfotSPopFEvbINHl7yY pJXyy+1pQ0e2bBGd8u1L11bCgmY9BpsHF7D3CtgEZZAQcQ96QmyR9fkK3ySA4NzBuTWN HNng== X-Gm-Message-State: AOJu0YxLuBzzmSM31c8Kmns65hywH5fz7yRD7NZjOEEGn4tMXd+OK3ut ztGGBU4O/bf2Y/GxXuVHQt5j/eoaykMPFcHHohY1QyF8rokv4IKE X-Google-Smtp-Source: AGHT+IFrf88/uICcMKtojHtYDnq8PVMRR0az1dg54jhZ9JdPsYywp6OcLqD3/kiAUP4CARhg1Bqjng== X-Received: by 2002:a50:ab10:0:b0:56e:2b31:b111 with SMTP id 4fb4d7f45d1cf-57851902970mr2868868a12.7.1716604251206; Fri, 24 May 2024 19:30:51 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5785b2c4d97sm2097817a12.56.2024.05.24.19.30.50 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 May 2024 19:30:50 -0700 (PDT) From: Wei Yang To: rppt@kernel.org, akpm@linux-foundation.org Cc: linux-mm@kvack.org, Wei Yang Subject: [Patch v3 1/3] mm/mm_init.c: use memblock_region_memory_base_pfn() to get startpfn Date: Sat, 25 May 2024 02:30:38 +0000 Message-Id: <20240525023040.13509-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 X-Stat-Signature: tbsmqxmfbp1g9fcwn5iiu1rocrc7ws4g X-Rspamd-Queue-Id: 1F1031C000C X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1716604252-1629 X-HE-Meta: U2FsdGVkX1935plSX7Rf6T5PM4cWwmr0K8mBXEqeCxsnETU6uCkJHmWjz9wwJ++9NFyLb29KCkUIumUnk43MP2iSA3mhLqw5CFSj+egvKM3LxiiTLzrP8sFdFyZL1ygykN7VM+6i30w6pKX/xXxLwY00W5tUczx+Nb1djnvttkoIPDLGvD+By4HfAjx4AVdZWC6pI3vCcNotpAz02MizyQKwe8ujoDrtP6Dqq1YOwDVsnnhAZ7t8vIqD7n2jHpnLJgvb/mugmxpDm85Gk1IbE1XAHcfMNqQLMgQwRBAOFbAHH5JwDyZThn6gHh6hbNsLwLObi7HCMp56RJFRgWgVU5RJzQLcrWZ9PFEcJe62uPF6bYdjEZTUmzqQHZQzvQ+XENig0RYpkEA+Ho7/bHtPb8t09sPpi8nFR+Gqe8NNS+2FEyWef5t+lEZrSDc4Ib4tm9/Sfxj1J02/mQAXG2yLKeLNlk/zbCXBicX8uKnwjVMLQh6YmBousbXCqz2+UT6uDZkMCWL43PfzDAi6gwsclLrCrzQ7mE/MSzok4j75Xg06tKwqPYp0XtuG05DUzD8ylEaE/TSWoA+6SO7EG63o0ecE4qTPn631EqEJIgMTWK2g0taSiBkZLbkwDbE9Z9MHpyiU1rN9g83DQlotvTXTLFgQdyQqEGChxlh/HkXji11luKhoRxLuTiosQXPaF7AVcHEcbQAecxELAkl3uokqtApYNdpW+x+us192zRMxTLNXUjXGtftqTrnk1eqzMzIK0hnklk0MzMs8ZQMEDiCg+//AoHgxjQ1WlW+KUgPhY6ZISyJvXEICHvXd+7aVyFVM8s2shVHcN5xNX+Ho9N7tzwkm+69F0JONWfCfrSurpSIqv/hBNpNrAAMWUyJZNz+3IstFcioeIS6V/NI3pkNa7VEasL1r+qvI9SI+H5KeJeYkzS5hP1E3Al89ISbGbJkAsithtpJbSEKoZMiSS0J oR9as85C zl5d55ouMctCFSNRMc0LW2ezL79Pifw8iVKvWBW0ugQGzPh9y4WJmUbf8jbE/Ue0v9Gd6kQONQ0Z0s7Jz3+xfekBAvbfkPYkPW/46ckvf2r/Llsdzh13ETCk/vWgZpsJ4QxedyduyP4LsM6ypUAS5CWESAV+M0w9neUcXChgtf11nOmvCJSKD2647jQ08ChzXuoXJNUVjteaKSqBPZRvjJLB6z3Woo/WaR2EIJBrM05TKR960jIeBhJmT7ZEIVk///H8nC6VrkTLtcYP42gwfw6z07CAXY+aR8rhDeZ+Ocj0g7qsE+pZH5u+LG07QLg8rZPLyY/oV/n82lcVEyAAFGiAjGcXKmpLgjjqjGZVevwR8uw0IB8sDph1bodwYBeFw8ulH0qdQtLW/L0TmC8TV6HUNfGpyvhUnVKQ0WX+77yb9pZhxeygAWZI3o9dkJ0gW+DVOzUcqes7qdnzb6juhHeEHCN9aszIbIm8MeJBvAVyKrXMjqzKAv1m5vjIYtKyED86wk8xd/qZrYEnDMhFZ566xWY988bhSfncgQ/BJoAaTVcU= X-Bogosity: Ham, tests=bogofilter, spamicity=0.014868, 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 --- v3: separate a typo fix to a new patch --- mm/mm_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;