From patchwork Sat Jun 15 03:41:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13699222 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 4E5EDC27C4F for ; Sat, 15 Jun 2024 03:54:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CEE346B0273; Fri, 14 Jun 2024 23:47:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 71B216B0270; Fri, 14 Jun 2024 23:47:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D68626B029E; Fri, 14 Jun 2024 23:47:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id C39726B01F7 for ; Fri, 14 Jun 2024 23:42:27 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 359FEA09AB for ; Sat, 15 Jun 2024 03:42:27 +0000 (UTC) X-FDA: 82231725534.29.490F7EE Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) by imf21.hostedemail.com (Postfix) with ESMTP id 782DC1C0006 for ; Sat, 15 Jun 2024 03:42:25 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=YWXbaTKm; spf=pass (imf21.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.172 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=1718422944; 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=0EQi9HkpIlR+FQSo1SP2PNs7ehlOfZJYedHndU4kvKE=; b=AJdh2uhVy8GPvBMM+26i7k1uXgSa4QJY1qaxN3lWWy3YA5YbEVVRwHQhStQYh/vvtenuQl jE8NVBYZIEhxDMJylbVm36o6DWF+gPpkBChiBeKBUkDUwsLUBHmZ2EED99PjKC5nYZNa3P dDJiL1G3toZMDhU4X66SKb7yqfNWHaM= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=YWXbaTKm; spf=pass (imf21.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.172 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=1718422944; a=rsa-sha256; cv=none; b=jjhrtbiyG3U0smtq08XScLMPjSlOvyica80FZoDz8USBVEQiUSbzdPXQ6iHJXCft8CDVeo 7ebTE86CmDtlBomLV4ESBvu7xI9mKeVNp20i9M2l/7/Ctzf/DbY98/HfycW9KjBEvi/Gt3 Lc7qW50l1KWRHDIoZP5w10+uKXvsnJo= Received: by mail-lj1-f172.google.com with SMTP id 38308e7fff4ca-2ec002caf3eso45335381fa.1 for ; Fri, 14 Jun 2024 20:42:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718422942; x=1719027742; darn=kvack.org; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0EQi9HkpIlR+FQSo1SP2PNs7ehlOfZJYedHndU4kvKE=; b=YWXbaTKmoOUBheA9hLUjSga0CdQOsPdJ8E3ZGJgaHaoyq1F/gZ/Kz81YeL8ywr/p/5 Fh8OWGhlmbv1HXQV3TMdoXcUq3Hg85WsxBF3NRLmq3sxYgR8pv6ru6YWP7jrceABNKnn qi4EvmacQC2dfg5dxal6FMiUMq2e04sEb5nYcUERSdThZYoyfkqya82tNJ2EoUUxW470 aG9NrMufWtE1FDg5KC0vmahftddadkA8qXOVwDIOGsZ2P24Y4slGU4RhopxKvIO4+doa l7BgZ0nuyM1Dd8rzYWvTQUcGtnrgXPMC8HfIIjv1bLIR+76if0qAxe0AfFUen4G3notv MoCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718422942; x=1719027742; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0EQi9HkpIlR+FQSo1SP2PNs7ehlOfZJYedHndU4kvKE=; b=v1N4dJKXCflq2vRQ1gfUfVjOarUBJEQyEOgHVvFEQmKI8F23MQLcEmDKvTHEXeMd9F ITWKS667DxvPuM4eQMJm9zvvFIeAhWMx2NWCac2qDbdSBekaSOuq7dh3i2ipWmvljE4o S3/+VLhY7fiW5mon99oKJBmAxcRYZUkTdEJmgPHjRzlAji6B0e8JeUdkxZ9awb0OQGVF Ag3P9aZv7dog4qYoAgeCE5EAFKA/nm67h3itpUuIIcgXDc/S/hM1QdT+DcD6AGdVA3BZ DdzQPIru/VYb7BfCKeJ8bT3STAFj4xSkdVpKt+QDLdchdVHZdmvFR74r04Kn/RcCWLOo KWwA== X-Forwarded-Encrypted: i=1; AJvYcCUKDxZ/CVPdgNThxH0OHPj3yxxeAHI10d3Udek5Egk1Yh7zdg8ET5jgw5t9OPT5GzZuDn2OtkqxJ1f6SWqbV8u46M4= X-Gm-Message-State: AOJu0YxvbMJ01eZyXGKqnszKmQc9gPXRPDMHDJozYbdU7Wani98lrtao RFXMGHMC4OFj7DPtT1CyAmhBB5eYo7vEe8DmHga881K6WrubsXs3 X-Google-Smtp-Source: AGHT+IFXbY2RAAO/9MtUrHF1RcQQWz5yTL6fDcPUXxIQ0TuCTPUX1N9PgGQcVraNcnTO3kwwmAgxtg== X-Received: by 2002:a05:6512:39d1:b0:52c:8449:8f01 with SMTP id 2adb3069b0e04-52ca6e56eedmr4312613e87.12.1718422942115; Fri, 14 Jun 2024 20:42:22 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f56da3f95sm248290166b.35.2024.06.14.20.42.21 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Jun 2024 20:42:21 -0700 (PDT) From: Wei Yang To: richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net Cc: linux-um@lists.infradead.org, linux-mm@kvack.org, Wei Yang , Jeff Dike , Paolo 'Blaisorblade' Giarrusso , Alasdair G Kergon , Andrew Morton , Mike Rapoport , David Hildenbrand Subject: [PATCH v2] um/mm: remove redundant assignment of max_low_pfn Date: Sat, 15 Jun 2024 03:41:50 +0000 Message-Id: <20240615034150.2958-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 782DC1C0006 X-Stat-Signature: a5666nk5xo98itxd5b3zfwk5nredg84k X-HE-Tag: 1718422945-584117 X-HE-Meta: U2FsdGVkX1/TJMyDNum5rCzThAIvGa33ssN2M4PCl6t1Xaz1IOhVNtdvOrTclRsRZkaKzH7oAJE1bi3zbuQDRk+yu2jNifC8omwzlUcUBRShFAnjEqOiG8A93dMh7O6uia9u29aNRZpXYeHVYst5jit0bakIcL5fQQ8CabZvHUERyly6OrEqR96JiNj3DpJfvn7KW0DQg8tfB3LZKvCy+qXOj43weSauSav+bXkIRgc3czd9pUHs4gyQV56c+NPa85xBB9xOMLxeMvSAwemoBFzSIBwJ68qSJqmhtYpTtm2AsgofgFXl8hEuHlg+OCsb7pELwDk840SgWczWKdxjzkHQEvZbv4wtOFUx4t1oi/rKd/DMEuoAPZIbWRvWHVQuNl3P4RfoZp8D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Iip2CerFqZBCJj6oype4/zBRBgelzXko4lVPIE1/lEk8O8mPTZb2ufDK+Otlk9TV8pvKSe4y2QWneL1sFqNW2lwmvUpkQOiUdXPHZdLReS7j1w3Wy0TxKAKs5aNDOW7MuRwQR3Kc60qh4Vxg== 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: Current calculation of max_low_pfn is introduced in commit af84eab20891 ("[PATCH] uml: fix LVM crash"). It is intended to set max_low_pfn to the same value as max_pfn. But I am not sure why the max_pfn is set to totalram_pages, which represents the number of usable pages in system instead of an absolute page frame number. (The change history stops there.) While we have already calculate it in setup_physmem(), so not necessary to do it again. Also this would help changing totalram_pages accounting, since we plan to move the accounting into __free_pages_core(). With this change, totalram_pages may not represent the total usable pages at this point, since some pages would be deferred initialized. Signed-off-by: Wei Yang CC: Jeff Dike Cc: Paolo 'Blaisorblade' Giarrusso Cc: Alasdair G Kergon CC: Andrew Morton CC: Mike Rapoport (IBM) CC: David Hildenbrand Acked-by: Mike Rapoport (IBM) --- v2: remove redundant assignment of max_low_pfn --- arch/um/kernel/mem.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index ca91accd64fc..a5b4fe2ad931 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c @@ -73,7 +73,6 @@ void __init mem_init(void) /* this will put all low memory onto the freelists */ memblock_free_all(); - max_low_pfn = totalram_pages(); max_pfn = max_low_pfn; kmalloc_ok = 1; }