All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Martin Doucha <mdoucha@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2 4/5] readahead02: Add max_runtime
Date: Wed, 14 Sep 2022 22:33:26 +0200	[thread overview]
Message-ID: <YyI6lncfJSTariC1@pevik> (raw)
In-Reply-To: <20220914161930.27681-5-mdoucha@suse.cz>

Hi Martin,

> Also calculate max_runtime dynamically if the test gets called with
> non-default filesize.

> Changes since v1:
> - Added dynamic runtime calculation for non-default filesize

LGTM, thanks!
Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

>  testcases/kernel/syscalls/readahead/readahead02.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)

> diff --git a/testcases/kernel/syscalls/readahead/readahead02.c b/testcases/kernel/syscalls/readahead/readahead02.c
> index 4fa8cfaf8..02e866e82 100644
> --- a/testcases/kernel/syscalls/readahead/readahead02.c
> +++ b/testcases/kernel/syscalls/readahead/readahead02.c
> @@ -38,7 +38,9 @@ static char testfile[PATH_MAX] = "testfile";
>  #define DROP_CACHES_FNAME "/proc/sys/vm/drop_caches"
>  #define MEMINFO_FNAME "/proc/meminfo"
>  #define PROC_IO_FNAME "/proc/self/io"
> -static size_t testfile_size = 64 * 1024 * 1024;
> +#define DEFAULT_FILESIZE (64 * 1024 * 1024)
> +
> +static size_t testfile_size = DEFAULT_FILESIZE;
>  static char *opt_fsizestr;
>  static int pagesize;
>  static unsigned long cached_max;
> @@ -365,8 +367,10 @@ static void setup_readahead_length(void)

>  static void setup(void)
>  {
> -	if (opt_fsizestr)
> +	if (opt_fsizestr) {
>  		testfile_size = SAFE_STRTOL(opt_fsizestr, 1, INT_MAX);
> +		tst_set_max_runtime(1 + testfile_size / (DEFAULT_FILESIZE/32));
> +	}

>  	if (access(PROC_IO_FNAME, F_OK))
>  		tst_brk(TCONF, "Requires " PROC_IO_FNAME);
> @@ -406,6 +410,7 @@ static struct tst_test test = {
>  	},
>  	.test = test_readahead,
>  	.tcnt = ARRAY_SIZE(tcases),
> +	.max_runtime = 30,
>  	.tags = (const struct tst_tag[]) {
>  		{"linux-git", "b833a3660394"},
>  		{"linux-git", "5b910bd615ba"},

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

  reply	other threads:[~2022-09-14 20:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-14 16:19 [LTP] [PATCH v2 0/5] Max_runtime timeout fixes Martin Doucha
2022-09-14 16:19 ` [LTP] [PATCH v2 1/5] ioctl_sg01: Add max_runtime Martin Doucha
2022-09-14 20:27   ` Petr Vorel
2022-09-15 11:51   ` Cyril Hrubis
2022-09-14 16:19 ` [LTP] [PATCH v2 2/5] copy_file_range01: " Martin Doucha
2022-09-14 20:30   ` Petr Vorel
2022-09-14 16:19 ` [LTP] [PATCH v2 3/5] perf_event_open02: " Martin Doucha
2022-09-14 20:31   ` Petr Vorel
2022-09-15 13:43   ` Cyril Hrubis
2022-09-14 16:19 ` [LTP] [PATCH v2 4/5] readahead02: " Martin Doucha
2022-09-14 20:33   ` Petr Vorel [this message]
2022-09-15 13:53   ` Cyril Hrubis
2022-09-15 14:08     ` Martin Doucha
2022-09-16  8:47       ` Cyril Hrubis
2022-09-14 16:19 ` [LTP] [PATCH v2 5/5] sendfile09: " Martin Doucha
2022-09-14 20:34   ` Petr Vorel
2022-09-15 14:06     ` Cyril Hrubis

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=YyI6lncfJSTariC1@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=mdoucha@suse.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.