From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id F40D7CD128A for ; Wed, 3 Apr 2024 19:21:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 58AC06B008A; Wed, 3 Apr 2024 15:21:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 513906B008C; Wed, 3 Apr 2024 15:21:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 38D456B0093; Wed, 3 Apr 2024 15:21:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 183AA6B008A for ; Wed, 3 Apr 2024 15:21:43 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id BBBCC40E9C for ; Wed, 3 Apr 2024 19:21:42 +0000 (UTC) X-FDA: 81969190044.28.CF9D4AF Received: from mail-oa1-f52.google.com (mail-oa1-f52.google.com [209.85.160.52]) by imf28.hostedemail.com (Postfix) with ESMTP id D56E5C0002 for ; Wed, 3 Apr 2024 19:21:40 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=MguuOkHc; spf=pass (imf28.hostedemail.com: domain of htejun@gmail.com designates 209.85.160.52 as permitted sender) smtp.mailfrom=htejun@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712172100; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=71eP4QlMczx2Y4yJ5dvBU+fua5ttQveVgsrybppYBU4=; b=x2WJAufHiObVfRDjYG5S73ApEuHMIuTJh4jbK/+4kZidBXnFpo4aCKkwEG3UP7NBbPOhzL dQolRM5guJsSgOk51GjH71cyLaOumEvrRSNsbqt3xIcAx0AMwJYIx65yUA39xBjb351EgN 2jEBlXV/nzZGmAaXh4zqAhg8iPEKH08= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712172100; a=rsa-sha256; cv=none; b=0XAsRyGiU1qn5rjAqwPcIOeOIeF9vuFFpCM3xKS07iI5LSJVqOhEPhESyWtudPi+DnDg6k ZDlhP079kV55EkBDbk0wG/EVT2TN//lNuohTg0d58897i74/kt2Uk6MIgyVHUUd3psQylE 65XcZ24Ba0l3G0Ry+Q4Xmm7cT7YetJs= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=MguuOkHc; spf=pass (imf28.hostedemail.com: domain of htejun@gmail.com designates 209.85.160.52 as permitted sender) smtp.mailfrom=htejun@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none) Received: by mail-oa1-f52.google.com with SMTP id 586e51a60fabf-22a1e72f683so124502fac.0 for ; Wed, 03 Apr 2024 12:21:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712172100; x=1712776900; darn=kvack.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=71eP4QlMczx2Y4yJ5dvBU+fua5ttQveVgsrybppYBU4=; b=MguuOkHcfKgAvj0hYniRP+5+bjkKcZ4MS3lrmMjxlDpMFVhYFK1Fg97ZJ8gMw9+UjU mHn6BZV+DR/osAItc2dM+4x0fcSESqMTjSCBrRd0eb+4pTl1tyQjVQci6ocSstrvAih2 yzKwHHfBQ3JMPEMtX9D39sKe4oZx0qIpoWQs9hTlRIzr/YiMWGQAEZjypzkzZzt21p3N YWkc6LQVAwU0449XmtEEkGOpwjSbJnm/EVuuaJQg99bW4TQE4DId7oan8Zb5PD/BeuRW BPtbTvUeg8kdPwUmVMp8nhr/Y6w9WFJmDLAzVlYMQjlMn40dD0GNPvVtESsyBLaUKb2i z6Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712172100; x=1712776900; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=71eP4QlMczx2Y4yJ5dvBU+fua5ttQveVgsrybppYBU4=; b=JsC6ew2+1frnhrUnuNOKIxuErpnRKNH/VN92R8JLwKozCrTQ6Nxo2n56YmOjuUODT0 EVCXqgs2PMmrJ7VezatrXNIWgHZz+subf6lWOH8fc8a/EOAbfEB+DAwXqsQDyWlT8yde ZNNcCwp04gCaFEsErZvC6htJegrq4GPLjs9y0nUfT9tLcY7WfEFUJ8+TWnUZIFIUOclY LtAStxbxMdwGY+SlXghU5Tu02PPkyPYWGc7y4BzLFy0yQVHFb8h0GJWgFlPQyjJ7rdfk yAgr9B36IwRptFa9/W90u78MMT6Y+pAmw8/fRP00WYazj75gPT1AF8uTPrBDad2/dd6r yUSQ== X-Forwarded-Encrypted: i=1; AJvYcCXU85SB5S5WKVr0jayhHD9nqYFUd648Q3Ug3WgodgObyjefv16lpDHo7VNpOoT8BnPGVZ0kJC60dfAtwwIZ235mM5k= X-Gm-Message-State: AOJu0YweSe/V8zRjPhXjiM2zfFg05jzJYU0sfifK2JrslmAriWhZbvA9 5tvUW/dDe6iQ3l9aj9imLS0+Gb4woAzHXDBXe4muQ2RL6G+MkXKM X-Google-Smtp-Source: AGHT+IEe45VMj3vsXzq43ZjMpWFWOEnem3jMe583txSo/lZHOb7SmqUEVgxDZIs/8Im/4WJlUGV84Q== X-Received: by 2002:a05:6870:238e:b0:22e:9e53:3fd2 with SMTP id e14-20020a056870238e00b0022e9e533fd2mr300149oap.28.1712172099688; Wed, 03 Apr 2024 12:21:39 -0700 (PDT) Received: from localhost ([2620:10d:c090:400::5:25ab]) by smtp.gmail.com with ESMTPSA id l11-20020a62be0b000000b006e567c81d14sm12115035pff.43.2024.04.03.12.21.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 12:21:39 -0700 (PDT) Date: Wed, 3 Apr 2024 09:21:37 -1000 From: Tejun Heo To: Kent Overstreet 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: ck3cbfsxx1dmspgje6yxaf89bq6eyj16 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: D56E5C0002 X-Rspam-User: X-HE-Tag: 1712172100-622143 X-HE-Meta: U2FsdGVkX1+oWNIzwNDKlsgjHnIJGgCn/I0LI27NEhTx2xr6s3NYpsdkZQXSGf5g1ZNmqu05TRsPGp9bUpaPZ7SBmXxFy0I80wpHjh9u/0fkB8nry7IaEe3MG++Ed4MGTVYkc5GrzXTOaLMHLZQacptUFbq7R0wYAIfitFh93MvIWXBK/ZNgvsW5bYWw1NAn/I00P3i6K/LigHRbr/7NOk9EY2STcBonuZCZTLimkekkJvctfimFmZ0JVqk8Uh1EED1K5Yq6D4BKAlbLn3jwySJ/97ghNC51n0fCx6ONviP5apjgsXsscaXtStezsTyY0gDw93faUtrtWy8cphVT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ns882QcOd6F2CcG3BsKbI2kJxbO8hq0M+nHPLEo6qSaA37BQKWeDwDix6ZuQlcldxrJGxWJ0Fg8lejYGqzeDcBtcYn3IBsJLlYAC3KDw+aJsPcZc92S5CC6xG0fvYS4Gb/cd/T6VUrVzO8KJX+w0SsOhTVR2cPNdRF3aj8dbhupia5B26rCtoKoHmshOaU+UxPiuTUne63Pm7SYcl62qBT77DA= X-Bogosity: Ham, tests=bogofilter, spamicity=0.001203, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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. > 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. -- tejun