Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp3006206lqz; Wed, 3 Apr 2024 15:25:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVGlBNqhYVr5e6GTdkMjX8mEdzXQ5QvJjSBpLdtXJE81RVKlc2pLKJ3fHvu6Ccvrrjc2BgT1OD11ww7loEEy9c/4iahOO1bXdX//WEyGQ== X-Google-Smtp-Source: AGHT+IFHmsTyQMzeUxhj3X1wK7fSxgRvV7X94WjtTTxbIORcbHQbecPKsQUx6l9av3PoMgGH9gyv X-Received: by 2002:a05:620a:1011:b0:78d:3c0a:b9d7 with SMTP id z17-20020a05620a101100b0078d3c0ab9d7mr797579qkj.64.1712183124230; Wed, 03 Apr 2024 15:25:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712183124; cv=pass; d=google.com; s=arc-20160816; b=awzXdoMUCHAyxQ4hWW0bZA3VmraVn6TtKH7GQDjlZPYbI8hEUMAGDA42M3l/I88Sia xHBAOhq9I4evvwYPB2gLRd8bZsP8oMDIuBNCDEL22NOnwR6/blEYDXzfKM8hLiKzlXjF sFhdlOJujKIRV0t1+jGJX6g8HjrU6q65diuAWW90OyKxcOA2GFH1wuLnrvAAJqq5H7LQ VB3YhzmxKWvkt6UmYbOARIW3ENgl2yNS7BGOvo/9Q6jW11MmbPSHA4GcYKgDS2I1Km6w E4TK5zX0TCO1v18YUrEv5nJWH7IyRLKtbcGppxaEtkMlGJSyBHXE3GR6um0GPD0UqgmV rlPw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=m2bIqvAswIgDrceINf7iI+jp9YVPIpyS4ScRls8ALPo=; fh=2K+ssTfQF3FVrwg7pLfxiwEmD7chCV6JLcBMEZWCyjw=; b=Z4OWRC4OqJG9pkyjiopYo0t1RKDo1h8FtJ4aexxgJY4V1XSGl+NW11HOeT0G7hVYo9 PyM8X9+BjvOMXqpYPI4iA374OV/fQLA/laMfDcO/GwCSyMuMpAvXnYOdZ5J5lImOU1zC aFKjoz9Z2iEV8R9whk39roYRuSEjUvNVdzxvSTnZ1IM1zbXs4SYlzbyOndn+rimlrI10 5hiY17P34MUzBK9c/6ZfweEjAl+gzm+GU/2D+5qBzY0dj0t2wn1uigbvM4qFpumbAjOV rbhiJFd4hpBEo+kVDvVZfscwwrzNdWbg/mBqTJ9lssHM33TEedCha6vWNA57QdrdZ+rT lmqg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="vjP/yYrv"; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-130682-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130682-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d22-20020a05620a241600b0078a433bacb7si17508444qkn.26.2024.04.03.15.25.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 15:25:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130682-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="vjP/yYrv"; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-130682-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130682-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 4D5991C274F5 for ; Wed, 3 Apr 2024 22:24:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4267A156C41; Wed, 3 Apr 2024 22:24:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="vjP/yYrv" Received: from out-189.mta0.migadu.com (out-189.mta0.migadu.com [91.218.175.189]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A944A156979 for ; Wed, 3 Apr 2024 22:24:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712183073; cv=none; b=kU16TGd3lSFUv0ku7ubCx+xXWWmXlr13Ypeu8KuykpgBYlT2fjfIcaX00uP7/5NZ1zZK9OnudFlB/xwXW/QQndLhh7kuwkEkrDc90lKTblAmMGrmVPOz9YjA4ZtKCOdUdDnbLZ/cNehTpi63mgY6mmX9O3jaUzpxgpo9lIQgUwA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712183073; c=relaxed/simple; bh=LNCSPovg0Yr0f5AT+54kFFxIj5VkH82mvFV2YH+a9nE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gfaAOXO+gQJQm/okErLLYhotHW/sVC4V9lkzeu6fJh6hXQIyGQ1ZN93qlFsjwUTdjUcTLk4MvKncVXCCus17wgTZdlcQAs7/2WUUVy2yMTn8ymTyd0BFtI5rSVZjO+pniix97Qljs5ogHjsceHGjtDiALkINPrK6++CaMUDTVQY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=vjP/yYrv; arc=none smtp.client-ip=91.218.175.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Wed, 3 Apr 2024 18:24:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1712183069; 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=m2bIqvAswIgDrceINf7iI+jp9YVPIpyS4ScRls8ALPo=; b=vjP/yYrvtF19e9GfRt/XiqymxaisEEbkdtyuuCJTe5x3Tzrxf7uToW6LSjpKH1aM+fIeK0 P9E8Bz3M+ETRXVDhyGNKvROLYhHwrlU+63KTdjYO4b8Kviblvao04uSo5uDEb+Xz95wKRS QhWTv+BTLyRzNRskMf78GaGa3slcvU8= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Tejun Heo Cc: Jan Kara , Kemeng Shi , akpm@linux-foundation.org, willy@infradead.org, bfoster@redhat.com, dsterba@suse.com, mjguzik@gmail.com, dhowells@redhat.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v2 0/6] Improve visibility of writeback Message-ID: References: <20240403162716.icjbicvtbleiymjy@quack3> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT On Wed, Apr 03, 2024 at 09:21:37AM -1000, Tejun Heo wrote: > Hello, > > On Wed, Apr 03, 2024 at 03:06:56PM -0400, Kent Overstreet wrote: > ... > > That's how it should be if you just make a point of making your internal > > state easy to view and introspect, but when I'm debugging issues that > > run into the wider block layer, or memory reclaim, we often hit a wall. > > Try drgn: > > https://drgn.readthedocs.io/en/latest/ > > I've been adding drgn scripts under tools/ directory for introspection. > They're easy to write, deploy and ask users to run. Which is still inferior to simply writing to_text() functions for all your objects and exposing them under sysfs/debugfs. Plus, it's a whole new language/system for boths devs and users to learn. And having to_text() functions makes your log and error messages way better. "But what about code size/overhead?" - bullshit, we're talking about a couple percent of .text for the code itself; we blow more memory on permament dentries/inodes due to the way our virtual filesystems work but that's more of a problem for tracefs. > > Writeback throttling was buggy for _months_, no visibility or > > introspection or concerns for debugging, and that's a small chunk of > > code. io_uring - had to disable it. I _still_ have people bringing > > issues to me that are clearly memory reclaim related but I don't have > > the tools. > > > > It's not like any of this code exports much in the way of useful > > tracepoints either, but tracepoints often just aren't what you want; > > what you want just to be able to see internal state (_without_ having to > > use a debugger, because that's completely impractical outside highly > > controlled environments) - and tracing is also never the first thing you > > want to reach for when you have a user asking you "hey, this thing went > > wonky, what's it doing?" - tracing automatically turns it into a multi > > step process of decide what you want to look at, run the workload more > > to collect data, iterate. > > > > Think more about "what would make code easier to debug" and less about > > "how do I shove this round peg through the square tracing/BPF slot". > > There's _way_ more we could be doing that would just make our lives > > easier. > > Maybe it'd help classifying visibility into the the following categories: > > 1. Current state introspection. > 2. Dynamic behavior tracing. > 3. Accumluative behavior profiling. > > drgn is great for #1. Tracing and BPF stuff is great for #2 especially when > things get complicated. #3 is the trickest. Static stuff is useful in a lot > of cases but BPF can also be useful in other cases. > > I agree that it's all about using the right tool for the problem. Yeah, and you guys are all about the nerdiest and most overengineered tools and ignoring the basics. Get the simple stuff right, /then/ if there's stuff you still can't do, that's when you start looking at the more complicated stuff.