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; From patchwork Fri May 24 01:19:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13672596 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 C13F0C25B7D for ; Fri, 24 May 2024 01:19:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 53FDC6B0088; Thu, 23 May 2024 21:19:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4EFEE6B0089; Thu, 23 May 2024 21:19:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 342CC6B008A; Thu, 23 May 2024 21:19:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 1AA316B0088 for ; Thu, 23 May 2024 21:19:59 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id A4A461A079C for ; Fri, 24 May 2024 01:19:58 +0000 (UTC) X-FDA: 82151532876.19.932DFDB Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by imf05.hostedemail.com (Postfix) with ESMTP id E1D40100004 for ; Fri, 24 May 2024 01:19:56 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=JZledHIr; dmarc=pass (policy=none) header.from=gmail.com; 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1716513597; 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=FNesrGATKjmPEqLF6zpWK3gQHuPBFi2NmwUNgqu1dosU8wKWogaYZeyqOQltLwyQH2L08U SOpsbq8rQ67KwR/Sjdqh//6x7OgFuc6H3LSWR/YEiX9CDLvYG1MNp4m6TU5b8J1gJfNQCT NBMw5F21nVkXyPPHr7N1cPW/DKs/Qgs= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=JZledHIr; dmarc=pass (policy=none) header.from=gmail.com; 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716513597; a=rsa-sha256; cv=none; b=KhqvlAuDS+F22aA8vW6z1ozZfZ2sdluSgNOWXEp9/U7GOqu8Hnxk3GfTMsmpWlaHCSzh5Q rB2Xeeg3iBNuseek6QDIejb/gzGx0podMuQde5mJ3WvfJFwhnxw6ve8gohN27mGZKaCis8 WQy644UsqlTY40HdvmbmatjE1yF/XpM= Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a6265d3c488so36828766b.0 for ; Thu, 23 May 2024 18:19:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716513595; x=1717118395; 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=JZledHIrPB4KEftU5eY2ze5PKdfsvBA2sp8fIFi1k4oGVea9LB6RyJ2bLQYkNFzvYK jlD8RLFSGR1dFiQOs5cSloN7Nd/8RiYRo1VBNulipUkQFdKR3bQ5EDjk1eg5uNPmHmC8 VIMFI/lUztFRY/d6wtcicseNMLmc3EaJKX7rM9XNAq32j+9GQlF8Dx1PgglBA0vNifW9 wIL3qXWZ4hCOZ7of/VctcNix0qWWaAF0MgTqSSK9moe7iYRyrzwo7LF+w2hjK98Kadxi AY2dAUuOcN/joe8UUvqBSTAppF3GIzi0cq6cCIChEt8MY7T2eGE8h6tK24GcS/jScEuG imPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716513595; x=1717118395; 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=KSW0efwjDa4dajXwougLiC9Vfk6LuiwnBuef8LxW0Puoxu/sUaoTdszoTcWIDvicbV 9/6i179nQg0ze1Gwegl/GOEkfmzelbCCnbLv9/0FUQhbZcSJjKpLixo8q3pFxo+TYTdc GRTkzEE9GNyOg0LRYBBE+VIVYzZyRmCd/cLtSIuK5iFXb0h4hd0NVJilVi/NI0vVbQTl g9+JX25n9xeUzVxVnsHSwSPV7aXpm2LSrzbyrTKoQuQ8X6RTQQzWF+TPsOoiZvHRhLDv +bHMYaAeBSazM7PZWeDiv17X7dR5pm2Wc1vxDYqi7mDOozsFu7fHTY0s73O4H/XryGv6 K5mA== X-Gm-Message-State: AOJu0Yx2AcKSVBwj5XA5PaM7yQ2qh3j4EQloG37arxuUfj9GVgAK86mk JqUSeDV+ST5X8N4UtAPQ73Oc2v0CExwcJYFyNiTnnvvD8L5o2QWP X-Google-Smtp-Source: AGHT+IFKbueZjSjEkXgxFW7vMAJm3F9SqcaLOcM1LN4xUp3vUWaA5A3pAhNhyFm+hDYwCgtd61c5pA== X-Received: by 2002:a17:906:f18a:b0:a59:edbc:193d with SMTP id a640c23a62f3a-a6265119d6amr72613566b.55.1716513595350; Thu, 23 May 2024 18:19:55 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626cc519a2sm38338566b.126.2024.05.23.18.19.54 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2024 18:19:54 -0700 (PDT) From: Wei Yang To: rppt@kernel.org, akpm@linux-foundation.org Cc: linux-mm@kvack.org, Wei Yang Subject: [Patch v2 2/2] mm/mm_init.c: move nr_initialised reset down a bit Date: Fri, 24 May 2024 01:19:14 +0000 Message-Id: <20240524011914.27854-2-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20240524011914.27854-1-richard.weiyang@gmail.com> References: <20240524011914.27854-1-richard.weiyang@gmail.com> X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: E1D40100004 X-Stat-Signature: 6nm8fgydpnhque9bn8paib7beuqznuxi X-HE-Tag: 1716513596-798276 X-HE-Meta: U2FsdGVkX1/mEIidS3ghsASOMdBZDc29k4N8t9CkGWZHY71U8SKUSxqtmA8iAwNDg40/PezU42JbqbWV3IOOz2M91LykbsO5wW5GPYZyhZjlIE3zgIAsZGnvPAv3lbcJygKyfZWsYX4Yxh7c3bKeajAJfT5VF4tX0yFc2y6Lu1RU/HkfDNPEaS5MGNO78/dWW0JGVq+dYILxPGr+0kYWGm/WAvc/mBhdox3iv/DFmAoTPIF1Wlk7IVvHiD34xzkUCan/wNAAobmKNKM8AkXlCrLm5403EiugLor0Bin0qoJ/kxzT0QeoseomI+NBN91v8a84kBSv4P4WtGwD+94xrqkyH9IiQ0H3FLMv/c8EOpPhCsz1wxskcM9Kku+ZOpW1gSTeMVJbX24Q5km4RaikTr+NXQRe4bqI95f+QZW7WY3SSKAloGWn5ZSjOJh+m7MUDH5lWBs+QNc8Uli8GE0LAVfrH6hhEKBpgd1uSxhTBlH2XJZwCEZPy2RPETJfeIJCMMUlqBBh0T2cFU1d6+IetaABvp9C+As9u/iENu1YkxNCQt5JsWq3fR89XxoNvcx4qFy2ybJKLxlPxSOqRHRIgq94NXuJfpYirAl7+utFdCDNw1wukaT8d1iiBo0KzMHXdU6ux5rdXnI1AfBKrjqSPDxMq228NwEwMRxoVGlJFkDVedQxvFg3za+t70ZFm/jUTXIEv93wwtI1Hq5KRkmGe8Po+Km4JkfVYztM8/lnXT5uPWomJUsTDMTS1AlpWHPlIVCf5Z9dwY37B4cUdmaecQ8+gPKQtLbdFAylj5cwbs6aX0QkZ35RMxcXDZw85OE1rFKbq6S2mBsAqzAtUJUKo2ENBvtAW22aVSJn0My35DbRMOB67gdD97tG02TmvHpvKH7voZ+I13uQzfTT+xG5HC+RShU3zGrZox8qChzO77fxg7I4w2VB5O74Rq4ok54tLfkNCYYfsVIguuonslp eSGOySXx yXhNrcRWNT1O0meRK2YmybBhGrtxypmlaNivT2pTRZMkhjbCnXvxsLkIsLJY1fmkfZ/Vl2qaTqR6c9Aq6XLXmQPxeCgzS6PnDZoMRoWDz7orhLrYL+XoQmtbYH5A/ZTZPWFZEQI1KKaQWwEbIikZPqywuOys3+doRouEEIJZpAZ4lnvGLYDB+pNBv9mrnFsO496xVILDouGPfGEUXHe7I8I1wb69F5GWtstYXDZEwDMoTKvGa8lsHVxTqPmhLkcBQfuDFWxWdAOG/tnEnd5RnmxJI/ZHLkaMeVwfYxk+Vk//QqSt2sUk0so7x75yB/CfG/uOB48O7fUqEwuzhx0WOT/ucdF44CpKQOhXhWkyeACUqJWoOwxY/fgPqG54+7deIAe8mQ1Z+hnly23CCXYbXbL+BwPyzzG0TKXx2fKv0gE35xfXn9aezyNZLnJ5PTtYvaRFi0DTHfCkXu+nYg2hTf64KwMl4Mh8/povEH1qgfnq6yD+v3JE0a9k7WHsHQQI0nrFo30W4QC4EJGCkkba0+qHvV/XvQ9Ap+cBDtnl8ScSyNrJlx+AlungM+Tn+Z+efCjVuppo4syp37R2D92B9I05NCw== 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.