Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1539260iob; Thu, 19 May 2022 08:39:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhV2Iik8gDeyduJsBpxgkmuOkxTo5YPmi/yyy8dGr710WHD6ooWdk/Dj/j9Q2zy56ex5Jy X-Received: by 2002:aa7:ce81:0:b0:42a:ee56:c948 with SMTP id y1-20020aa7ce81000000b0042aee56c948mr5990840edv.388.1652974777923; Thu, 19 May 2022 08:39:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652974777; cv=none; d=google.com; s=arc-20160816; b=AB4uXdJDbUE+Rl9KCgqSadbXt3MstO4zZRA4bJb7aGBRCbZ5UaVpP8UFBECB6mP5Ce o157ARR2zpboZf9qqyiMj91gnuEP7ckW+AJUnFcHFn0oFKTgwGaxvYDCYaNh+3gXWtN/ QI72vgnpJpIPUTZrwPLGkgxmgD+P8ipWvYmdKeZIS7qcp4NgF5GEjHSLxnLpae+w0B02 9pG0hMvfn5Y9rUQB/WSu8b/WrHtN+6WuxUgJtN6pP4TRWFTGgg8yJK1+D55sXaC2uU32 wR7xyTaMDE4hkrmDJaCvz0b2HEUhciumZBaZlyaasn4l1XcIBd7WeEuRnDT0wI8QbAFG 1fZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=IzXgw0a74dIiLsfsgpX507bbTu4KgqdYCg8XDacIqHw=; b=usJFmi0d55AqJhhMU+PLZGLmuqpUCqsxKCXmv7w0Lu9yxba4MDe063bjk3ydJnmUSP TTaEO18OdYF984E5Ox/CCpFJ+T9WYEq0iunN6OCtK1MnMvCV4xqp5DCG29YKf1+IZedy zm5zHVA6/hkgwg4LrUkuRSrZbpuwViWtAYN7uFiZr/LbYPhaysdWCU7OtBUj2ONbUTYs Zsm2sqIZzNi4vr+Cluv5KLGjmhOVCZpLw85l8yOWwjTGfKnnh46+1vYJKpOegBsojnXS 6UhCzfJ3+kkYX2telyoscVkOxepd2vTA1kSQJV9Hs836KUZTfrr8JsMQTChU9rsAcWYm lomA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=p6eg7yMB; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg14-20020a170907970e00b006fa8c68ddacsi6132603ejc.336.2022.05.19.08.39.11; Thu, 19 May 2022 08:39:37 -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=@suse.com header.s=susede1 header.b=p6eg7yMB; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237183AbiESLDE (ORCPT + 99 others); Thu, 19 May 2022 07:03:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237185AbiESLDC (ORCPT ); Thu, 19 May 2022 07:03:02 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5ADBE5C347; Thu, 19 May 2022 04:03:01 -0700 (PDT) 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-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 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