Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp762971pxb; Fri, 22 Apr 2022 10:37:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxEC4c1wj/TeBzh3kO+lBaw/JvvmnPZEcGLfMayiYfMdtndlh0grWFBC6KdV/f5jsQkNBT X-Received: by 2002:a65:6a13:0:b0:373:14f6:5d33 with SMTP id m19-20020a656a13000000b0037314f65d33mr4998344pgu.62.1650649019935; Fri, 22 Apr 2022 10:36:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650649019; cv=none; d=google.com; s=arc-20160816; b=uCjjEI5NTtIsf5F275ioCLRlP8neH/2Jlv32PfeIriB+sE3h0xtDy4coxVXf0qg7C5 lViTqb1FeZqnk+faLpvYZLWlPzcm3lFp4u+xSFBnUXjw1vOv7VCnZuznkA2DcdksfrSY c7oXksa6sbgFd2+logyG/UzWtI9ce4jkboG44uSZabvQrcHrSJvGi571NDDO+EJCfjmV Yo9oPhMIZlZ1Cl/VUzLp1uahWhYLktOfMJkQEShESbYLhhUCqovKUNoi71iAWBBf2qXU fcZUekuGa8qua1hFSf8UgaGpHuahL1tvoBdtA/1f3hZXwDFe0g2HdNLRmh9hoWtGDDkC Y29Q== 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:dkim-signature:date; bh=z5GW4a8wABiS59/ZTgTPVQRXCf8XswJ73zIFmnBfAHI=; b=cwSf6pFkA+TsPlQ3nebeP3FmKKVr/Kt/pgGfGb4zamHLbCZBqrf1Hu6Vn7u0OIH1R3 Fa9aySblVh1Q9uuemgCSge9JmLmQzGPOrtH+NFC7ky1gm7QZw/aP0MgtthYjlN0rvXOw +rGbz44apGtQY5KSJ+6hq5aKwlKlvphkViaeyJ2x3cv9aMkecE/Sskjb6C/4UemIHGms VNHqwVEE9tl1n+A/tMyZ6Yjy62fAQw6TVYiu1sFO7kMizttrAArDAhGKsbx5XZ/USjIA fEYtE1dBNRzsjqG0uFwaEUrSJFbtxvf96Cvr7UgbFZdrsJnll4VZuCRFJ2WP3azCGSzQ 8OPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=mwg+Z8nz; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id j5-20020a170903028500b0015cdf6abe8esi323014plr.135.2022.04.22.10.36.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 10:36:59 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=mwg+Z8nz; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 60E01DB493; Fri, 22 Apr 2022 10:27:00 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353007AbiDSSxh (ORCPT + 99 others); Tue, 19 Apr 2022 14:53:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231906AbiDSSxg (ORCPT ); Tue, 19 Apr 2022 14:53:36 -0400 Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1BB13D4B4 for ; Tue, 19 Apr 2022 11:50:52 -0700 (PDT) Date: Tue, 19 Apr 2022 11:50:45 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1650394251; h=from:from:reply-to:subject:subject: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=z5GW4a8wABiS59/ZTgTPVQRXCf8XswJ73zIFmnBfAHI=; b=mwg+Z8nz95vbDEBX04x0Sh0igz6CXGr3uet+JlRjb3o5as9hAg+g/KqOEucZbMB+ttb8JC 2jFNWMEFHQj6UpiSuxEv/j5dKVgkdMbVQUWWejzzIjutqzfNOQoCZK7oTR7xOCx4g2wnJu DyxVCTpkDBrZfj7Ct+fcDgx9g21E/i0= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Kent Overstreet Cc: linux-mm@kvack.org, Andrew Morton , Dave Chinner , linux-kernel@vger.kernel.org, Johannes Weiner , Michal Hocko , Shakeel Butt , Yang Shi , Greg Kroah-Hartman Subject: Re: [PATCH rfc 0/5] mm: introduce shrinker sysfs interface Message-ID: References: <20220416002756.4087977-1-roman.gushchin@linux.dev> <20220419183654.axbxcjehs6fpqg4z@moria.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220419183654.axbxcjehs6fpqg4z@moria.home.lan> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=no 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 Tue, Apr 19, 2022 at 02:36:54PM -0400, Kent Overstreet wrote: > On Fri, Apr 15, 2022 at 05:27:51PM -0700, Roman Gushchin wrote: > > 7) Don't display cgroups with less than 500 attached objects > > $ echo 500 > count_memcg > > $ cat count_memcg > > 53 817 > > 1868 886 > > 2396 799 > > 2462 861 > > > > 8) Don't display cgroups with less than 500 attached objects (sum over all nodes) > > $ echo "500" > count_memcg_node > > $ cat count_memcg_node > > 53 810 7 > > 1868 886 0 > > 2396 799 0 > > 2462 861 0 > > > > 9) Scan system/root shrinker > > $ cat count > > 212 > > $ echo 100 > scan > > $ cat scan > > 97 > > $ cat count > > 115 > > This part seems entirely overengineered though and a really bad idea - can we > please _not_ store query state in the kernel? It's not thread safe, and it seems > like overengineering before we've done the basics (just getting this stuff in > sysfs is a major improvement!). Yes, it's not great, but I don't have a better idea yet. How to return the number of freed objects? Do you suggest to drop this functionality at all or there are other options I'm not seeing? Counting again isn't a good option either: new object could have been added to the list during the scan. Thanks!