From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] syscalls/preadv203: Add basic RWF_NOWAIT test
Date: Wed, 6 Feb 2019 08:52:00 +0100 [thread overview]
Message-ID: <20190206075159.GA13396@x230> (raw)
In-Reply-To: <20190128134656.27979-1-metan@ucw.cz>
Hi Cyril,
> From: Cyril Hrubis <chrubis@suse.cz>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
> We are attempting to trigger the EAGAIN path for the RWF_NOWAIT flag.
> In order to do so the test runs three threads:
> * nowait_reader: reads from a random offset from a random file with
> RWF_NOWAIT flag and expects to get EAGAIN and short
> read sooner or later
> * writer_thread: rewrites random file in order to keep the underlying device
> bussy so that pages evicted from cache cannot be faulted
typo => busy
> immediatelly
typo => immediately
...
> +++ b/testcases/kernel/syscalls/preadv2/preadv203.c
> @@ -0,0 +1,266 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * Copyright (C) 2019 Cyril Hrubis <chrubis@suse.cz>
> + */
> +
> +/*
> + * This is a basic functional test for RWF_NOWAIT flag, we are attempting to
> + * force preadv2() either to return a short read or EAGAIN with three
> + * concurelntly running threads:
typo => concurrently
> + *
> + * nowait_reader: reads from a random offset from a random file with
> + * RWF_NOWAIT flag and expects to get EAGAIN and short
> + * read sooner or later
> + *
> + * writer_thread: rewrites random file in order to keep the underlying device
> + * bussy so that pages evicted from cache cannot be faulted
typo => busy
> + * immediatelly
typo => immediately
> + *
> + * cache_dropper: attempts to evict pages from a cache in order for reader to
> + * hit evicted page sooner or later
> + */
> +
> +/*
> + * If test fails with EOPNOTSUPP you have likely hit a glibc bug:
> + *
> + * https://sourceware.org/bugzilla/show_bug.cgi?id=23579
> + *
> + * Which can be worked around by calling preadv2() directly by syscall() such as:
> + *
> + * static ssize_t sys_preadv2(int fd, const struct iovec *iov, int iovcnt,
> + * off_t offset, int flags)
> + * {
> + * return syscall(SYS_preadv2, fd, iov, iovcnt, offset, offset>>32, flags);
> + * }
I wonder if we want either warn user or run it both via (g)libc wrapper and
directly the syscall.
BTW testing on kernel 4.20.0, glibc 2.28 with sys_preadv2() and still get TBROK
EOPNOTSUPP. I tried to test on ext[2-4], btrfs. I wonder what I'm missing.
Kind regards,
Petr
next prev parent reply other threads:[~2019-02-06 7:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-28 13:46 [PATCH] syscalls/preadv203: Add basic RWF_NOWAIT test Cyril Hrubis
2019-01-28 13:46 ` [LTP] " Cyril Hrubis
2019-02-06 7:52 ` Petr Vorel [this message]
2019-02-06 12:07 ` Cyril Hrubis
2019-02-07 11:47 ` Petr Vorel
2019-02-06 8:04 ` Petr Vorel
2019-02-06 12:10 ` Cyril Hrubis
2019-02-21 17:57 ` Naresh Kamboju
2019-02-06 8:36 ` Vijay Kumar
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=20190206075159.GA13396@x230 \
--to=pvorel@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.