Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp673074lqh; Thu, 28 Mar 2024 12:40:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVN7q6z7Fl8gbRMsKYTkMiiLRVO/l882woMFwmbmQOQgI1DO3dWHJdntN5BJSeUdbW+yL9aneRJML+9PfWpuoPYEEW9/pO17S/tHCFvaw== X-Google-Smtp-Source: AGHT+IEastAhpz7KwWgsnqiDDNdzp3YbEYIemjUyc4Z/Q41Q8epJkDeFU5vSUHHFnISPzcJNTLGl X-Received: by 2002:a05:6402:5201:b0:56c:4e2:5a4e with SMTP id s1-20020a056402520100b0056c04e25a4emr197970edd.1.1711654824534; Thu, 28 Mar 2024 12:40:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711654824; cv=pass; d=google.com; s=arc-20160816; b=M64KQz1P9cXq99n7FXedMcrqjGdVIWdedDLMDq8WythwUYG8bmluDuC4mw6oj5F9Fw GgB0v+v/HgbMc3cseGuZlSBnDY/OeJatDhQ2ObKgfLg4J/Fpa4Y6ECyr03VfcITY3u8T jQjRxxoJ7zTQ2Zen93nwQbLOCcipG/vIbWKT9g/UFQsUtCq0N/RDAqXeORpsSGr8kua1 eLl332hEQChu2H16KtoxFIXBprwoUfWhCofHR9xg3b1fPy2zKPlUNRKoWZEKVBUQmOuV 3wcj0JYHnA8DHz6jyYy4ZnMNkhBBY/PF3ep0fFb2TcIIm3sIC9HUtEAOTApB8uMY+0v2 cN+Q== 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=4N45qEzZ33lTnFLFuDGUaQID+Buaapoa/kxgDVnQPks=; fh=JYyhVAcStIY1lJrQSdbMBNHKqT1iSuFrmz0Tsoevt28=; b=pBT+hAaa14jwOA+oiCGE27RLs0OBIxPBvtyVbJEGGEp8gtAHl3JJa7tzX5GpGlySjo 1CiyKH0DxiZ+l9WRWpwE43oR5ATjhm7x5fDm6wOrY/NYTs3Cn3G04cq2idJMSZXhj29O 3dwIkwEcIV2wVn7tatu44DyISu6CxHcB5VnuQwZyNXdaQlzPhDp6dcU5LjfmbuFMH6u0 IoXHY66HoFesWaSacINryCs4h0tj8ja40zyw+kTMbER3aLqJGZAVBYdMrQno/4uilEId tp+TplzhuIFY6B/Avd0NJMXjYaixogGUoUCULrhJGQ8GrHa0P67QgLSyNtNRqUzngFf3 SlnQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=syslETbc; 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-123491-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123491-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id s17-20020a50d491000000b0056c2d5c4831si1037004edi.640.2024.03.28.12.40.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 12:40:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123491-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=syslETbc; 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-123491-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123491-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 4643C1F23519 for ; Thu, 28 Mar 2024 19:40:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EEFB81386A8; Thu, 28 Mar 2024 19:40:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="syslETbc" Received: from out-186.mta0.migadu.com (out-186.mta0.migadu.com [91.218.175.186]) (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 9A0C980617 for ; Thu, 28 Mar 2024 19:40:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711654811; cv=none; b=eNgeadTQPnQPQ65RpuStShWWJJCrQt72Ux0jc8KKYFyiIv+wU4GIYvM76GqGNaBMr6N21OABX78z9I+tv3gyZ6plwQF9duvsYoGcaXVyuXaspdfupKCsGYCMerfdeGelXwhr0pyUMsC3k6R8NRLjruiCYsePKHIRVRpoxMp6+mk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711654811; c=relaxed/simple; bh=ZtjZFLPTiVQORRAF/RvtX0zAM7xjZumGM16VWdWmwYM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QLCYyTn5qpTZnznVydbQPJKbt9pfGYlapxxn+30GhSNpOZC0E45PdU7x1fRxxK+NfGQ0T4RB+r3st95/NcF92j08u5EplWe1BK6Mhwfd14q6ZSdRG/kHAMh6rEIBregj/v4E76VNBtfl2Bp5oYOwmQ8y34KcKnFZx9Q6PnexZE4= 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=syslETbc; arc=none smtp.client-ip=91.218.175.186 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: Thu, 28 Mar 2024 15:40:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1711654805; 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=4N45qEzZ33lTnFLFuDGUaQID+Buaapoa/kxgDVnQPks=; b=syslETbcnuA4+bTAebP8fFAZFJWkAPqOUGHPC/c7H8OsQKPYKuszwdcPAPziypUvK7VRON FYz4SJudL+GgLZ2i6ep+wIfLO3fvs4ljgVuyJ9TDhKfjEErsFXReVX3yE0vUrczBvLYc6B CoGaZEpqCtASwzitAUPr+aUJWD0BhaY= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Tejun Heo Cc: Kemeng Shi , akpm@linux-foundation.org, willy@infradead.org, jack@suse.cz, 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: <20240327155751.3536-1-shikemeng@huaweicloud.com> 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 Thu, Mar 28, 2024 at 09:31:57AM -1000, Tejun Heo wrote: > Hello, Kent. > > On Thu, Mar 28, 2024 at 03:24:35PM -0400, Kent Overstreet wrote: > > fs/bcachefs/time_stats.c has some code that's going to be moving out to > > lib/ at some point, after I switch it to MAD; if you could hook that up > > as well to a few points we could see at a glance if there are stalls > > happening in the writeback path. > > Using BPF (whether through bcc or bpftrace) is likely a better approach for > this sort of detailed instrumentation. Fixed debug information is useful and > it's also a common occurrence that they don't quite reveal the full picture > of what one's trying to understand and one needs to dig a bit deeper, wider, > aggregate data in a different way, or whatever. > > So, rather than adding more fixed infrastructure, I'd suggest adding places > which can easily be instrumented using the existing tools (they are really > great once you get used to them) whether that's tracepoints or just > strategically placed noinline functions. Collecting latency numbers at various key places is _enormously_ useful. The hard part is deciding where it's useful to collect; that requires intimate knowledge of the code. Once you're defining those collection poitns statically, doing it with BPF is just another useless layer of indirection. The time stats stuff I wrote is _really_ cheap, and you really want this stuff always on so that you've actually got the data you need when you're bughunting.