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; From patchwork Sat May 25 02:30:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13673885 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 5A21EC25B74 for ; Sat, 25 May 2024 02:31:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DCBF76B0089; Fri, 24 May 2024 22:31:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D7C456B008A; Fri, 24 May 2024 22:31:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C43626B008C; Fri, 24 May 2024 22:31:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id A3F686B0089 for ; Fri, 24 May 2024 22:31:00 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 2B5F940AAB for ; Sat, 25 May 2024 02:31:00 +0000 (UTC) X-FDA: 82155340680.26.1D12FE7 Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) by imf08.hostedemail.com (Postfix) with ESMTP id 74328160006 for ; Sat, 25 May 2024 02:30:58 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=AJua3jGq; spf=pass (imf08.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.47 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=1716604258; 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=vTSApDSuReDswZZHXeH91sYJzstt2lgSb9TJ51B5WsQ=; b=g9IBGFOBxHC6KDP0BwhpqOCW4715rWRg4/KmHmMr8SD1L04Jgwzg/35GnqFtX045k9PNJ2 GUCjJq3AG0x8Zm7Q3RhktWcJjLzDMWIrYIdt7Ot0Df7V9oXC8MxeJZuVwA3rGvtPuqm1Jw OU+SDkCPNYUUaaPLHjItnZXc6GdJ2SQ= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=AJua3jGq; spf=pass (imf08.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.47 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=1716604258; a=rsa-sha256; cv=none; b=HrkomTwAl98Uwh2nuSwjfjtrr+JxCzJlczy6vJ9dsiU0VSkhjBee/P8PDGUZryRjEvyQ8S bRl4cCdzwFiGSXrzFikzJKGa9ZxppQ2YTDi/qGNzQXd3YpiLVSPOiG8MfwdCHa7AHsSfLw Spy7tIW8f8Iu6SM93j83D4Kev1o+QfE= Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-57822392a0dso6409422a12.0 for ; Fri, 24 May 2024 19:30:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716604257; x=1717209057; 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=vTSApDSuReDswZZHXeH91sYJzstt2lgSb9TJ51B5WsQ=; b=AJua3jGqnnAQF/+7hHnBI4jVnVypPpwVG5lDp7ZyQi8swy9ZYdqZmArpvL+AVaf8Ry QtChSGZ5ph6m8Ozj5MrGI6CUTURYOVrRuVCz4hZ3SyZquzSxoPHkkRrQPxxjBxEpQncL 1hyGNtvjImTdxKq1v8/9anWWghmpSO/8484Nvp/c2HROpzzto1DA9ZJ6Lz1WxR2Ow1uQ /EkfiGTl5iHl2lZCKedfmPbw6lZlS21IAtY78vw9C/uBS2NCcQLGOcX0j+DF5y3MZDp4 bmGOnDv/ozpaZio+8O6fbrC6x8uR+YmkuLj4Kzn7oamsNnPBlPfLCYrJRwY04Oyz1b40 riTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716604257; x=1717209057; 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=vTSApDSuReDswZZHXeH91sYJzstt2lgSb9TJ51B5WsQ=; b=QRxX0WcNfBUt/pU0RR5MsSzeixgJeU5exECxH2cOgx/HzTrb3yiI2qPx99Z355vjFF GQPLcO7IiPVJShzJyfA1HU/C/KZfGJUZAZkI8Y+Nhw1uU/j71TbTW881MVzB2Qh7U4ai MU5bjqRDnDf8H4PrtEi8yWePbHobrtp7Pbkcd0RVoWA4pCi4Owax+aiAyBBbHeENM2J/ BaGJhnIRKO1OfT1EmBv0JVyXkY2mCbi8WTvXyT75XzL6pLf1S5n2Ts0qjXf79xV8Sxc1 LSBZtKfcULSSLng6j0mEzW99GtWD+bEYlJl1LdSbhzt5VdIrpDNU+0RvnULYq+NiWJ7t natw== X-Gm-Message-State: AOJu0Yz4UICsROYYSk/LMRQ6rqdVYhX6UZN4G8n4rFtCYy9vNRx+ynlC iMHjVdiWtK7F5RjeBPSobhx2r84fLgZkcErg8dz4YTLQ0a4X1G8ueeZOAg== X-Google-Smtp-Source: AGHT+IFdIy6vIbMxKLhJK381kslcjg0UIsZQajrUDBPSCBoXZ8x6xAPQGQzsxgl4Xv61ni9hcdXAbQ== X-Received: by 2002:a17:906:3111:b0:a59:a83b:d43d with SMTP id a640c23a62f3a-a62641a5506mr213371266b.16.1716604256655; Fri, 24 May 2024 19:30:56 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626c93a828sm203470166b.83.2024.05.24.19.30.55 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 May 2024 19:30:56 -0700 (PDT) From: Wei Yang To: rppt@kernel.org, akpm@linux-foundation.org Cc: linux-mm@kvack.org, Wei Yang Subject: [Patch v3 2/3] mm/memblock: fix a typo of for_each_mem_region() Date: Sat, 25 May 2024 02:30:39 +0000 Message-Id: <20240525023040.13509-2-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20240525023040.13509-1-richard.weiyang@gmail.com> References: <20240525023040.13509-1-richard.weiyang@gmail.com> X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 74328160006 X-Stat-Signature: dbi4or6jd4ost8skwcoa5mintnefuq3b X-HE-Tag: 1716604258-389537 X-HE-Meta: U2FsdGVkX1/PNlsOeHu9v8lDJkPPjQZF+xNSOTWAj9Fwk34GMJz6ArX0GeP7D6jPXxUd34rS3J4nkjuY23COC2fZxGTeAYKwdGTY16KL48dzjkbmgUcLcDtShpxUu39o/vv0thDt/c5f10Bu4dNN4ALfuGJIelLg2o6DTQcypARilsnesXuhe1rRv2DGuSM2ya6juaodnFZfYnOGEQkLqopNdfnTS0ZSmVBnpy2oGWmDU/eKHg+Wb4sZl0yNV0TrA8adKDBFGiGWiBJ2wkUUcMo4l96gIopWO+HVBALAGpzkxf7KutkHUXLhY3DNZfKIYU7JdokhBo6I0PzQD5O2I+jqMEiuKDG1Ewe8eIwR36MHbZ1zt8S5Sjn9aMVFqJQu/JtpeW3tWHC4iQhDBebC7jBpllCSeETTaL6etwtizuwE/pEfX9klyElvUaOYF7P+U5gWScK6KZw0bloJ5ab5gdeObEpZFg0Pqa6kYciUfT+QnWO+RuTi2C9lVAqE6zlVHqo4czIefL0Ey/zia3bH3pwcDIiX0pi4Z7Lj+mahBokqqUo/ppb26vGUYWTnQqAwkrzt+G6SbhMUtawRCuY8nnt+Wy0+0koYu+ENsbA29iDpdcUH66SWGEC9EGsAh/1wxQYmwAK8B2Eu/aKerm0UJV50JVlsYkzlcYhWwRybmvjla1ezqa9om9RFSJ8qo62jWQtQ6gxoKKKWSRZu2SpmGKnfB7harIefN65/BzPRkAmQbVWwEANIUWRSDIQ2jSEDjkU/KcFJ06mJ5w2uBpmr/42+uwd7k8XFKMpl/8l7xsr2Myw0P+V/QjWMkVX1mA+W4Wkck4VYbTluejmNZWRj3bJ3MJl2Y/SgfRCQLULy8f268wbFwRbD5CHllB2GerIiYICdz1fAlNVr+0H5j7dGM/ADo6mDbP2pPCKdScDOki6bIZ7pQ7tccSrnfDVyTraQBP9A6EYpyuzwqj8hhc8 ANW72oy/ +/CJsTjoAWcf5ZmzF01vX06WQ6eTXjyqFdLrZbgmQHQfYgTpWOR3G7YOB9I+D6xV2qbrqxyVWSFWJ/Vpi42iFekWbSA2pPIH9Gjc+waHbUIgW8b/VX9KZUuuT367QPtNkKZ/y7oCWAMfITFsRLBvNq8LVegNq3XGhKTD1lDCOfQlHIuymv/jPhDlQ0/ZoWerEdq6zwSz1ELJO8hGvyXYdpmfamRKuaNeqrgazcfvCJeiwRapk14p/qTqkL4u71Zruk27/YroWJ8M4cYaUXt1kuOlm2mxzM2h4nYwzTFvCu3cP95CVZIrfQuf/ake7Gcpr1INpkdxk44TgX/n2WivgfhwW05fwfp922VC3SOc0YuCzwdhEfTUy4cI0Pqwo8zas9bZvmZ1xBzWqb1P8p6Il4o7XYWUzXon5oRjf/u+rLnu7GYyLVOEAUN45Oka0mPo/vVJmUsJmppYmbOnMXQcP9ehDQ3Eji6EEmV+f/0RH/PgLDpfelDqFj/4neRrb6U1gTq4Y4HTHlw8Ac+VqGotCiarV8F3mqBTHgxNtR2xcoifxL3A= X-Bogosity: Ham, tests=bogofilter, spamicity=0.001070, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: No functional change. Signed-off-by: Wei Yang --- include/linux/memblock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) \ From patchwork Sat May 25 02:30:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13673886 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 8BE62C25B74 for ; Sat, 25 May 2024 02:31:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0AD046B008C; Fri, 24 May 2024 22:31:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 05D166B0092; Fri, 24 May 2024 22:31:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E3F5D6B0093; Fri, 24 May 2024 22:31:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id C13326B008C for ; Fri, 24 May 2024 22:31:04 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 4D1F61C1891 for ; Sat, 25 May 2024 02:31:04 +0000 (UTC) X-FDA: 82155340848.15.60523FE Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by imf05.hostedemail.com (Postfix) with ESMTP id 6CC4B100006 for ; Sat, 25 May 2024 02:31:02 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=SvIKzWNK; spf=pass (imf05.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.54 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=1716604262; 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=FiBCELuE62C2faXPcJ+beB9jxHLe1JTI96VohTYJ0eA=; b=I9FbbZ1FU64dABrx+0L/mSDiylUIwy5PbZeu+KGQjYTuDSCKUXES8LMd7on4ZU0d42YqvL jUkZA8r3K3bIewBSz2wEno/PiSPFAHgRoryZWgwqzDUn75JnEHqkVOcxCqLJ0vbgyT6v0q Wf178V0QrTvpbMIcRUjiFENsx4/IYNA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716604262; a=rsa-sha256; cv=none; b=lEidH4YdpYZMiPoYzah0ZVGaDHMfYJ6HJnzL7Je6Pkj9dZi3r0ZxjyFmYtCtlWSUbsbejB ct/vvPYo9KtfPwxY0UwT5MEAAbGjD3djy0zQvpllIr9jxKvlNEUkDNknJYKAJs7oX6g++h WwBRSedI8trttOyKvtNHIqbLekSZbHc= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=SvIKzWNK; spf=pass (imf05.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.54 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a5dcb5a0db4so881730666b.2 for ; Fri, 24 May 2024 19:31:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716604261; x=1717209061; 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=FiBCELuE62C2faXPcJ+beB9jxHLe1JTI96VohTYJ0eA=; b=SvIKzWNKyDAbVHawAPPhsjcbxPCkzfGzgIq+ARQ1AYF0NOCLK2ALVDP57EBh3seJbt 4VCtsJwmYaRBABOesl8BJYEgTn/raHhOkYdCJ3ub4x0JXhhbKD5n5zTDfXzF/QaoRJ/+ 0IjtQ5jQH8zQRiLiZokC6nz4DYFGnBnxgTohzOOiCE+tgnrUblqNtwXE4yt3SeyaME85 Cz+ahfuYHe56O9Dc750tOlOh4J5DfZEjWjujtEyMbWqQBKQ49oZ+BI6Ns8eeaCag9/XU BRjY2GCPjKiG0ExQG58T9dGL+ieXAkEZJpppO9ISHQ6YiS60zaUPD2HReDkWpcYqReJO kIKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716604261; x=1717209061; 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=FiBCELuE62C2faXPcJ+beB9jxHLe1JTI96VohTYJ0eA=; b=QA8LlOmJwax/kUj1ogX762X6/ZbUBhCrZ8bfnVGvcVztulceT9tKZSDjQbzs634RNv 9ffXBUl2AMA9nsXFfmIZXCk0lX/Rl0QIHg+92wb1wn3DIRf8tjDlwsMMiilHqA6Gx7JT vjwNM2l8zqMRGsnPsz2NGqjG4Dc/e7Mqbgo9NkUiKofNYViT/5y81LSaFX+NWSi+AE5+ h7a7MGrEkAWAxy2swxOFzNZ4IZ5ZxBbqGtLYid4JS+NDvxPuzqU6VT9KGsgRVItS2oT9 VktvoGAt2G+mlmYgNkIU1vb8HvzcxCoXF2BkztGjXq1ji7nbgLCNgEVLOfmVgYbLE1wC DjxA== X-Gm-Message-State: AOJu0YzLiYxXC/umNKJwbE+nZrsUryX5tObhmOaE6zJpzb1iD1olhssf EbFNMi+GB1mj9wVP3QsWllwp1T0eBMx4atX/iLnpsrTGcsUbxRLssjlIrw== X-Google-Smtp-Source: AGHT+IH/CzPBWmgzhHi/RKf2klij+na6TNhXVsLZT/2bL4q5IUEkph/I9m1D7HtgD6csXjwRXW5OaA== X-Received: by 2002:a17:907:f90:b0:a59:ad6d:26e2 with SMTP id a640c23a62f3a-a62641deb55mr241220166b.22.1716604260646; Fri, 24 May 2024 19:31:00 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626c818139sm205376166b.35.2024.05.24.19.30.59 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 May 2024 19:31:00 -0700 (PDT) From: Wei Yang To: rppt@kernel.org, akpm@linux-foundation.org Cc: linux-mm@kvack.org, Wei Yang Subject: [Patch v3 3/3] mm/mm_init.c: move nr_initialised reset down a bit Date: Sat, 25 May 2024 02:30:40 +0000 Message-Id: <20240525023040.13509-3-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20240525023040.13509-1-richard.weiyang@gmail.com> References: <20240525023040.13509-1-richard.weiyang@gmail.com> X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 6CC4B100006 X-Rspam-User: X-Stat-Signature: pbuda7bkwxxfnfimej63ubp94q6dizr8 X-HE-Tag: 1716604262-689231 X-HE-Meta: U2FsdGVkX19brASStdYRkrDIa2eNJ6iALDWuWxxOQsxvkAR9P9F1ntmdmHYEx9TPW5yG0tZEUdmc7BUtSnOyz7N7GbCm3YsPerNHkkydKOsZ6MA/HeEq+FV3MH1nDgy4vgEHDH7Nv0gVyjQlTH6zWAYLsQrcmODq4IGodITzWX4Aqo/FaEaq9cYVELFDpgPx0NhFrCJefHbJEq2kx2h447eWAghTf094ArcFQuIzv78ocxgVSvrmP5nX2s5R1BCiQYDCkrID0Sqhwykz2auJqf+nCRWdOv+lEXTtIN5VbPmbpKCxnZX7wVZSipCEO9Wc5ZAtzVfQtlzPTrYlZIIz4dhIEVzAZ+lPxhHtGd0p01NmwPigAXCBnnZA2ofDThgk8XRj+5aw6W1NZNSa1lfLVesv2fnTNOVCXBO2txycX/wlOJGtHAUq0RD/Ylu0x49RQpsa5PD9HCdYDrad0w70py6XoPpDHoyaDOP73vepaWEu/9m8de8D+pamRDlE/af14sT2A1iTSvUOaYOtMSFOtHCBpliJNpdtdatqpNNRPBa3ekrBBMeZO8bAJxiBPa2fil/QHpKlSQVZ+I6I8wJiqKsz74PnTgDP5WQNVajQsr+3rNwKXCk+0AJwjuh8oPGmI/KJUG/kYL9fW+vCAqsHqHlsVYrmwWTL5s/r+mf+vgrMWN3RsuuixAgVsTIVT7PrAH2Yhu5xGr+wcQsTRqLoBT7UPHhbdElr/NpJqyNiXss+uZEywig3sEkjbQZTye7lOPRYM/HSxW+jlZv9xNaZAF2fHKNS71KmdlFBTLD75cjMVgsSGeIBhp7B27JgZqHzBI9YMDnjl3SPhHzGthI4+J7gUXEO87JxMz+e6+FYQteYawlfUKEUp6RG3yAQDCDohjDFHy9iBcncrKCWvlUtTECbXtK1q0Y6IKvpFw3iQ8/LQMpVWUhGFLkchkpeI/DgOH9+aHEQITBp2yCTR3Q 87b5k5fw GH+WSq8qrZzzH87QK6Pw3EuZ+MuSqJU7tN4nd78nx2MVmln68tVDX2v33/Bm1KS5dx9/zr7ucyl1yUfZczo1y8kd0c7mz8rkFk4gLlpP6Rz6l5a1yOHDUDRgx5yrcxpXguCZA1s8G48YJ9WYwGK95uHR5P7LBcXYdf1rvpZMmN4YRdIB3Svm6cwJYHXUSJ7zt1k2SfHiouns0HURmFAGW+5c36asef37gTA90WrNMFLDu37bmQPd5LDo4/rqyCmveagpQVZUeAOH3ZcynYdD+v/JfveqZhidp5XsrP3njhKtjOcKZVSkDDK0ChpBNFbjSCWz2FeobL4c2CPo+ofzrXEz0IE0KYQwhr9VcBifbsZnrsoFToDwcD/qKwY6y97ziJL8dxAnMNGrrPZsdbp48L6y4DrFOxy+yWhYJt99vnBbGwTSn3ce1G+tBgGg1TDHc0StjZxhjQ8EWLaX3kfwc14NBqW+s+nM+Aj9aCQ0MghnXwwjpWXbowbTiDHGQWaLIPtZV097j+pnU1QXcW7rdVIF8MdvpFYqc9cB76KOBmv2zNx4k54WYflVB0pLtth8Dfa7Hd6GgLFm+yn/yFThgxMoSRw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: We don't need to count nr_initialised in two cases: * for low zones we always populate it * after first_deferred_pfn is detected Let's move the nr_initialised reset down a bit to reduce some comparison of prev_end_pfn and end_pfn. Signed-off-by: Wei Yang --- v2: move it after first_deferred_pfn is detected per rppt's comment --- mm/mm_init.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/mm/mm_init.c b/mm/mm_init.c index 2dfb87841fdb..bdbd800b0436 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -676,6 +676,14 @@ 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; + + if (NODE_DATA(nid)->first_deferred_pfn != ULONG_MAX) + return true; + /* * 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,12 +693,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; /* * We start only with one section of pages, more pages are added as * needed until the rest of deferred pages are initialized.