btrfs: tests: remove unnecessary oom message
PATCH 1/1 btrfs: tests: remove unnecessary oom message
Fixes scripts/checkpatch.pl warning:
WARNING: Possible unnecessary 'out of memory' message
Remove it can help us save a bit of memory.
--- fs/btrfs/tests/extent-io-tests.c | 1 - 1 file changed, 1 deletion(-)
fs/btrfs/tests/extent-io-tests.c +0 -1
@@ -393,7 +393,6 @@ static int test_eb_bitmaps(u32 sectorsize, u32 nodesize) bitmap =kmalloc (nodesize,GFP_KERNEL );if (!bitmap) { -test_err ("couldn't allocate test bitmap" ); ret = -ENOMEM ; goto out; }
Signature · 1 line
2.25.1
Quoted 4 lines · Zhen Lei
Fixes
scripts/checkpatch.plwarning:
WARNING: Possible unnecessary 'out of memory' messageRemove 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.
Where bytes can be saved are error messages for the same type of error, that I've implemented in the past, see file fs/btrfs/tests/btrfs-tests.c array test_error that maps enums to strings.
Quoted 11 lines · David Sterba
Quoted 4 lines · Zhen Lei
Fixes
scripts/checkpatch.plwarning:
WARNING: Possible unnecessary 'out of memory' messageRemove 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.
Quoted 2 lines
Where bytes can be saved are error messages for the same type of error,
It also saves a dozen bytes of binary code.
Quoted 2 lines
that I've implemented in the past, see file
fs/btrfs/tests/btrfs-tests.carraytest_errorthat 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.
Quoted 3 lines
.
Quoted 15 lines · Leizhen (ThunderTown)
Quoted 11 lines · David Sterba
Quoted 4 lines · Zhen Lei
Fixes
scripts/checkpatch.plwarning:
WARNING: Possible unnecessary 'out of memory' messageRemove 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.
Quoted 3 lines
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.
Quoted 5 lines
Quoted 3 lines
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.
Thanks,
Qu
Quoted 12 lines
Quoted 3 lines
that I've implemented in the past, see file
fs/btrfs/tests/btrfs-tests.carraytest_errorthat 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. >
Quoted 3 lines
.
Quoted 33 lines · Qu Wenruo
Quoted 15 lines · Leizhen (ThunderTown)
Quoted 11 lines · David Sterba
Quoted 4 lines · Zhen Lei
Fixes
scripts/checkpatch.plwarning:
WARNING: Possible unnecessary 'out of memory' messageRemove 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.
Quoted 4 lines
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.
Quoted 2 lines
Quoted 2 lines
Quoted 19 lines
Quoted 3 lines
Quoted 1 line
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.
Thanks,
QuQuoted 11 lines
Quoted 3 lines
that I've implemented in the past, see file
fs/btrfs/tests/btrfs-tests.carraytest_errorthat 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.
In that case, have a good luck investigating why selftest fails.
Your words make sense for common path, but next time before sending such patches to earn your KPI, please dig a little deeper to understand the context.
Thanks,
Qu
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
.
Quoted 48 lines · Qu Wenruo
Quoted 24 lines · Qu Wenruo
Quoted 13 lines · Leizhen (ThunderTown)
Quoted 11 lines · David Sterba
Quoted 4 lines · Zhen Lei
Fixes
scripts/checkpatch.plwarning:
WARNING: Possible unnecessary 'out of memory' messageRemove 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.
Quoted 4 lines
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.
Quoted 19 lines
And I'm 100% sure you won't need to investigate such OOM problem, nor even see it.
Quoted 3 lines
Quoted 1 line
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.
Quoted 10 lines
Quoted 2 lines
that I've implemented in the past, see file
fs/btrfs/tests/btrfs-tests.carraytest_errorthat 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.
Quoted 8 lines
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.