From mboxrd@z Thu Jan 1 00:00:00 1970 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 37A3DC433EF for ; Tue, 8 Feb 2022 19:11:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9D1E46B0073; Tue, 8 Feb 2022 14:11:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9812F6B0075; Tue, 8 Feb 2022 14:11:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 821A36B0078; Tue, 8 Feb 2022 14:11:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0143.hostedemail.com [216.40.44.143]) by kanga.kvack.org (Postfix) with ESMTP id 723996B0073 for ; Tue, 8 Feb 2022 14:11:20 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 2E98B181CAC58 for ; Tue, 8 Feb 2022 19:11:20 +0000 (UTC) X-FDA: 79120555920.26.ABBA28B Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf07.hostedemail.com (Postfix) with ESMTP id B5FE240007 for ; Tue, 8 Feb 2022 19:11:19 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 7250A210E7; Tue, 8 Feb 2022 19:11:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1644347478; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yttcmkKs+bAIvSGjq/8ZnP5VxhwV7JekAzQGhUXqisI=; b=dy1JqXXlQZKUE8/PmDrCJFOZy2foFZ/0AkY+ce/Jfjk0EAJ4M/lil/28r3sujk4pPJXcXn LKKg/TAy1nG4NLYKEYKZ7u4qAeV9pJ4PEwZWlGdbQcLwNUB+UQzTgAlm2a5hTKs7NPnirl L7PkvJFco7fjr5MZF52Jd5A6UXJCwLc= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 29580A3B81; Tue, 8 Feb 2022 19:11:18 +0000 (UTC) Date: Tue, 8 Feb 2022 20:11:17 +0100 From: Michal Hocko To: Waiman Long Cc: Johannes Weiner , Vladimir Davydov , Andrew Morton , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Andy Shevchenko , Rasmus Villemoes , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, Ira Weiny , Mike Rapoport , David Rientjes , Roman Gushchin , Rafael Aquini , Mike Rapoport Subject: Re: [PATCH v5 3/4] mm/page_owner: Print memcg information Message-ID: References: <20220208000532.1054311-1-longman@redhat.com> <20220208000532.1054311-4-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: B5FE240007 X-Rspam-User: Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=dy1JqXXl; spf=pass (imf07.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-Stat-Signature: tgk1k5kcmr4p96qdy4xz7qr5n3agnt4d X-Rspamd-Server: rspam04 X-HE-Tag: 1644347479-330168 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: On Tue 08-02-22 13:40:57, Waiman Long wrote: > On 2/8/22 07:13, Michal Hocko wrote: > > On Mon 07-02-22 19:05:31, Waiman Long wrote: > > > It was found that a number of dying memcgs were not freed because > > > they were pinned by some charged pages that were present. Even "echo 1 > > > > /proc/sys/vm/drop_caches" wasn't able to free those pages. These dying > > > but not freed memcgs tend to increase in number over time with the side > > > effect that percpu memory consumption as shown in /proc/meminfo also > > > increases over time. > > I still believe that this is very suboptimal way to debug offline memcgs > > but memcg information can be useful in other contexts and it doesn't > > cost us anything except for an additional output so I am fine with this. > > I am planning to have a follow-up patch to add a new debugfs file for just > printing page information associated with dying memcgs only. It will be > based on the existing page_owner code, though. So I need to get this patch > in first. Sure. I would give a shot the drgn approach as this can be much more versatile without any additional kernel code. [...] > > > + dying = (memcg->css.flags & CSS_DYING); > > Is there any specific reason why you haven't used mem_cgroup_online? > Not really. However, I think checking for CSS_DYING makes more sense now > that I using the term "dying". I do not really care much but I though CSS_DYING is a cgroup internal thing. We have a highlevel API so I thought it would be used preferably. -- Michal Hocko SUSE Labs