From: Martin Doucha <mdoucha@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>, ltp@lists.linux.it
Subject: [LTP] [PATCH v2] ltp-aiodio.part4: Run DIT000 with only 1 reader process
Date: Thu, 5 Jan 2023 17:29:29 +0100 [thread overview]
Message-ID: <20230105162929.16047-1-mdoucha@suse.cz> (raw)
New changes in real-time kernel patchset give high priority to direct I/O
readers and may cause writes to block indefinitely if there are too many
reader processes running in parallel. Reduce the number of reader processes
in DIT000 to 1 which was the dio_truncate default before rewrite to new API.
Also add warning to dio_truncate if CONFIG_PREEMPT_RT is enabled and
the number of reader processes is too high.
Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
Change since v1:
- Added warning to dio_trunc
I'll leave up for discussion whether to merge this patch or v1.
runtest/ltp-aiodio.part4 | 2 +-
testcases/kernel/io/ltp-aiodio/dio_truncate.c | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/runtest/ltp-aiodio.part4 b/runtest/ltp-aiodio.part4
index d88c27a83..c31bef934 100644
--- a/runtest/ltp-aiodio.part4
+++ b/runtest/ltp-aiodio.part4
@@ -56,7 +56,7 @@ ADI007 dio_append
ADI008 dio_append
ADI009 dio_append
#Running dio_truncate
-DIT000 dio_truncate
+DIT000 dio_truncate -n 1
DIT001 dio_truncate
DIT002 dio_truncate
#Running dio_read
diff --git a/testcases/kernel/io/ltp-aiodio/dio_truncate.c b/testcases/kernel/io/ltp-aiodio/dio_truncate.c
index e5c0933e9..de1e3524e 100644
--- a/testcases/kernel/io/ltp-aiodio/dio_truncate.c
+++ b/testcases/kernel/io/ltp-aiodio/dio_truncate.c
@@ -31,6 +31,7 @@
#include <sys/types.h>
#include <fcntl.h>
#include "tst_test.h"
+#include "tst_kconfig.h"
#include "common.h"
static volatile int *run_child;
@@ -86,6 +87,7 @@ static void dio_read(const char *filename, long long align, size_t bs)
static void setup(void)
{
struct stat sb;
+ const char *kconf_rt[] = {"CONFIG_PREEMPT_RT", NULL};
if (tst_parse_int(str_numchildren, &numchildren, 1, INT_MAX))
tst_brk(TBROK, "Invalid number of children '%s'", str_numchildren);
@@ -103,6 +105,11 @@ static void setup(void)
alignment = sb.st_blksize;
run_child = SAFE_MMAP(NULL, sizeof(int), PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0);
+
+ if (numchildren > 2 && !tst_kconfig_check(kconf_rt)) {
+ tst_res(TINFO, "Warning: This test may deadlock on RT kernels");
+ tst_res(TINFO, "If it does, reduce number of threads to 2");
+ }
}
static void cleanup(void)
--
2.39.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next reply other threads:[~2023-01-05 16:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-05 16:29 Martin Doucha [this message]
2023-01-06 9:21 ` [LTP] [PATCH v2] ltp-aiodio.part4: Run DIT000 with only 1 reader process Petr Vorel
2023-01-06 9:34 ` Petr Vorel
2023-01-06 10:53 ` Petr Vorel
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=20230105162929.16047-1-mdoucha@suse.cz \
--to=mdoucha@suse.cz \
--cc=andrea.cervesato@suse.de \
--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.