Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4027309rdh; Tue, 28 Nov 2023 09:49:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IFveNK1vxpkwPtnDg8FZ6hABVHXVITR4j9XIzEM9WL27ecVkb5WpeQtOZuIG1nUStu9iGUv X-Received: by 2002:a05:6a00:10d2:b0:6cb:8c70:4790 with SMTP id d18-20020a056a0010d200b006cb8c704790mr17706328pfu.1.1701193749172; Tue, 28 Nov 2023 09:49:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701193749; cv=none; d=google.com; s=arc-20160816; b=MEZqBj1aXhGlNfDipaDyDCrbOIztf2nvUythVU2Pmwpqw1mk2fA5plG0Kv5hQPgXFf MhBAKRvBg81Z1JGiZFJwbIirzfKl8m3/U7GI4sbL33IVuJIlTlCidXQc1pROOAZVgWMm ANDuGwe8iQW9k92lgxYaSSz2+KAtP1wfV3kYqCB68W+Vpo4RTRfK2wUP5Xg60bZumxYQ 9oYhaS+CR4jS7FO/nYAQbM2ZT5A0em4egBGS+5WRcTIYbwacIDt3W48ERAUVmEtP6/3h xZjR/5/2z82TWylLIovHaOPd/30wUCzb4cIDxxGrEv171x1o+SBEQicKBC82Dfvsvd7A U3PA== 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=x92AonzKJ7GgZn17I/dTryRFnqMzXBn6+eaF91PM4HM=; fh=x3uE3UNq7Ypln02+ediyb89i23aAlSwDHXCVslOqUUM=; b=JueGCeGD2ARfuewk2YiLKhrYstpwgXFoNalAudSINCE/xP/9ngxcGcyldw10MB6ayN boHSUtgFTmzr2s58hYXNbTrXZVyh0LrxJWGXx+MKjJRN3Zy5cGq+3Bkze959XIWaYMtH fDlaGgrPcR5kt3gMAsMWtfZEOxbHW0l4lgVHmE5W9UFOEguyibZoo6Ka5SJse3fHxfE6 HChTahsb+akhzV5QDGXXtq2mKanig3xWUiofYW7Otw+Hu+bbZyqnD3QTveKTF1UtcbNe HLF/UC2somvpykCnH4tlCzGBNxgQOU/MltVI6FjHDj+TJuh7chfDvCUlsZZ4GUHfLz6Y uRyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=E2gGZDj+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id e4-20020a654784000000b005c1b5aa3f16si12400809pgs.777.2023.11.28.09.49.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 09:49:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=E2gGZDj+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id E7B78807CB75; Tue, 28 Nov 2023 09:49:06 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345727AbjK1Rsx (ORCPT + 99 others); Tue, 28 Nov 2023 12:48:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232982AbjK1Rsw (ORCPT ); Tue, 28 Nov 2023 12:48:52 -0500 Received: from out-173.mta1.migadu.com (out-173.mta1.migadu.com [IPv6:2001:41d0:203:375::ad]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 054D91B5 for ; Tue, 28 Nov 2023 09:48:58 -0800 (PST) Date: Tue, 28 Nov 2023 12:48:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1701193737; 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=x92AonzKJ7GgZn17I/dTryRFnqMzXBn6+eaF91PM4HM=; b=E2gGZDj+UcR61Cbc0msUebSjtV9zEwKV3r6jC1tutkWfPSjrJ7dSA+a1FRfQT4oCOWCiJH ClN390IW7QsWc40VEXsYrzhmHtp6nxyOcs86+LAkBNmoQSrRVvR3b0TmlWxgAwAreO86kI p/c34irF3uX+ptppMT0oQ5h/maGvB2s= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Michal Hocko 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: <20231128174853.vdpwullepoxg5blo@moria.home.lan> References: <20231122232515.177833-1-kent.overstreet@linux.dev> <20231122232515.177833-3-kent.overstreet@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 morse.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 (morse.vger.email [0.0.0.0]); Tue, 28 Nov 2023 09:49:07 -0800 (PST) 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.