Re: [PATCH 1/1] btrfs: tests: remove unnecessary oom message
From: Leizhen (ThunderTown) <hidden>
Date: 2021-06-18 02:33:57
On 2021/6/18 4:35, David Sterba wrote:
On Thu, Jun 17, 2021 at 04:30:53PM +0800, Zhen Lei wrote:quoted
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.
Where bytes can be saved are error messages for the same type of error,
It also saves a dozen bytes of binary code.
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.
.