linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eryu Guan <guan@eryu.me>
To: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Cc: fstests@vger.kernel.org, riteshh@linux.ibm.com,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ext4/053: Add support for testing mb_optimize_scan
Date: Sun, 10 Apr 2022 20:48:57 +0800	[thread overview]
Message-ID: <YlLSObvNaXxrrZkw@desktop> (raw)
In-Reply-To: <5b0d252484cbe973c2df0c677cb47b30012b0db1.1647253313.git.ojaswin@linux.ibm.com>

On Mon, Mar 14, 2022 at 04:02:07PM +0530, Ojaswin Mujoo wrote:
> Add support to test the mb_optimize_scan mount option.
> Since its value is not reflected in the "options" file in proc,
> use "mb_structs_summary" to verify its value.
> 
> Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>

mb_optimize_scan option was added in v5.13 by commit 196e402adf2e ("ext4:
improve cr 0 / cr 1 group scanning"), and ext4/053 will run on v5.12
kernel (and newer kernels), so test will fail when testing v5.12 kernel.

> ---
>  tests/ext4/053 | 21 ++++++++++++---------
>  1 file changed, 12 insertions(+), 9 deletions(-)
> 
> diff --git a/tests/ext4/053 b/tests/ext4/053
> index e1e79592..bd92002f 100755
> --- a/tests/ext4/053
> +++ b/tests/ext4/053
> @@ -100,6 +100,7 @@ test_mnt() {
>  	(
>  	ret=0
>  	IFS=','
> +	proc_path="/proc/fs/ext4/$(_short_dev $SCRATCH_DEV)"
>  	for option in $OPTS; do
>  		if echo $IGNORED | grep -w $option; then
>  			continue
> @@ -114,11 +115,16 @@ test_mnt() {
>  		fi
>  		option=${option#^}
>  
> -		if echo $CHECK_MINFO | grep -w $option; then
> +		if [[ $option =~ ^mb_optimize_scan=.*$ ]]; then
> +			# mb_optimize_scan needs special handling
> +			expected=${option#*=}
> +			ret=$(cat $proc_path/mb_structs_summary | grep "optimize_scan" \
> +				| awk '{ print $2 }')
> +		elif echo $CHECK_MINFO | grep -w $option; then
>  			findmnt -n -o OPTIONS $SCRATCH_DEV | grep $option
>  			ret=$?
>  		else
> -			grep $option /proc/fs/ext4/$(_short_dev $SCRATCH_DEV)/options
> +			grep $option $proc_path/options
>  			ret=$?
>  		fi
>  
> @@ -526,13 +532,10 @@ for fstype in ext2 ext3 ext4; do
>  
>  	mnt prefetch_block_bitmaps removed
>  	mnt no_prefetch_block_bitmaps
> -	# We don't currently have a way to know that the option has been
> -	# applied, so comment it out for now. This should be fixed in the
> -	# future.

As the comment said, we need a way to know if mb_optimize_scan option is
supported by current kernel.

Thanks,
Eryu

> -	#mnt mb_optimize_scan=0
> -	#mnt mb_optimize_scan=1
> -	#not_mnt mb_optimize_scan=9
> -	#not_mnt mb_optimize_scan=
> +	mnt mb_optimize_scan=0
> +	mnt mb_optimize_scan=1
> +	not_mnt mb_optimize_scan=9
> +	not_mnt mb_optimize_scan=
>  	mnt nombcache
>  	mnt no_mbcache nombcache
>  	mnt check=none removed
> -- 
> 2.27.0

      parent reply	other threads:[~2022-04-10 12:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-14 10:32 [PATCH] ext4/053: Add support for testing mb_optimize_scan Ojaswin Mujoo
2022-03-14 14:20 ` Ritesh Harjani
2022-04-10 12:48 ` Eryu Guan [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=YlLSObvNaXxrrZkw@desktop \
    --to=guan@eryu.me \
    --cc=fstests@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ojaswin@linux.ibm.com \
    --cc=riteshh@linux.ibm.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).