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 D3FC0C433EF for ; Thu, 19 May 2022 11:03:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 476EC6B0074; Thu, 19 May 2022 07:03:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4264E6B0075; Thu, 19 May 2022 07:03:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 316086B0078; Thu, 19 May 2022 07:03:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 253D76B0074 for ; Thu, 19 May 2022 07:03:02 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id EA030809B8 for ; Thu, 19 May 2022 11:03:01 +0000 (UTC) X-FDA: 79482205362.06.040A257 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf21.hostedemail.com (Postfix) with ESMTP id 2481C1C00D1 for ; Thu, 19 May 2022 11:02:50 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 0B522219AD; Thu, 19 May 2022 11:03:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1652958180; 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=IzXgw0a74dIiLsfsgpX507bbTu4KgqdYCg8XDacIqHw=; b=p6eg7yMBMmZI2a2JOGfaZfOHUgEOzr0pYRni8ATdIoJyZhzflN3bAt8hpReN3HD8VnJ9qZ EOq6iF/jJF96GHnLG2V2n1ZpPZntJNxjElw0yW8Q29RCIQOzEe40LqFOlEuEEvCAxCHZz+ iR5Y6RjT79txDZA425cVGDkX0PR58WM= 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 37F412C141; Thu, 19 May 2022 11:02:59 +0000 (UTC) Date: Thu, 19 May 2022 13:02:58 +0200 From: Michal Hocko To: Vaibhav Jain Cc: cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Tejun Heo , Zefan Li , Johannes Weiner , Jonathan Corbet , Vladimir Davydov , Andrew Morton , "Aneesh Kumar K . V" , Shakeel Butt , Yosry Ahmed Subject: Re: [PATCH] memcg: provide reclaim stats via 'memory.reclaim' Message-ID: References: <20220518223815.809858-1-vaibhav@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220518223815.809858-1-vaibhav@linux.ibm.com> X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 2481C1C00D1 X-Stat-Signature: fk34mcxdkmw9eximadgjgzqi6k1yjscq Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=p6eg7yMB; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf21.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com X-Rspam-User: X-HE-Tag: 1652958170-216861 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 Thu 19-05-22 04:08:15, Vaibhav Jain wrote: > [1] Provides a way for user-space to trigger proactive reclaim by introducing > a write-only memcg file 'memory.reclaim'. However reclaim stats like number > of pages scanned and reclaimed is still not directly available to the > user-space. > > This patch proposes to extend [1] to make the memcg file 'memory.reclaim' > readable which returns the number of pages scanned / reclaimed during the > reclaim process from 'struct vmpressure' associated with each memcg. This should > let user-space asses how successful proactive reclaim triggered from memcg > 'memory.reclaim' was ? > > With the patch following command flow is expected: > > # echo "1M" > memory.reclaim > > # cat memory.reclaim > scanned 76 > reclaimed 32 Why cannot you use memory.stat? Sure it would require to iterate over the reclaimed hierarchy but the information about scanned and reclaimed pages as well as other potentially useful stats is there. -- Michal Hocko SUSE Labs