Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3357617pxb; Mon, 25 Jan 2021 13:53:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWRjiVfQ2qfTS8ClqLk+N9HiZDTT8GtTE44lvCEGRTggot3dXO18L8Duw7dT363ZFl0OS6 X-Received: by 2002:a17:906:76c9:: with SMTP id q9mr1636219ejn.484.1611611630950; Mon, 25 Jan 2021 13:53:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611611630; cv=none; d=google.com; s=arc-20160816; b=NXFTXdKtBYb6ATEL1YAnZEpq3L10+KmVkNfW4WGXlRYGciGTMEcuSXwvB/wwLKAaXf Ug1WgNrYN7NoLX4Gn2Xm9DbcYX/R9TnM7xzXJYWl4n6+BSwubi0PVWxmkJOeczaw/s1y g0SHLve8321f56hzu+MQBuzXmy/IYtLjWbmo9Z7fdqidLccKbduIKD+aiMnRXlw2fu/B SUCn55KeSmvBNU9pOuS9sVMwNjwKZMV2b33kfX0+0Ce+YI54E6eOX+Z8EgWy9wmTgQcs OIu5zXzO8CqYF/0BMedZTXF981XajvucQgLw2M5u5mx5djkePCkQSqzJUo/TqIZoCDb4 jIng== 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:date; bh=F7c/zWr5bJ9uEaexaEfhVO6jGWEZ62+b4HrQHyXyuaY=; b=oIO1CGQW6nt3mwyaVrRkE32nYbX4Vj1YwL7eLmpgHdoUvqxybQZsIGTNjR/hQUtK8C FWvfQaNRW4FE4bl1sS3UqxC5Lzxp+5vsq5OVuVH7V70IOHjAMW6MtxBp3OpNt4ORpmlS S0zWfFy4tzYYw1XtmfJ5MsPUrckkDf23G6bkTMkJ4TfyPlA1gR6dy1Sc90akNVVY4dOL Ww2lDrqTwbnMZCLMoc7Un7IuOEyHmLSX+R6ile8I9DuiBwYzw5NACwYck+lFNmVVlO17 P4+grodOFXKzxw2R16bdeX2LktLWCD4LuZtKUOCVz5UAetc2MYlVZMtbfqRLwXKtYfVe u1lg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id by3si7819377edb.233.2021.01.25.13.53.26; Mon, 25 Jan 2021 13:53:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732844AbhAYVwo (ORCPT + 99 others); Mon, 25 Jan 2021 16:52:44 -0500 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:57748 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732754AbhAYVvv (ORCPT ); Mon, 25 Jan 2021 16:51:51 -0500 Received: from cwcc.thunk.org (pool-72-74-133-215.bstnma.fios.verizon.net [72.74.133.215]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 10PLoo2p011874 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Jan 2021 16:50:51 -0500 Received: by cwcc.thunk.org (Postfix, from userid 15806) id 35C1515C3709; Mon, 25 Jan 2021 16:50:50 -0500 (EST) Date: Mon, 25 Jan 2021 16:50:50 -0500 From: "Theodore Ts'o" To: Chunguang Xu Cc: adilger.kernel@dilger.ca, jack@suse.com, harshadshirwadkar@gmail.com, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v2 0/4] make jbd2 debug switch per device Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 23, 2021 at 08:00:42PM +0800, Chunguang Xu wrote: > On a multi-disk machine, because jbd2 debugging switch is global, this > confuses the logs of multiple disks. It is not easy to distinguish the > logs of each disk and the amount of generated logs is very large. Maybe > a separate debugging switch for each disk would be better, so that we > can easily distinguish the logs of a certain disk. > > We can enable jbd2 debugging of a device in the following ways: > echo X > /proc/fs/jbd2/sdX/jbd2_debug > > But there is a small disadvantage here. Because the debugging switch is > placed in the journal_t object, the log before the object is initialized > will be lost. However, usually this will not have much impact on > debugging. The jbd debugging infrastructure dates back to the very beginnings of ext3, when Stephen Tweedie added them while he was first implementing the jbd layer. So this dates back to a time before we had other schemes like dynamic debug or tracepoints or eBPF. I wonder if instead of trying to enhance our own bespoke debugging system, instead we set up something like tracepoints where they would be useful. I'm not proposing that we try to replace all jbd_debug() statements with tracepoints but I think it would be useful to look at what sort of information would actually be *useful* on a production server, and add those tracepoints to the jbd2 layer. What I like about tracepoints is you can enable them on a much more fine-grained fashion; information is sent to userspace in a much more efficient manner than printk; you can filter tracepoint events in the kernel, before sending them to userspace; and if you want more sophisticated filtering or aggregation, you can use eBPF. What was the original use case which inspired this? Were you indeed trying to debug some kind of problem on a production system? (Why did you have multiple disks active at the same time?) Was there a specific problem you were trying to debug? What debug level were you using? Which jbd_debug statements were most useful to you? Which just got in the way (but which had to be enabled given the log level you needed to get the debug messages that you needed)? - Ted