All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/1] cachestat01: Reduce required space on 64kb page size
Date: Tue, 30 Jul 2024 10:57:07 +0200	[thread overview]
Message-ID: <20240730085707.GA1336335@pevik> (raw)
In-Reply-To: <ZqibBUXHVfSjN-_4@yuki>

Hi Cyril,

...
> > First I thought we should use tst_fs_has_free() in each
> > test_cached_pages() run, but test uses .all_filesystems, thus it's
> > always 300 MB. Should we, just in case, use .dev_min_size = 300,
> > to make sure it runs correctly even we change the DEV_SIZE_MB value?

> > Or, should we really calculate required space with tst_fs_has_free(),
> > based on page size num_pages and * 1.1 (reserved space for metadata)?

> Hmm, I guess that we should calculate how many pages are going to fit
> into the filesystem and cap it on a sane number as well, so that the
> test runs for a reasonable time if user passed a real and big block
> device, so something as:

> num_pages = MIN(tst_device->size/(2*page_size), 15);

Thanks! Sounds reasonable, I'll retest.

> >  testcases/kernel/syscalls/cachestat/cachestat01.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)

> > diff --git a/testcases/kernel/syscalls/cachestat/cachestat01.c b/testcases/kernel/syscalls/cachestat/cachestat01.c
> > index f7f6275cbd..edb6335d9e 100644
> > --- a/testcases/kernel/syscalls/cachestat/cachestat01.c
> > +++ b/testcases/kernel/syscalls/cachestat/cachestat01.c
> > @@ -67,7 +67,7 @@ static void test_cached_pages(const unsigned int use_sync, const int num_pages)

> >  static void run(unsigned int use_sync)
> >  {
> > -	for (int i = 0; i < 15; i++)
> > +	for (int i = 0; i < page_size > 4096 ? 13 : 15; i++)

> Uff, this is starting to look like perl...

OK, using variable makes things readable.

Kind regards,
Petr

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

      reply	other threads:[~2024-07-30  8:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-29 22:34 [LTP] [PATCH 1/1] cachestat01: Reduce required space on 64kb page size Petr Vorel
2024-07-29 22:36 ` Petr Vorel
2024-07-30  7:49 ` Cyril Hrubis
2024-07-30  8:57   ` Petr Vorel [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=20240730085707.GA1336335@pevik \
    --to=pvorel@suse.cz \
    --cc=chrubis@suse.cz \
    --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 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.