Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4912411rdh; Wed, 29 Nov 2023 14:37:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IEM9/RXKjDS5UTHg8XCS7Iw+xG2eOQr7yHivUSBLGO15VZJACCZDU1/Bwq3S7vDiiIqbPrP X-Received: by 2002:a05:6a00:428c:b0:6cb:8b47:cb6c with SMTP id bx12-20020a056a00428c00b006cb8b47cb6cmr20810691pfb.6.1701297434600; Wed, 29 Nov 2023 14:37:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701297434; cv=none; d=google.com; s=arc-20160816; b=MKcBrIT1bqzvz9kGFHcgWagfZ2Ttr7Dnzz6R2ropMEjzvdn5u+J37a/8ZPeZbx59Nn zSYM9+HXBdxpQHWhBaF4eaV3RiaCucdprT3GCqfLpXqSApJQbGJXFtk9rS3E1sDCiY5C QNTSM62SedvVjo3pobnpg1GjuoeXFBxIY31ulutkA1fgNeR1MwsAg7MAzUlEF5YBITRN DeOb+czVeQv5nfegjyXr3/R2OV80sDF3/hjhAIwXeoUpJVwy/SgF4zWw4sKydeqYJKKb n1JGBaRMk+H5cGzKUD3ZktzLmRBWWS0WTY9wVOIbBHwHJNioHqaKpws6d5zUecM3lRov /jlg== 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=iThWbTiboznHyChE5Jo4QcgUuCYJSKHGFLfD6YWq1kA=; fh=x3uE3UNq7Ypln02+ediyb89i23aAlSwDHXCVslOqUUM=; b=a286bRYV/F5mapvEUZ965Aa6HE05/Pnn2da2aD5A3sj8X2znMYMUu6aZhSwPBPEg3c 7u38uF22OuoHiCp/u4vwL2I7u420DLbwoPyrcamcie8tjnskOu+PeRI+a0EGIQBWRh3O L1C5ZgTEF4AYYokA3a+mUm7IOIN4yVYH6Col3OGkrkI/oHKVQFJr515NhGW5F/5a7HXP 6dsKsYCf0I24w6y5rqWUr1Q8FYLjdKXJY7CYoKTl1MDBfRJZjzNj0SkEtzwoj1amI9gK 2Dr+IoLaryY8xDOmSQM83hfzgsMZtqBPUaOWqaNTXZva2EwZ5zynWPjLU+x4+FUcPukl 77Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ZZ4ikl8Y; 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 bt7-20020a056a00438700b006cddefd2031si1096976pfb.37.2023.11.29.14.37.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 14:37:14 -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=ZZ4ikl8Y; 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 55AFF807CB6D; Wed, 29 Nov 2023 14:37:12 -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 S231553AbjK2Wg4 (ORCPT + 99 others); Wed, 29 Nov 2023 17:36:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231506AbjK2Wgz (ORCPT ); Wed, 29 Nov 2023 17:36:55 -0500 Received: from out-178.mta1.migadu.com (out-178.mta1.migadu.com [IPv6:2001:41d0:203:375::b2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CF75C4 for ; Wed, 29 Nov 2023 14:37:01 -0800 (PST) Date: Wed, 29 Nov 2023 17:36:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1701297419; 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=iThWbTiboznHyChE5Jo4QcgUuCYJSKHGFLfD6YWq1kA=; b=ZZ4ikl8Y1DagtagNlyORcz+TM0QK5RWVuGkV2YXDMLOKY9y9IN37nPARWa/xHQWsPHRHEL gXgUC6eXEwh/SHSU/FSiyiMi6E2utKCQx4VmasacRZvvlRD+xUNPaTvCkBlreZjG00H/7z Vkvo1qYywvIIcejRA6LfCocERhDOu6c= 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: <20231129223655.shi74lnm2tolun77@moria.home.lan> 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: 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]); Wed, 29 Nov 2023 14:37:12 -0800 (PST) On Wed, Nov 29, 2023 at 05:02:35PM +0100, Michal Hocko wrote: > 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. Yeah. It's not clear to me how (if at all) we want memcg to be represented in this output; it's not something us filesystem developers think about a lot. NUMA definitely should, though.