From: Anand Jain <anand.jain@oracle.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/2] fstests: move fs-module reload to earlier in the run_section function
Date: Mon, 18 Nov 2024 08:12:13 +0800 [thread overview]
Message-ID: <817b208b-5009-4d7d-8d9b-63d319dedd73@oracle.com> (raw)
In-Reply-To: <20241115163955.GD9425@frogsfrogsfrogs>
On 16/11/24 00:39, Darrick J. Wong wrote:
> On Fri, Nov 15, 2024 at 11:20:51PM +0800, Anand Jain wrote:
>> Reload the module before each test, instead of later in run_section.
>>
>> Signed-off-by: Anand Jain <anand.jain@oracle.com>
>> ---
>> check | 18 +++++++++---------
>> 1 file changed, 9 insertions(+), 9 deletions(-)
>>
>> diff --git a/check b/check
>> index 9222cd7e4f81..d8ee73f48c77 100755
>> --- a/check
>> +++ b/check
>> @@ -935,6 +935,15 @@ function run_section()
>> continue
>> fi
>>
>> + # Reload the module after each test to check for leaks or
>> + # other problems.
>
> Hrmm. The nice thing about doing the reload /after/ each test is that
> unloading the module will purge any per-fs slab caches that the module
> creates. The slab teardown logs any forgotten objects while $seq still
> points to the test that leaked those objects. Granted it's not a 100%
> solution (that job falls to kmemcheck) but it's a cheap check.
>
> This change makes it so that if test N leaks something, fstests reports
> them for test N+1.
>
Agreed. It's better to report the issue at test N. I'll add this comment
to the code in v2.
Thanks!
Anand
> --D
>
>> + if [ -n "${TEST_FS_MODULE_RELOAD}" ]; then
>> + _test_unmount 2> /dev/null
>> + _scratch_unmount 2> /dev/null
>> + modprobe -r fs-$FSTYP
>> + modprobe fs-$FSTYP
>> + fi
>> +
>> # record that we really tried to run this test.
>> if ((!${#loop_status[*]})); then
>> try+=("$seqnum")
>> @@ -1033,15 +1042,6 @@ function run_section()
>> done
>> fi
>>
>> - # Reload the module after each test to check for leaks or
>> - # other problems.
>> - if [ -n "${TEST_FS_MODULE_RELOAD}" ]; then
>> - _test_unmount 2> /dev/null
>> - _scratch_unmount 2> /dev/null
>> - modprobe -r fs-$FSTYP
>> - modprobe fs-$FSTYP
>> - fi
>> -
>> # Scan for memory leaks after every test so that associating
>> # a leak to a particular test will be as accurate as possible.
>> _check_kmemleak || tc_status="fail"
>> --
>> 2.46.1
>>
>>
next prev parent reply other threads:[~2024-11-18 0:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1731076425.git.anand.jain@oracle.com>
2024-11-15 15:20 ` [PATCH 0/2] fstests: refine filesystem module reload handling Anand Jain
2024-11-15 15:20 ` [PATCH 1/2] fstests: move fs-module reload to earlier in the run_section function Anand Jain
2024-11-15 16:39 ` Darrick J. Wong
2024-11-18 0:12 ` Anand Jain [this message]
2024-11-15 16:48 ` Filipe Manana
2024-11-15 15:20 ` [PATCH 2/2] fstests: FS_MODULE_RELOAD_OPTIONS to control filesystem module reload options Anand Jain
2024-11-15 16:34 ` Darrick J. Wong
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=817b208b-5009-4d7d-8d9b-63d319dedd73@oracle.com \
--to=anand.jain@oracle.com \
--cc=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
/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