All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v2] ltp-aiodio.part4: Run DIT000 with only 1 reader process
@ 2023-01-05 16:29 Martin Doucha
  2023-01-06  9:21 ` Petr Vorel
  2023-01-06  9:34 ` Petr Vorel
  0 siblings, 2 replies; 4+ messages in thread
From: Martin Doucha @ 2023-01-05 16:29 UTC (permalink / raw)
  To: Andrea Cervesato, ltp

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [LTP] [PATCH v2] ltp-aiodio.part4: Run DIT000 with only 1 reader process
  2023-01-05 16:29 [LTP] [PATCH v2] ltp-aiodio.part4: Run DIT000 with only 1 reader process Martin Doucha
@ 2023-01-06  9:21 ` Petr Vorel
  2023-01-06  9:34 ` Petr Vorel
  1 sibling, 0 replies; 4+ messages in thread
From: Petr Vorel @ 2023-01-06  9:21 UTC (permalink / raw)
  To: Martin Doucha; +Cc: ltp

Hi Martin,

...
> diff --git a/testcases/kernel/io/ltp-aiodio/dio_truncate.c b/testcases/kernel/io/ltp-aiodio/dio_truncate.c
...
> +
> +	if (numchildren > 2 && !tst_kconfig_check(kconf_rt)) {
> +		tst_res(TINFO, "Warning: This test may deadlock on RT kernels");
I hate TWARN exits non-zero, thus we need to have warnings like this
(TWARN would be more visible than TINFO, but it'd always mean non-zero for RT).

I'd wish the message was TWARN on error, but because on RT test timeouts, we
would have to somehow check remaining time to print the warning before timeout.

Let's not complicate things more. Thank you for your work!

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

> +		tst_res(TINFO, "If it does, reduce number of threads to 2");
> +	}
>  }

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LTP] [PATCH v2] ltp-aiodio.part4: Run DIT000 with only 1 reader process
  2023-01-05 16:29 [LTP] [PATCH v2] ltp-aiodio.part4: Run DIT000 with only 1 reader process Martin Doucha
  2023-01-06  9:21 ` Petr Vorel
@ 2023-01-06  9:34 ` Petr Vorel
  2023-01-06 10:53   ` Petr Vorel
  1 sibling, 1 reply; 4+ messages in thread
From: Petr Vorel @ 2023-01-06  9:34 UTC (permalink / raw)
  To: Martin Doucha; +Cc: ltp

Hi Martin,

> +	const char *kconf_rt[] = {"CONFIG_PREEMPT_RT", NULL};

FYI I'll change it to static const char * const kconf_rt[] before merge to keep
checkpatch.pl happy.

Kind regards,
Petr

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LTP] [PATCH v2] ltp-aiodio.part4: Run DIT000 with only 1 reader process
  2023-01-06  9:34 ` Petr Vorel
@ 2023-01-06 10:53   ` Petr Vorel
  0 siblings, 0 replies; 4+ messages in thread
From: Petr Vorel @ 2023-01-06 10:53 UTC (permalink / raw)
  To: Martin Doucha, ltp

Hi Martin,

merged. Thanks a lot for your work.

Kind regards,
Petr

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-06 10:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-05 16:29 [LTP] [PATCH v2] ltp-aiodio.part4: Run DIT000 with only 1 reader process Martin Doucha
2023-01-06  9:21 ` Petr Vorel
2023-01-06  9:34 ` Petr Vorel
2023-01-06 10:53   ` Petr Vorel

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.