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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDD89C4167B for ; Wed, 29 Nov 2023 16:02:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343597AbjK2QCg (ORCPT ); Wed, 29 Nov 2023 11:02:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230389AbjK2QCf (ORCPT ); Wed, 29 Nov 2023 11:02:35 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18A91BF for ; Wed, 29 Nov 2023 08:02:42 -0800 (PST) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B72421F8D7; Wed, 29 Nov 2023 16:02:40 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 9A8F71388B; Wed, 29 Nov 2023 16:02:40 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id Nzq8IqBgZ2UWewAAD6G6ig (envelope-from ); Wed, 29 Nov 2023 16:02:40 +0000 Date: Wed, 29 Nov 2023 17:02:35 +0100 From: Michal Hocko To: Kent Overstreet Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Qi Zheng , Roman Gushchin Subject: Re: [PATCH 2/7] mm: shrinker: Add a .to_text() method for shrinkers Message-ID: References: <20231122232515.177833-1-kent.overstreet@linux.dev> <20231122232515.177833-3-kent.overstreet@linux.dev> <20231128174853.vdpwullepoxg5blo@moria.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231128174853.vdpwullepoxg5blo@moria.home.lan> Authentication-Results: smtp-out2.suse.de; none X-Rspamd-Server: rspamd2 X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Rspamd-Queue-Id: B72421F8D7 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 28-11-23 12:48:53, Kent Overstreet wrote: > On Tue, Nov 28, 2023 at 11:01:16AM +0100, Michal Hocko wrote: > > On Wed 22-11-23 18:25:07, Kent Overstreet wrote: > > [...] > > > +void shrinkers_to_text(struct seq_buf *out) > > > +{ > > > + struct shrinker *shrinker; > > > + struct shrinker_by_mem { > > > + struct shrinker *shrinker; > > > + unsigned long mem; > > > + } shrinkers_by_mem[10]; > > > + int i, nr = 0; > > > + > > > + if (!mutex_trylock(&shrinker_mutex)) { > > > + seq_buf_puts(out, "(couldn't take shrinker lock)"); > > > + return; > > > + } > > > + > > > + list_for_each_entry(shrinker, &shrinker_list, list) { > > > + struct shrink_control sc = { .gfp_mask = GFP_KERNEL, }; > > > > This seems to be global reclaim specific. What about memcg reclaim? > > I have no fsckin idea how memcg reclaim works - and, for that matter, > the recent lockless shrinking work seems to have neglected to write even > an iterator macro, leaving _that_ a nasty mess so I'm not touching that > either. OK, you could have made it more clearly that all of this is aiming at the global OOM handling. With an outlook on what should be done if this was ever required. Another thing you want to look into is a NUMA constrained OOM (mbind, cpuset) where this output could be actively misleading. -- Michal Hocko SUSE Labs