From patchwork Tue Sep 13 19:54:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Berger X-Patchwork-Id: 12975315 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 31C69C54EE9 for ; Tue, 13 Sep 2022 19:58:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BD3C56B0083; Tue, 13 Sep 2022 15:58:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B83196B0085; Tue, 13 Sep 2022 15:58:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9B1F18D0001; Tue, 13 Sep 2022 15:58:21 -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 8C98F6B0083 for ; Tue, 13 Sep 2022 15:58:21 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 6D798A66C8 for ; Tue, 13 Sep 2022 19:58:21 +0000 (UTC) X-FDA: 79908123960.24.948673B Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.50]) by imf23.hostedemail.com (Postfix) with ESMTP id 1C2691400B5 for ; Tue, 13 Sep 2022 19:58:20 +0000 (UTC) Received: by mail-qv1-f50.google.com with SMTP id s13so10080186qvq.10 for ; Tue, 13 Sep 2022 12:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=hB/8CHaP3epa66ZDI7eIxcYHinx9lai7E+SzdR8JK34=; b=DH5wOpdpiHaFFXY8TAT3JRecX64XiPNxiR/CcG1LrVu07Readvn0PWViKgBmDA60Pb UBITk9aWlYro2ikNI4WmLJPOCXwQOqtprdUB0CzoJZ72kknTQx9o/RitCRSffQDxQ5Q6 VTZyKVoIHd28mrFZHIQl9dz1uLmu560sdtEcQWDtP1q9dt0hIGQCuqCTjE9fttuhjONt 0HIT34gX8eS66xaVSIttBxYAN/YQSf5UtfsLj6aZ6r0xFgT3C7geS9uBf8xzXOro8Ch1 QuB8O5yFa+P3URJ5XpTXammfwNsUv1UpGQMU/vjO4KV44uIZqk+ZBhqofvaHP1BLFOQP ilEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=hB/8CHaP3epa66ZDI7eIxcYHinx9lai7E+SzdR8JK34=; b=wd47I37gojnsKsogfl1ScK5sVUse+XfgxrBQPR0rTgMDBxlSknIj041mfy4kxyGc5c 0HWkzWbNRsQ/iFsmYiYNFFVKulXBsAnDJqhIdDuyahfs0hWGQ5kQF0gXJIf5ZXzkqRld 7XS7rln6yaofC1TwF4R755ar3MnWi1ixJJPlCLjuGaME9ZTeYPBPCdpvgAarX7lZdhyT QFD453lIc8pjK/nFVP8Ktd144v3jqZztVW/3GeX6lf96+D/WTr9CU0bk2pu4bdcpPtiI uVOkEiHPy6W3zI1XpZ1qmEFPZ0zbMNH0V42H6TJeU6M3AudloariqR52wsFNphLx824F 66fg== X-Gm-Message-State: ACgBeo2Fog26OF3nbHYJZxDB7KRldK+y4TeF5dBugAn5bRpgQY3LgUVX 15A0v6duGI0sAEjyzF6Mlik= X-Google-Smtp-Source: AA6agR4VzptNv0IdYnihlFGaNyhbElSt3SCLpuN9uI3qoIO24r77G7BDUS/ieSa0RDNa+EBnGiO84g== X-Received: by 2002:a0c:c98a:0:b0:4ac:9f4b:efed with SMTP id b10-20020a0cc98a000000b004ac9f4befedmr14045129qvk.35.1663099100395; Tue, 13 Sep 2022 12:58:20 -0700 (PDT) Received: from stbirv-lnx-3.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id s11-20020a05620a29cb00b006b8e049cf08sm276305qkp.2.2022.09.13.12.58.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Sep 2022 12:58:19 -0700 (PDT) From: Doug Berger To: Andrew Morton Cc: Jonathan Corbet , Rob Herring , Krzysztof Kozlowski , Frank Rowand , Mike Kravetz , Muchun Song , Mike Rapoport , Christoph Hellwig , Marek Szyprowski , Robin Murphy , Borislav Petkov , "Paul E. McKenney" , Neeraj Upadhyay , Randy Dunlap , Damien Le Moal , Doug Berger , Florian Fainelli , David Hildenbrand , Zi Yan , Oscar Salvador , Hari Bathini , Kees Cook , - , KOSAKI Motohiro , Mel Gorman , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mm@kvack.org, iommu@lists.linux.dev Subject: [PATCH 07/21] lib/show_mem.c: display MovableOnly Date: Tue, 13 Sep 2022 12:54:54 -0700 Message-Id: <20220913195508.3511038-8-opendmb@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220913195508.3511038-1-opendmb@gmail.com> References: <20220913195508.3511038-1-opendmb@gmail.com> MIME-Version: 1.0 ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=DH5wOpdp; spf=pass (imf23.hostedemail.com: domain of opendmb@gmail.com designates 209.85.219.50 as permitted sender) smtp.mailfrom=opendmb@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663099101; a=rsa-sha256; cv=none; b=17R68LQ+p2upqsusnvqBt+aoLoiZ0TLsS9C2jNa7vHZBBZoGn4fXgycLFHk7HftDhZUH8D QqOp+HnxPQgT2AZkXxHQJx8qVix0SeTMBoDsxpUbL6lXvmxRR13Lbf7ep/ydB93PkhlTpN jvWfpThefqnTpcBxM5WX24feJRnKvjE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663099101; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=hB/8CHaP3epa66ZDI7eIxcYHinx9lai7E+SzdR8JK34=; b=xQYb7wtY4rJsBmSGV50z3/mK2IeY1jCw21hVtQzLLZaNBT8XhuQb8ImXweMn34NQW/Hbul ayL1AQs+PDNJxQjpW3eA+SjOOMzxeQ61P1e+Vwf/cZ5VdeBU+t96sityYYRrNEUI+VRO3h 29rxtPr5H5CEK8UxQUVhKa9C9dW2EEw= Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=DH5wOpdp; spf=pass (imf23.hostedemail.com: domain of opendmb@gmail.com designates 209.85.219.50 as permitted sender) smtp.mailfrom=opendmb@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam12 X-Stat-Signature: ar1udrnky87iqn6h4jdyidyh7jz1dhex X-Rspamd-Queue-Id: 1C2691400B5 X-Rspam-User: X-HE-Tag: 1663099100-405339 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: The comment for commit c78e93630d15 ("mm: do not walk all of system memory during show_mem") indicates it "also corrects the reporting of HighMem as HighMem/MovableOnly as ZONE_MOVABLE has similar problems to HighMem with respect to lowmem/highmem exhaustion." Presuming the similar problems are with regard to the general exclusion of kernel allocations from either zone, I believe it makes sense to include all ZONE_MOVABLE memory even on systems without HighMem. To the extent that this was the intent of the original commit I have included a "Fixes" tag, but it seems unnecessary to submit to linux-stable. Fixes: c78e93630d15 ("mm: do not walk all of system memory during show_mem") Signed-off-by: Doug Berger --- lib/show_mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/show_mem.c b/lib/show_mem.c index 1c26c14ffbb9..337c870a5e59 100644 --- a/lib/show_mem.c +++ b/lib/show_mem.c @@ -27,7 +27,7 @@ void show_mem(unsigned int filter, nodemask_t *nodemask) total += zone->present_pages; reserved += zone->present_pages - zone_managed_pages(zone); - if (is_highmem_idx(zoneid)) + if (zoneid == ZONE_MOVABLE || is_highmem_idx(zoneid)) highmem += zone->present_pages; } }