From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: "Leizhen (ThunderTown)" <thunder.leizhen@huawei.com>,
dsterba@suse.cz, Chris Mason <clm@fb.com>,
Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>,
linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 1/1] btrfs: tests: remove unnecessary oom message
Date: Wed, 23 Jun 2021 22:41:42 +0200 [thread overview]
Message-ID: <20210623204142.GN28158@twin.jikos.cz> (raw)
In-Reply-To: <55b0c70b-f0c1-07e2-f8dd-073f4fdc8f07@gmx.com>
On Fri, Jun 18, 2021 at 02:05:59PM +0800, Qu Wenruo wrote:
> On 2021/6/18 下午1:58, Qu Wenruo wrote:
> > On 2021/6/18 上午10:33, Leizhen (ThunderTown) wrote:
> >> On 2021/6/18 4:35, David Sterba wrote:
> >>> On Thu, Jun 17, 2021 at 04:30:53PM +0800, Zhen Lei wrote:
> >>>> Fixes scripts/checkpatch.pl warning:
> >>>> WARNING: Possible unnecessary 'out of memory' message
> >>>>
> >>>> Remove it can help us save a bit of memory.
> >>>
> >>> Well, we have a few more messages in tests regarding failed memory
> >>> allocations. Though I've never seen one in practice, I think it's not
> >>> a big deal to have that one here as well. The failures in the testsuite
> >>> are intentionally verbose and saving a few bytes in optional development
> >>> feature hardly bothers anyone.
> >>
> >> The calltrace of the OOM message contains all the information printed by
> >> test_err() here. I don't think anyone wants to see a bunch of
> >> unhelpful tips
> >> when locating an OOM problem.
> >
> > This only get enabled for btrfs developers, in production environment
> > would enable CONFIG_BTRFS_FS_RUN_SANITY_TESTS=y.
> >
> > Thus this error message are only for btrfs developers.
> >
> > And I'm 100% sure you won't need to investigate such OOM problem, nor
> > even see it.
> >
> >>> Where bytes can be saved are error messages for the same type of error,
> >>
> >> It also saves a dozen bytes of binary code.
> >
> > It won't make any different as you won't enable that config.
> >
> >>> that I've implemented in the past, see file fs/btrfs/tests/btrfs-tests.c
> >>> array test_error that maps enums to strings.
> >>
> >> As mentioned above, I don't think these "no memory" strings are
> >> necessary,
> >> unless the rest of the test can continue to run healthy. Otherwise, no
> >> one trusts
> >> the test results in the OOM situation. They're going to locate the OOM
> >> problem
> >> first, and these information are pointless. >
>
> And nope, it's not only OOM can cause the selftest to fail, but also
> error injection.
>
> I guess you never ran error injection tests for filesystems.
>
> Under most case, we inject error with specific call chain, but sometimes
> without any call chain specification, error injection may find some
> corner cases we're unaware of.
>
> If by chance the injected memory allocation failure happens during
> selftest, there will be *NO* OOM dump at all.
Yeah, a hard OOM won't probably happen and the allocations can fail for
other valid reasons. The error message in the logs, with the ERROR
message level is clear and helpful. Saving a few bytes here does not
make much sense.
prev parent reply other threads:[~2021-06-23 20:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-17 8:30 [PATCH 1/1] btrfs: tests: remove unnecessary oom message Zhen Lei
2021-06-17 20:35 ` David Sterba
2021-06-18 2:33 ` Leizhen (ThunderTown)
2021-06-18 5:58 ` Qu Wenruo
2021-06-18 6:05 ` Qu Wenruo
2021-06-23 20:41 ` David Sterba [this message]
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=20210623204142.GN28158@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=quwenruo.btrfs@gmx.com \
--cc=thunder.leizhen@huawei.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;
as well as URLs for NNTP newsgroup(s).