public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Ian Wienand <iwienand@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] kernel/device-drivers/zram/zram01.sh : add a sync
Date: Thu, 3 Aug 2023 12:52:22 +0200	[thread overview]
Message-ID: <ZMuG5iOmeLH_OhxV@yuki> (raw)
In-Reply-To: <20230803015149.69906-1-iwienand@redhat.com>

Hi!
> diff --git a/testcases/kernel/device-drivers/zram/zram01.sh b/testcases/kernel/device-drivers/zram/zram01.sh
> index 58d233f91..5f3964f6c 100755
> --- a/testcases/kernel/device-drivers/zram/zram01.sh
> +++ b/testcases/kernel/device-drivers/zram/zram01.sh
> @@ -119,6 +119,9 @@ zram_fill_fs()
>  				>/dev/null 2>err.txt || break
>  			b=$(($b + 1))
>  		done
> +                # Give the system time to catch up, otherwise the mm_stat
> +                # checking below can give a false negative
> +		sync

I guess that the files written by the dd above end up in page cache and
are not written out until much later. Does it fix the problem if you add
fdatasync to the dd commandline? That should be faster than using the
big hammer and sysncing the whole system.

>  		if [ $b -eq 0 ]; then
>  			[ -s err.txt ] && tst_res TWARN "dd error: $(cat err.txt)"
>  			tst_brk TBROK "cannot fill zram $i"
> @@ -134,6 +137,9 @@ zram_fill_fs()
>  		fi
>  
>  		mem_used_total=`awk '{print $3}' "/sys/block/zram$i/mm_stat"`
> +		if [ $mem_used_total -eq 0 ]; then
> +			test_res FAIL "/sys/block/zram$i/mm_stat reports 0 size : $(cat /sys/block/zram$i/mm_stat)"
> +		fi
>  		v=$((100 * 1024 * $b / $mem_used_total))
>  		r=`echo "scale=2; $v / 100 " | bc`
>  
> -- 
> 2.41.0
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2023-08-03 10:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-03  1:51 [LTP] [PATCH] kernel/device-drivers/zram/zram01.sh : add a sync Ian Wienand
2023-08-03 10:52 ` Cyril Hrubis [this message]
2023-08-03 10:59   ` Martin Doucha
2023-08-03 11:02     ` Cyril Hrubis
2023-08-03 12:32     ` Ian Wienand
2023-08-08  3:56 ` [LTP] [PATCH v2] kernel/device-drivers/zram/zram01.sh : don't fill from /dev/zero Ian Wienand
2023-08-30  8:20   ` Richard Palethorpe
2023-09-07  6:46     ` Ian Wienand
2023-09-07  8:26       ` Richard Palethorpe
2023-09-08  1:58         ` Ian Wienand
2023-09-07 10:18       ` Martin Doucha
2023-09-07 22:29         ` Ian Wienand
2023-09-08  9:21           ` Martin Doucha
2023-09-12  1:03             ` Ian Wienand
2023-09-13 14:35               ` Richard Palethorpe
2023-09-13 22:21                 ` Ian Wienand
2023-09-14  7:37                   ` Richard Palethorpe
2023-09-14 11:04                     ` Ian Wienand
2023-09-18  8:24                       ` Richard Palethorpe
2023-09-21  1:17                         ` Ian Wienand
2023-09-21  9:34                           ` Richard Palethorpe
2023-09-21  1:12   ` [LTP] [PATCH v3] kernel/device-drivers/zram/zram01.sh : fill with compressible data Ian Wienand
2023-11-22 11:24     ` Richard Palethorpe

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=ZMuG5iOmeLH_OhxV@yuki \
    --to=chrubis@suse.cz \
    --cc=iwienand@redhat.com \
    --cc=ltp@lists.linux.it \
    /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