From patchwork Thu Oct 20 21:53:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Berger X-Patchwork-Id: 13014048 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 DAA8EC4332F for ; Thu, 20 Oct 2022 21:54:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 84C1E8E0005; Thu, 20 Oct 2022 17:54:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7FA258E0001; Thu, 20 Oct 2022 17:54:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 69C0A8E0005; Thu, 20 Oct 2022 17:54:25 -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 5C2AD8E0001 for ; Thu, 20 Oct 2022 17:54:25 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 1268AABB53 for ; Thu, 20 Oct 2022 21:54:25 +0000 (UTC) X-FDA: 80042682090.05.8496E36 Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) by imf22.hostedemail.com (Postfix) with ESMTP id BDAEBC0032 for ; Thu, 20 Oct 2022 21:54:24 +0000 (UTC) Received: by mail-qk1-f176.google.com with SMTP id d13so881442qko.5 for ; Thu, 20 Oct 2022 14:54:24 -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 :message-id:reply-to; bh=BwP9OSSuHG+apHyoqkPAJ44LToseDE0HSDpJZDk5eXs=; b=jNUUsRnWlXrm8JAnuE1Xqa7UyLQ1Ntt7WFErGDBLV2vutQLJ0PQilqL0HL16ioBgaH tfq5WvKTPdO/dJLDa7W8VLb0/wS9gfOFZuMY8jvjjuPVKNIMwy9MVx/MirO3GfRRjL9n LupI3gDdDDnJkGpBaXNyK+SWatGDer0WWzVHCbIfQnp6CFkOKk6e3uHHKYH1dhv9aKUc UA3llhu3zx7UqBkZYqKQEWHaDgpLD1LksEfySU/2dYYUbXhzmBK7FSG2uF/2KLWhBZ9W k2/WpZe9yLC3nkSo4WQVXGo12b2hpsTKZzBu5axXXMLlcPqhKB9lAMVFlgQgm+2vH3RB pXgA== 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:message-id:reply-to; bh=BwP9OSSuHG+apHyoqkPAJ44LToseDE0HSDpJZDk5eXs=; b=5r08MTJ8TqFSI9r0fYLN4r+YpOkK5r38+5jrTKUQPE6j7yga9Peg43O88Pyk/s71fY +4pcPwtAqOvG85ZWu2i9IGxdFkmov3xOroVuaAkZU4Ibt6MEIbLVh/ELg69XGeDWo8fx Ago6iEtCoqEN1BdTt/mxeEByYhsUe96ddrPS3ubqGAPHB7IzwGKrWMIvP2maF+PCyils 2kNFJOlBr0G2KZHKnKbhGfz3wYSV2EtfghJdApp3Nd0q1ky4oWKnCdm/EcqAvUypzZLN QfFtDEHYdLSjc9aehzxfRpylK2mMhIIUr7vCYNMzxcRcotmkr1WnY8a2dVFKMGyfj5i2 MDpA== X-Gm-Message-State: ACrzQf3ecwukXZT0zLvDRyuVj7s9KKql2JF/DhzmUToMXmmI2M12mC7f 30Y10txXgbyhUpR/bS3VUGg= X-Google-Smtp-Source: AMsMyM6u0RdH/aVAaBL4k+8UrNNclWICnDFcnMRVg2Itkr/PEI6FjGGL8fVEwkAtL7Q/FgTRKalRDQ== X-Received: by 2002:a05:620a:150b:b0:6ee:8d04:f70 with SMTP id i11-20020a05620a150b00b006ee8d040f70mr11428999qkk.101.1666302864030; Thu, 20 Oct 2022 14:54:24 -0700 (PDT) Received: from stbirv-lnx-3.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id bj41-20020a05620a192900b006bb29d932e1sm8121067qkb.105.2022.10.20.14.54.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 14:54:23 -0700 (PDT) From: Doug Berger To: Andrew Morton Cc: Jonathan Corbet , Mike Rapoport , Borislav Petkov , "Paul E. McKenney" , Neeraj Upadhyay , Randy Dunlap , Damien Le Moal , Muchun Song , Vlastimil Babka , Johannes Weiner , Michal Hocko , KOSAKI Motohiro , Mel Gorman , Mike Kravetz , Florian Fainelli , David Hildenbrand , Oscar Salvador , Joonsoo Kim , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Doug Berger Subject: [PATCH v3 1/9] lib/show_mem.c: display MovableOnly Date: Thu, 20 Oct 2022 14:53:10 -0700 Message-Id: <20221020215318.4193269-2-opendmb@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221020215318.4193269-1-opendmb@gmail.com> References: <20221020215318.4193269-1-opendmb@gmail.com> MIME-Version: 1.0 ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=jNUUsRnW; spf=pass (imf22.hostedemail.com: domain of opendmb@gmail.com designates 209.85.222.176 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=1666302864; a=rsa-sha256; cv=none; b=0L+VhbCbNs74dFTtqp0Jhf7uf+DjNgYrcJEjDqeaSqMMuwp9F2l53YuwoenQQaYOkxoqkw fJ0SYmlHb2R8gEXnmx/QOhqN7CeAYf/XIeyrSglBnVTcXhP8J1hprR1S2YGQtc881h/n4f m7TkO16/fdqiIPZlUjYIzzlklg948L4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666302864; 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=BwP9OSSuHG+apHyoqkPAJ44LToseDE0HSDpJZDk5eXs=; b=ixj5/Z1/01kJL+Svn8AP7iJLJrxJ7hW8Vrqm2/4Xloz3M0Q/OX1KY0JgA03AFDTmR71cJp woG28prVj0ttAe/k3eXDEV8F31MLT2uOCAXXne09Z0i53H4gnE2jGAyblhZEsU+1PMT63L TZ13b2FYF7oJatVGrao8a3MFUTEPmbs= Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=jNUUsRnW; spf=pass (imf22.hostedemail.com: domain of opendmb@gmail.com designates 209.85.222.176 as permitted sender) smtp.mailfrom=opendmb@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Stat-Signature: zpfqr3ayayi3bp5wbo9fq9an94cgbiyq X-Rspamd-Queue-Id: BDAEBC0032 X-Rspamd-Server: rspam02 X-Rspam-User: X-HE-Tag: 1666302864-350002 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 0d7585cde2a6..6a632b0c35c5 100644 --- a/lib/show_mem.c +++ b/lib/show_mem.c @@ -27,7 +27,7 @@ void __show_mem(unsigned int filter, nodemask_t *nodemask, int max_zone_idx) 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; } }