From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Filipe Manana <fdmanana@kernel.org>, Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 2/7] btrfs: reduce the log level for btrfs_dev_stat_inc_and_print()
Date: Fri, 15 Mar 2024 06:56:13 +1030 [thread overview]
Message-ID: <0d28c03f-56f1-4c7c-b278-bf5ea6de08e7@gmx.com> (raw)
In-Reply-To: <CAL3q7H7hMVH+YcTY1LufgjTHjKKc6AQyOb-RmppHBskf4h0wDQ@mail.gmail.com>
在 2024/3/15 03:47, Filipe Manana 写道:
> On Thu, Mar 14, 2024 at 9:54 AM Qu Wenruo <wqu@suse.com> wrote:
>>
>> Currently when we increase the device statistics, it would always lead
>> to an error message in the kernel log.
>>
>> I would argue this behavior is not ideal:
>>
>> - It would flood the dmesg and bury real important messages
>> One common scenario is scrub.
>> If scrub hit some errors, it would cause both scrub and
>> btrfs_dev_stat_inc_and_print() to print error messages.
>>
>> And in that case, btrfs_dev_stat_inc_and_print() is completely
>> useless.
>>
>> - The results of btrfs_dev_stat_inc_and_print() is mostly for history
>> monitoring, doesn't has enough details
>>
>> If we trigger the errors during regular read, such messages from
>> btrfs_dev_stat_inc_and_print() won't help us to locate the cause
>> either.
>>
>> The real usage for the btrfs device statistics is for some user space
>> daemon to check if there is any new errors, acting like some checks on
>> SMART, thus we don't really need/want those messages in dmesg.
>>
>> This patch would reduce the log level to debug (disabled by default) for
>> btrfs_dev_stat_inc_and_print().
>> For users really want to utilize btrfs devices statistics, they should
>> go check "btrfs device stats" periodically, and we should focus the
>> kernel error messages to more important things.
>
> Not sure if this is the right thing to do.
>
> In the scrub context it can be annoying for sure.
> Other cases I'm not so sure about, because having error messages in
> dmesg/syslog may help notice issues more quickly.
For non-scrub cases, I'd argue we already have enough output:
No matter if the error is fixed or not, every time a mirror got csum
mismatch or other errors, we already have error message output:
Data: btrfs_print_data_csum_error()
Meta: btrfs_validate_extent_buffer()
For repaired ones, we have extra output from bio layer for both metadata
and data:
btrfs_repair_io_failure()
So I'd say the dev_stat ones are already duplicated.
Thanks,
Qu
>
>>
>> CC: stable@vger.kernel.org
>> Signed-off-by: Qu Wenruo <wqu@suse.com>
>> ---
>> fs/btrfs/volumes.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
>> index e49935a54da0..126145950ed3 100644
>> --- a/fs/btrfs/volumes.c
>> +++ b/fs/btrfs/volumes.c
>> @@ -7828,7 +7828,7 @@ void btrfs_dev_stat_inc_and_print(struct btrfs_device *dev, int index)
>>
>> if (!dev->dev_stats_valid)
>> return;
>> - btrfs_err_rl_in_rcu(dev->fs_info,
>> + btrfs_debug_rl_in_rcu(dev->fs_info,
>> "bdev %s errs: wr %u, rd %u, flush %u, corrupt %u, gen %u",
>> btrfs_dev_name(dev),
>> btrfs_dev_stat_read(dev, BTRFS_DEV_STAT_WRITE_ERRS),
>> --
>> 2.44.0
>>
>>
>
next prev parent reply other threads:[~2024-03-14 20:26 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-14 9:50 [PATCH 0/6] btrfs: scrub: refine the error messages Qu Wenruo
2024-03-14 9:50 ` [PATCH 1/7] btrfs: scrub: fix incorrectly reported logical/physical address Qu Wenruo
2024-03-14 12:24 ` Anand Jain
2024-03-14 20:15 ` Qu Wenruo
2024-04-04 20:01 ` David Sterba
2024-03-14 17:10 ` Filipe Manana
2024-03-14 9:50 ` [PATCH 2/7] btrfs: reduce the log level for btrfs_dev_stat_inc_and_print() Qu Wenruo
2024-03-14 17:17 ` Filipe Manana
2024-03-14 20:26 ` Qu Wenruo [this message]
2024-03-18 19:54 ` Filipe Manana
2024-03-14 9:50 ` [PATCH 3/7] btrfs: scrub: remove unused is_super parameter from scrub_print_common_warning() Qu Wenruo
2024-03-14 17:19 ` Filipe Manana
2024-03-14 9:50 ` [PATCH 4/7] btrfs: scrub: remove unnecessary dev/physical lookup for scrub_stripe_report_errors() Qu Wenruo
2024-03-14 17:26 ` Filipe Manana
2024-03-14 20:28 ` Qu Wenruo
2024-03-18 16:16 ` Filipe Manana
2024-03-18 19:53 ` Qu Wenruo
2024-03-14 9:50 ` [PATCH 5/7] btrfs: scrub: simplify the inode iteration output Qu Wenruo
2024-03-14 17:29 ` Filipe Manana
2024-03-14 9:50 ` [PATCH 6/7] btrfs: scrub: unify and shorten the error message Qu Wenruo
2024-03-14 17:40 ` Filipe Manana
2024-03-14 20:56 ` Qu Wenruo
2024-03-18 16:26 ` Filipe Manana
2024-03-18 20:00 ` Qu Wenruo
2024-03-14 23:05 ` kernel test robot
2024-03-15 11:44 ` kernel test robot
2024-03-14 9:50 ` [PATCH 7/7] btrfs: scrub: fix the frequency of error messages Qu Wenruo
2024-03-14 17:51 ` Filipe Manana
2024-03-14 20:32 ` Qu Wenruo
2024-03-14 17:35 ` [PATCH 0/6] btrfs: scrub: refine the " Boris Burkov
2024-03-14 20:30 ` Qu Wenruo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0d28c03f-56f1-4c7c-b278-bf5ea6de08e7@gmx.com \
--to=quwenruo.btrfs@gmx.com \
--cc=fdmanana@kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=wqu@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox