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 00A44C433F5 for ; Tue, 19 Apr 2022 18:50:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 812506B0073; Tue, 19 Apr 2022 14:50:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7C30E6B0074; Tue, 19 Apr 2022 14:50:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 689716B0075; Tue, 19 Apr 2022 14:50:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 5694C6B0073 for ; Tue, 19 Apr 2022 14:50:53 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 23E2A25F3 for ; Tue, 19 Apr 2022 18:50:53 +0000 (UTC) X-FDA: 79374520386.06.1A85291 Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by imf23.hostedemail.com (Postfix) with ESMTP id 41008140011 for ; Tue, 19 Apr 2022 18:50:51 +0000 (UTC) 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 Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=mwg+Z8nz; spf=pass (imf23.hostedemail.com: domain of roman.gushchin@linux.dev designates 91.121.223.63 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-Stat-Signature: opkjmbhautf7cz33w95nsu5mrwyxxqw3 X-Rspamd-Queue-Id: 41008140011 X-Rspamd-Server: rspam04 X-Rspam-User: X-HE-Tag: 1650394251-216511 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, 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!