All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Fabian Vogt <fvogt@suse.com>, Jiri Slaby <jirislaby@kernel.org>,
	ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/1] mremap06: Add mremap() reproducer for 7e7757876f25
Date: Mon, 10 Jul 2023 14:26:16 +0200	[thread overview]
Message-ID: <20230710122616.GA639201@pevik> (raw)
In-Reply-To: <b62ecf41-e35d-35f2-9b01-dca1fdf4d611@suse.cz>

> On 7/4/23 13:46, Petr Vorel wrote:
> > Hi Cyril,

> >> > +#define PAGE_SIZE 4096

> >> This wouldn't work on 64k page size.

> >> > +#define MMAP_SIZE ((ARRAY_SIZE(tcases)+1)*PAGE_SIZE)
> >> > +#define MREMAP_SIZE (ARRAY_SIZE(tcases)*PAGE_SIZE)

> >> These have to be variables initialized on the fly with getpagesize()
> >> instead of PAGE_SIZE.

> > Yep, I thought about getpagesize().

> Agreed.

> Also IMHO it's awkward to have the number of pages and the iterations
> expressed using ARRAY_SIZE(tcases). I'd say it's just an accident that the
> number of pages involved in the merging and the number of testcases is both
> 3. I'd rather separate those.

Thanks for info. I'll define NUM_PAGES 3 then.

> > ...
> >> > +static int check_pages(void)
> >> > +{
> >> > +	int fail = 0, i;
> >> > +	char val;
> >> > +
> >> > +	for (i = 0; i < (int)ARRAY_SIZE(tcases); i++) {
> >> > +		val = buf[i * PAGE_SIZE];
> >> > +		if (val != 0x30 + i) {
> >> > +			tst_res(TFAIL, "page %d wrong value %d (0x%x)", i, val - 0x30, val);

> >> Woudn't this generate too many FAILURE messages? Maybe we should just
> >> break the for cycle here.

> > It could be. I wasn't sure if it's important to know which pages were wrong.

> There's just 3 pages to print so it won't be that many messages, I'd just
> print them all.

+1

Kind regards,
Petr

> > Kind regards,
> > Petr


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

      reply	other threads:[~2023-07-10 12:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-03 19:49 [LTP] [PATCH 1/1] mremap06: Add mremap() reproducer for 7e7757876f25 Petr Vorel
2023-07-03 19:55 ` Petr Vorel
2023-07-03 20:07 ` Petr Vorel
2023-07-04  8:47   ` Cyril Hrubis
2023-07-04 11:33     ` Petr Vorel
2023-07-04  9:15   ` Jan Stancek
2023-07-04 11:32     ` Petr Vorel
2023-07-04  8:41 ` Cyril Hrubis
2023-07-04 11:46   ` Petr Vorel
2023-07-10 11:13     ` Vlastimil Babka
2023-07-10 12:26       ` 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=20230710122616.GA639201@pevik \
    --to=pvorel@suse.cz \
    --cc=fvogt@suse.com \
    --cc=jirislaby@kernel.org \
    --cc=ltp@lists.linux.it \
    --cc=vbabka@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.