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: 6425 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp339435wrr; Thu, 20 Oct 2022 14:56:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5oH4XhJ9GLvqMTmS9SeqlXOXU1rm+viDx/bVbVitqSBPj/OhuzuorVZUCu2p3Q255K10wd X-Received: by 2002:a05:6a00:22cf:b0:563:744a:8951 with SMTP id f15-20020a056a0022cf00b00563744a8951mr15950672pfj.3.1666303004058; Thu, 20 Oct 2022 14:56:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666303004; cv=none; d=google.com; s=arc-20160816; b=HvcgVczdvhMxEqBi7A1kEfSXHb+J8lxLi1304zqRj6Q1ozDI83BePi4IcUYymmyVQD +F6IfdsRqM5f8YFzO9T2oRa72VOZNznbe5LDiVO0K6BlC4ayz7NNw3+07Y/v8P00I6Qk rDjASyrrJ3uAfIw4DKqzryhNlK+kML51iAYxEhiWGY4K9NmJwAKenJn4CM9uTFpESaWW euCVKXS+8lA00h/gAm0xsWkSt/k1feLrzE0Au/f1Nhr1avddpSRT8UKqNGcQYcQoBxRV F91gF4cQGupr+ZPIVdJI161wt+QjZ2MCsqsW+VLnJi9hAa4juCwY0Lb34D3umqoAeChw BXjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BwP9OSSuHG+apHyoqkPAJ44LToseDE0HSDpJZDk5eXs=; b=SJNiFaLTiLon0d0nQFOwspHnqgOxG/25X10doEO0p177m51BkWHma3T+rdmsLvN0Cc Hg10Umswlp/fvyK305mKV3+GFcsEb8BpgwS6x19npt/yJEJnUzXurRyqpKTYXjBFVPNj Yka1kX3qI4RoI1ZVXWtpnlTre5Nrxc8tt4wPqa90Ws6Wo+qKqizhUV2MKvIwF/aZmt0h wX503sQ3hw/gcOW4/qrMi4B15Cbxo8RmJV2TZ3huYRXJOeev7wniROz5DDS5jR9C483H wJAQKTPtIbm/B5tXlVT/O+0rKrvSSx8ufoHuvATd639SKCzBBR05g2MbX5iZDW+a6RA2 Y+VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=jNUUsRnW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e3-20020a63f543000000b00434dd6f6e21si25038441pgk.125.2022.10.20.14.56.31; Thu, 20 Oct 2022 14:56:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=jNUUsRnW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230080AbiJTVyd (ORCPT + 99 others); Thu, 20 Oct 2022 17:54:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229585AbiJTVy2 (ORCPT ); Thu, 20 Oct 2022 17:54:28 -0400 Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 567FD2250C; Thu, 20 Oct 2022 14:54:25 -0700 (PDT) Received: by mail-qk1-x72a.google.com with SMTP id s17so849477qkj.12; Thu, 20 Oct 2022 14:54:25 -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=H+1roMVjlDs+n+cgAol0jw/LbEczpDWjTc51iPHD31Ir8kWBhjlBDqCjnBu4qPEq3g gaYAY418VZriByUhm3Q1OUv9r2sfZBzmXgz1RCxRa17SSl0s/5AHAv38yZNn0GU9OpoS MLwJEnthgoVE0qnqt/5YbJdHYbqJ5C/+b/BAk9MBZQB2RHD1/trcUdClK+TVuM4kQNiM BLJBR4Je5ABTugNIDmQ24PTnjee+1df29+Yx8yNGzuuxiTEozkrMKxvTQugY+gt9/+zK ZED+QimJFellCFJS67FRBmDfJKVEhydEHdFQxXH50VDA3Z87izJFShGkRnos/xmxG3Bm ByZw== X-Gm-Message-State: ACrzQf12gGtAq7znMlKvRB0Ne+4smtpJqi/+gj6+lRf4D31K7hZz7YQY n1jlehGebQfy3anLZwaZfr4= 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747245338358682823?= X-GMAIL-MSGID: =?utf-8?q?1747245338358682823?= 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; } }