From: "Darrick J. Wong" <djwong@kernel.org>
To: Anand Jain <anand.jain@oracle.com>
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: Fri, 15 Nov 2024 08:39:55 -0800 [thread overview]
Message-ID: <20241115163955.GD9425@frogsfrogsfrogs> (raw)
In-Reply-To: <7af8f80173fab5408da86f5b3393e787659a81d6.1731683116.git.anand.jain@oracle.com>
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.
--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-15 16:39 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-15 14:54 [PATCH v3 00/10] raid1 balancing methods Anand Jain
2024-11-15 14:54 ` [PATCH v3 01/10] btrfs: initialize fs_devices->fs_info earlier Anand Jain
2024-11-15 14:54 ` [PATCH v3 02/10] btrfs: simplify output formatting in btrfs_read_policy_show Anand Jain
2024-11-15 14:54 ` [PATCH v3 03/10] btrfs: add btrfs_read_policy_to_enum helper and refactor read policy store Anand Jain
2024-12-06 16:47 ` David Sterba
2024-11-15 14:54 ` [PATCH v3 04/10] btrfs: handle value associated with raid1 balancing parameter Anand Jain
2024-12-06 16:53 ` David Sterba
2024-12-16 9:38 ` Anand Jain
2024-11-15 14:54 ` [PATCH v3 05/10] btrfs: introduce RAID1 round-robin read balancing Anand Jain
2024-11-18 7:34 ` kernel test robot
2024-12-06 17:13 ` David Sterba
2024-12-16 9:34 ` Anand Jain
2024-11-15 14:54 ` [PATCH v3 06/10] btrfs: add RAID1 preferred read device Anand Jain
2024-11-15 14:54 ` [PATCH v3 07/10] btrfs: pr CONFIG_BTRFS_EXPERIMENTAL status Anand Jain
2024-12-06 17:16 ` David Sterba
2024-12-16 15:14 ` Anand Jain
2024-12-06 17:18 ` David Sterba
2024-11-15 14:54 ` [PATCH v3 08/10] btrfs: fix CONFIG_BTRFS_EXPERIMENTAL migration Anand Jain
2024-11-15 14:54 ` [PATCH v3 09/10] btrfs: enable RAID1 balancing configuration via modprobe parameter Anand Jain
2024-11-15 14:54 ` [PATCH v3 10/10] btrfs: modload to print RAID1 balancing status Anand Jain
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 [this message]
2024-11-18 0:12 ` Anand Jain
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
2024-11-15 19:16 ` [PATCH v3 00/10] raid1 balancing methods Filipe Manana
2024-11-18 1:15 ` Anand Jain
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=20241115163955.GD9425@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=anand.jain@oracle.com \
--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