Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4687245rdh; Wed, 29 Nov 2023 08:03:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IHzuYWavZwmvNvWdkg3LGEOGECAcvVSMlEslSVz4O+IQdXt8IRwSiB9qJtIX4Ai+bzrEA0k X-Received: by 2002:a05:6830:1058:b0:6d6:4fed:a21a with SMTP id b24-20020a056830105800b006d64feda21amr19098945otp.6.1701273781024; Wed, 29 Nov 2023 08:03:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701273781; cv=none; d=google.com; s=arc-20160816; b=SqxC6S+KANptnokshWWxJ5uzAqoPkTYq+Jlyc7lNVwbgEt8RnIwnKBBPs4G/ymicfK DZGhemlW3EBS0rDP0wlp3J0EfniYwi2W0yS4ig0Hfu/RFja3OilzuuEY+FxrjPp4UH30 qS29lb0zJaCbZdtmSmypOFn8ZmAhnorhpu2dBPReCmFdxzhDGIzQOfRRyXDI8JpW+I4/ 9J4KGTRAuO1AgaXf1PamNtXj2WhcLD2aUcKpF5ZpUWOOTmCyYqDoXAsz30RVxFUJ7TX+ J0z2FJl0cYnKMUUMCP/Cu/Pfj+ji6e6+UFjoC0b6l6G+onTP7z9hfqG3J5Uoq0c1PerA N/Rg== 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; bh=i+2sG/kjJf9M7kpqxI31ZucX7BFcL70nR+1qm7SEH4c=; fh=NBAzKwlMiGDYGix5qkNa9v/1v2BbnGWFRQcXjy0kDP0=; b=XKoAt/BWy5qYQoJfU+ldpWCrno+bQPjub+9av1Vg5i6wACP77mGov0yVUnOfOrBu+c 4rkWch98vO0zJjfOzVOZ1l6rKp+VK4N9qRMzt//2SVoAGBVl5gAdGRQfxNNgRpTc9FAt HsD9aEBVydbU/1n5JCrMiaYxOlCBfCuU23FCRerOxxJk3PvcnVfUkDTAH+nHD/abIOOT VyveozDJrnQEBeXOO3Q7ewA68CxyP3cQJ88VVO24p0zZddvFmSYyDm3F783xoZWdM6uc xk+HT7CGQAQXqWj1CTcjSWEr/gFJGwDWxnhLfU2pCNVyPFm4e0iCkQAAfZ81e4iAARwV oZKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id q2-20020a05683033c200b006d64554901fsi5522723ott.73.2023.11.29.08.02.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 08:03:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 253A080930DA; Wed, 29 Nov 2023 08:02:55 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343583AbjK2QCg (ORCPT + 99 others); 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> X-Spam-Level: Authentication-Results: smtp-out2.suse.de; none X-Rspamd-Server: rspamd2 X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Score: -4.00 X-Rspamd-Queue-Id: B72421F8D7 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 29 Nov 2023 08:02:55 -0800 (PST) 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