Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp59061rdb; Wed, 29 Nov 2023 20:15:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IENulj+O4GdPP3X5NPPoXX1rBmKQ2dPcAnN+hZVLcCSoQH6G5CM9qK0qerWGCE5hKx4rs3G X-Received: by 2002:a05:6a00:10d2:b0:6cb:4bd5:a4c5 with SMTP id d18-20020a056a0010d200b006cb4bd5a4c5mr24799478pfu.9.1701317720056; Wed, 29 Nov 2023 20:15:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701317720; cv=none; d=google.com; s=arc-20160816; b=HqRZ+mlZbAKVovQM2W5uL5SEPifFXL+9YNp2ojOCQ0Ju6jXUlONn4xF8vlSpF9m+fR eS4bHDZmsz3C5uGiYr3RYrMSu0cdcwQOPB6y7C3kowBByKHOsg0w6VCYym8Uaxl8XY7b QqnLNxXFWtaOCOWLsjbgZqsafCip8ZYWQN36sVo4P89QOJT3unWQ0k38IronjoEOCF12 THjnxso8V6AKRxIxEgbwkh/t2G/5N/2QQ6jCdtbNXkWB7bP95JpV4o8VOti6CRZnbwvP 5YkN2Z0j+JVhjhNbQt1RBPCXrZHaon3Pdxc6NV9ql8kEKyXxsU0stSowIC3qt2kp3gtj qkAw== 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=sOgwC1NdimlzYQo5Epj8cIIpO4bimXE0tJXhrILlqsg=; fh=yWDSwjeHQrAUKiyrdMntL9BlkHYsX7yuEczfrnGkK+0=; b=mlo4HYt1iZ9f5AWJD9Wqms/x+ZIAEKG7VTeWTmRVYTOReu+sDar2Aeu3fnjm4jHORt fQxnVko2az5O66WdvM8pxNuA5Qwr4SqmX85LoL7bl746cA2DFhxmtoYukJg5gnA4Dg0H HetJ+q6WNvm0K1VqAeOesL/emUTBqhOBndxigKdAdj2VEU6oNGOBdmrWqayrOCJSIzhg Dv2rHgQt6ntVCf40+IgjZ2RfH1nW2kjS+/ShkLKif6zJSipIq/q276rm/pKfO4MKgsaG bZouao1VLSPjm6mmkI9XRis5SAaD0+Vrw/Tx4Beaft4gv5QyBapxocs8phGS8GLtxHHM 7f3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=p7G7lo0f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id de15-20020a056a00468f00b006cdd5331205si324216pfb.381.2023.11.29.20.15.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 20:15:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=p7G7lo0f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 47E5F8047464; Wed, 29 Nov 2023 20:15:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344411AbjK3EOq (ORCPT + 99 others); Wed, 29 Nov 2023 23:14:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234934AbjK3EOp (ORCPT ); Wed, 29 Nov 2023 23:14:45 -0500 Received: from out-178.mta1.migadu.com (out-178.mta1.migadu.com [95.215.58.178]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16070D5C for ; Wed, 29 Nov 2023 20:14:51 -0800 (PST) Date: Wed, 29 Nov 2023 23:14:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1701317689; 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=sOgwC1NdimlzYQo5Epj8cIIpO4bimXE0tJXhrILlqsg=; b=p7G7lo0fSJvxUHk9qub8yOk3MjGHq4JEevY4ZI5IXmIyT9FmJ+3NqAplpxnqSQI7KOLWEI 6mbt+WSLPiFiTnG1UpmmrhgPlCS2tWwqxcbP6ncDFFidF8b747d1cqP8Nxy/OaBkK2LtuR nTAtfwpyT2DAM9rK/gXBm2WVDnpY77E= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Qi Zheng Cc: Michal Hocko , Roman Gushchin , Muchun Song , Linux-MM , linux-kernel@vger.kernel.org, Andrew Morton , Dave Chinner Subject: Re: [PATCH 2/7] mm: shrinker: Add a .to_text() method for shrinkers Message-ID: <20231130041444.7cbhbvkvwpcbbhyd@moria.home.lan> References: <20231125003009.tbaxuquny43uwei3@moria.home.lan> <76A1EE85-B62C-49B3-889C-80F9A2A88040@linux.dev> <20231128035345.5c7yc7jnautjpfoc@moria.home.lan> <20231129231147.7msiocerq7phxnyu@moria.home.lan> <04f63966-af72-43ef-a65c-ff927064a3e4@bytedance.com> <20231130032149.ynap4ai47dj62fy3@moria.home.lan> <6f56c8f4-77e3-4ad7-a5f8-a6235b047137@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6f56c8f4-77e3-4ad7-a5f8-a6235b047137@bytedance.com> 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 fry.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 (fry.vger.email [0.0.0.0]); Wed, 29 Nov 2023 20:15:12 -0800 (PST) On Thu, Nov 30, 2023 at 11:42:45AM +0800, Qi Zheng wrote: > > Similarly for shrinkers, we're not going to be printing all of them - > > the patchset picks the top 10 by objects and prints those. Could > > probably be ~4, there's fewer shrinkers than slabs; also if we can get > > shrinkers to report on memory owned in bytes, that will help too with > > deciding what information is pertinent. > > I'm not worried about the shrinker's general data. What I'm worried > about is the shrinker's private data. Except for the corresponding > developers, others don't know the meaning of the private statistical > data, and we have no control over the printing quantity and form of > the private data. This may indeed cause OOM log confusion and failure > to automatically parse. For this, any thoughts? If a shrinker is responsible for the OOM, then that private state is exactly what is needed to debug the issue. I explained this earlier - shrinkers can skip reclaiming objects for a variety of reasons; in bcachefs's case that could be trylock() failure, an IO in flight, the node being dirty, and more. Unlock the system inode shrinker, it's much too expensive to move objects on and off the shrinker list whenever they're touched. Again, this all comes from real world experience. The show_mem report is already full of numbers with zero explanation of how they're relevant for debugging OOMS; we really need to improve how that is presented as well.