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: 1948148 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=v/hS2I+K; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=En+kPuhW; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W1MRG6H5hz20Wb for ; Sat, 15 Jun 2024 13:42:34 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc: To:From:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=0EQi9HkpIlR+FQSo1SP2PNs7ehlOfZJYedHndU4kvKE=; b=v/hS2I+KtX7XSP9rDIiCtFEC2r bBX9cwk0YVbl82t8CAXqR9TQSd7c3cB67x+Fkxw50kj+BZP5rTCAA0snYmEFdyyOHD60OCE3EB+cu 3RpeRMbuLuWDy8/7UosJmEnANsigLUtaEDs1FFhpmhJ7vugqaFpX9M34FM09e7ogRDiderYrie9TX ccKN85rZsFXtUQzIhrNgfOY3ye0AYpXU5sBccNfjvKgyslHiTW3HY8y1BOKI7Q1azxvv7clkp5Vgp Z+qXe1kanUsHLe9nvn6ns03eN4ItlFwWMnDlWhiFcmkxObLBk8ODBZdLcR7ChJeAeDqaq/0mO74JF dETIMSUA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIKJE-00000004b2s-1qtx; Sat, 15 Jun 2024 03:42:32 +0000 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIKJA-00000004b26-3b7O for linux-um@lists.infradead.org; Sat, 15 Jun 2024 03:42:30 +0000 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-52bc27cfb14so3674050e87.0 for ; Fri, 14 Jun 2024 20:42:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718422942; x=1719027742; darn=lists.infradead.org; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0EQi9HkpIlR+FQSo1SP2PNs7ehlOfZJYedHndU4kvKE=; b=En+kPuhWw6jjhhqiNQxF7h73qLIla6+sgvMMVqaN2PK+eIH0tOl8FVYq8acM6PekjZ y1f0cS9UkM6tI9YuLzTjix1UYJuh3RrCz5fcNE3IcOl8dA16kB2bvVq4IBZ9mPC/rbhX 9ojHRoPY1fseQteEVdLDCIgyp63QsnmR52dCiBeV+bNL5s3xAl41ytiSV4OiAugN8SPs qjaB5Sg5oiL10P+KxcKM7FUlzHtwt/jqBD99Dc74Qz6VEVamEoP5shmcGmmKNG8tKAhh 39M/zD2Gg9Eb5XICDVpBCc7eVSmWy6Od4nG03G5OATiGurF5lMc4WNro5mx0KBSpwXdi UhPg== 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=FyXQVXF5T5VSV1cvNn+/Q3sLBMsagetCYFjgUWrY9E3GopNJRLxfaPaF7hmRbcQcC3 RWWCBh5M5kSRsU+4qe2j+FohNnhT6JsU4wJun0cYVvr+bg4NAI60eGypYCfltG9U5mAc JvP32ZJ0TvSneoRWW7MwjEJbDfbAPI+hTbAvvjCXMIXbcnJoUlbtIJRsX1JdG7ooae9F VjbnadllhWLA+SROIwYx9p96kXd76rMmKvNHrTSy600dNSSrs1M8SgxL2fXxxZjhU99E O4V0RGVW1bY4zqffTxoCRSvF6Ut+4xYvwU3IV7VZS1fYFA1PfO3LVJRvfP74PhWQGr54 TN/Q== X-Gm-Message-State: AOJu0Yxdv94L9LAQLlLLh8w725TD3CG+pn6g+GgEL6+Iqs18nJw6tjbL TPABUFk9j8xJvxTKaWhWjePpRjP1Cw4+PRYGMJUyc6wquo7qMM5B 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240614_204228_925666_4DD96084 X-CRM114-Status: GOOD ( 13.55 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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.) Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [richard.weiyang(at)gmail.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:12e listed in] [list.dnswl.org] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-um" Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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; }