From patchwork Thu Sep 2 21:53:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12472747 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3A2FC43219 for ; Thu, 2 Sep 2021 21:53:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 90FE6610FD for ; Thu, 2 Sep 2021 21:53:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 90FE6610FD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 325E56B009C; Thu, 2 Sep 2021 17:53:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2AC916B009D; Thu, 2 Sep 2021 17:53:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 19C1C8D0001; Thu, 2 Sep 2021 17:53:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0094.hostedemail.com [216.40.44.94]) by kanga.kvack.org (Postfix) with ESMTP id 05B3E6B009C for ; Thu, 2 Sep 2021 17:53:03 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id BECBA2C6AE for ; Thu, 2 Sep 2021 21:53:02 +0000 (UTC) X-FDA: 78543984204.24.B618C67 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf23.hostedemail.com (Postfix) with ESMTP id 7836F90000A7 for ; Thu, 2 Sep 2021 21:53:02 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 8660C61151; Thu, 2 Sep 2021 21:53:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1630619581; bh=vBOkoxaMZ3L6fYvAz0cv+i2rEEHul6A8wwII0QkKxdE=; h=Date:From:To:Subject:In-Reply-To:From; b=klRAm3zk1rFBRfzBx/AS9ne5vAET9Zza3hZK4qom25UWiGshBt04XcazcanfO31nc Gy/VFUtRzIdM1Kr7rEgZL7E2dMMU3uEoEtQFrngL2TI9NpLxb2KeIYrkUzOS/A0x8l j4a0X2Ho5zbvw0WvCU/XlRAB3Ovrvs4lfIQxb0IU= Date: Thu, 02 Sep 2021 14:53:01 -0700 From: Andrew Morton To: akpm@linux-foundation.org, linux-mm@kvack.org, liuhailong@oppo.com, mm-commits@vger.kernel.org, torvalds@linux-foundation.org Subject: [patch 057/212] mm: add kernel_misc_reclaimable in show_free_areas Message-ID: <20210902215301.Wf_oYDPc3%akpm@linux-foundation.org> In-Reply-To: <20210902144820.78957dff93d7bea620d55a89@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=klRAm3zk; spf=pass (imf23.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 7836F90000A7 X-Stat-Signature: d6g7gywh8k8nhyipdhsggt6e5nrjq3r8 X-HE-Tag: 1630619582-826950 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: From: liuhailong Subject: mm: add kernel_misc_reclaimable in show_free_areas Print NR_KERNEL_MISC_RECLAIMABLE stat from show_free_areas() so users can check whether the shrinker is working correctly and to show the current memory usage. Link: https://lkml.kernel.org/r/20210813104725.4562-1-liuhailong@oppo.com Signed-off-by: liuhailong Signed-off-by: Andrew Morton --- mm/page_alloc.c | 2 ++ 1 file changed, 2 insertions(+) --- a/mm/page_alloc.c~mm-add-kernel_misc_reclaimable-in-show_free_areas +++ a/mm/page_alloc.c @@ -5903,6 +5903,7 @@ void show_free_areas(unsigned int filter " unevictable:%lu dirty:%lu writeback:%lu\n" " slab_reclaimable:%lu slab_unreclaimable:%lu\n" " mapped:%lu shmem:%lu pagetables:%lu bounce:%lu\n" + " kernel_misc_reclaimable:%lu\n" " free:%lu free_pcp:%lu free_cma:%lu\n", global_node_page_state(NR_ACTIVE_ANON), global_node_page_state(NR_INACTIVE_ANON), @@ -5919,6 +5920,7 @@ void show_free_areas(unsigned int filter global_node_page_state(NR_SHMEM), global_node_page_state(NR_PAGETABLE), global_zone_page_state(NR_BOUNCE), + global_node_page_state(NR_KERNEL_MISC_RECLAIMABLE), global_zone_page_state(NR_FREE_PAGES), free_pcp, global_zone_page_state(NR_FREE_CMA_PAGES));