Skip to contentSkip to conversation

Max_runtime timeout fixes

PATCH In review Martin Doucha 3 participants 17 messages Sep 14, 2022 – Sep 16, 2022

lore
Share & tools
lore
#0 lore raw

v2 cover Max_runtime timeout fixes

The introduction of max_runtime system shortly before the latest LTP release has caused some random timeout issues, particularly for sendfile09 and ioctl_sg01. This patchset fixes those issues.

All of these patches are independent and can be merged out of order.

Martin Doucha (5):
ioctl_sg01: Add max_runtime
copy_file_range01: Add max_runtime
perf_event_open02: Add max_runtime
readahead02: Add max_runtime
sendfile09: Add max_runtime

 .../kernel/syscalls/copy_file_range/copy_file_range01.c  | 1 +
 testcases/kernel/syscalls/ioctl/ioctl_sg01.c             | 1 +
 .../kernel/syscalls/perf_event_open/perf_event_open02.c  | 1 +
 testcases/kernel/syscalls/readahead/readahead02.c        | 9 +++++++--
 testcases/kernel/syscalls/sendfile/sendfile09.c          | 1 +
 5 files changed, 11 insertions(+), 2 deletions(-)
Signature · 5 lines
2.37.3


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

PATCH v2 1/5 ioctl_sg01: Add max_runtime

Test setup can take very long time depending on the amount of free RAM. Set high max_runtime to avoid timeout issues.

---

Changes since v1:
- Changed max_runtime from unlimited to 1 hour

We'll add .max_setup_runtime after the release to not break even more things. Let's use this as a temporary fix.

 testcases/kernel/syscalls/ioctl/ioctl_sg01.c | 1 +
 1 file changed, 1 insertion(+)
testcases/kernel/syscalls/ioctl/ioctl_sg01.c +1 -0
index 94b30dc6b..dfbba399d 100644
@@ -126,6 +126,7 @@ static struct tst_test test = {
 	.test_all = run,
 	.setup = setup,
 	.cleanup = cleanup,
+	.max_runtime = 3600,
 	.tags = (const struct tst_tag[]) {
 		{"linux-git", "a45b599ad808"},
 		{"CVE", "2018-1000204"},
Signature · 5 lines
2.37.3


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v2 1/5
#2 lore raw

Re: [LTP] [PATCH v2 1/5] ioctl_sg01: Add max_runtime

Hi Martin,

Quoted 2 lines

Test setup can take very long time depending on the amount of free RAM. Set high max_runtime to avoid timeout issues.

Quoted 5 lines

Changes since v1:
- Changed max_runtime from unlimited to 1 hour

We'll add .max_setup_runtime after the release to not break even more things. Let's use this as a temporary fix.

+1

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#3 lore raw

Re: [LTP] [PATCH v2 1/5] ioctl_sg01: Add max_runtime

In reply to Martin Doucha

Hi!

Quoted 11 lines

Test setup can take very long time depending on the amount of free RAM. Set high max_runtime to avoid timeout issues.

---

Changes since v1:
- Changed max_runtime from unlimited to 1 hour

We'll add .max_setup_runtime after the release to not break even more things. Let's use this as a temporary fix.

Fair enough. Pushed.

Signature · 5 lines
Cyril Hrubis
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#4 lore raw

PATCH v2 2/5 copy_file_range01: Add max_runtime

In reply to Martin Doucha

---

Changes since v1:
- Changed max_runtime from 20s to 5s

 testcases/kernel/syscalls/copy_file_range/copy_file_range01.c | 1 +
 1 file changed, 1 insertion(+)
testcases/kernel/syscalls/copy_file_range/copy_file_range01.c +1 -0
index 7d27007a3..bbcb0ca3b 100644
@@ -232,4 +232,5 @@ static struct tst_test test = {
 	.all_filesystems = 1,
 	.test = copy_file_range_verify,
 	.test_variants = TEST_VARIANTS,
+	.max_runtime = 5
 };
Signature · 5 lines
2.37.3


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#5 lore raw

Re: [LTP] [PATCH v2 2/5] copy_file_range01: Add max_runtime

Hi Martin,

merged, with Cyril's RBT (as he proposed this value in v1). Thanks!

Kind regards,
Petr

Quoted 19 lines

---

Changes since v1:
- Changed max_runtime from 20s to 5s

 testcases/kernel/syscalls/copy_file_range/copy_file_range01.c | 1 +
 1 file changed, 1 insertion(+)
testcases/kernel/syscalls/copy_file_range/copy_file_range01.c +1 -0
index 7d27007a3..bbcb0ca3b 100644
@@ -232,4 +232,5 @@ static struct tst_test test = {
 	.all_filesystems = 1,
 	.test = copy_file_range_verify,
 	.test_variants = TEST_VARIANTS,
+	.max_runtime = 5
 };
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#6 lore raw

PATCH v2 3/5 perf_event_open02: Add max_runtime

In reply to Martin Doucha

---

Changes since v1:
- Changed max_runtime from 15s to 72s

Again, we'll add .max_setup_runtime after the new release.

 testcases/kernel/syscalls/perf_event_open/perf_event_open02.c | 1 +
 1 file changed, 1 insertion(+)
testcases/kernel/syscalls/perf_event_open/perf_event_open02.c +1 -0
index 618a27016..defe13c62 100644
@@ -334,4 +334,5 @@ static struct tst_test test = {
 	},
 	.test_all = verify,
 	.needs_root = 1,
+	.max_runtime = 72
 };
Signature · 5 lines
2.37.3


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v2 3/5
#7 lore raw

Re: [LTP] [PATCH v2 3/5] perf_event_open02: Add max_runtime

Hi Martin,

Quoted 2 lines

Changes since v1:
- Changed max_runtime from 15s to 72s

Quoted 1 line

Again, we'll add .max_setup_runtime after the new release.

+1

Quoted 13 lines
 testcases/kernel/syscalls/perf_event_open/perf_event_open02.c | 1 +
 1 file changed, 1 insertion(+)
testcases/kernel/syscalls/perf_event_open/perf_event_open02.c +1 -0
index 618a27016..defe13c62 100644
@@ -334,4 +334,5 @@ static struct tst_test test = {
 	},
 	.test_all = verify,
 	.needs_root = 1,
+	.max_runtime = 72
 };
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#9 lore raw

PATCH v2 4/5 readahead02: Add max_runtime

In reply to Martin Doucha

Also calculate max_runtime dynamically if the test gets called with non-default filesize.

---

Changes since v1:
- Added dynamic runtime calculation for non-default filesize

 testcases/kernel/syscalls/readahead/readahead02.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
testcases/kernel/syscalls/readahead/readahead02.c +7 -2
index 4fa8cfaf8..02e866e82 100644
@@ -38,7 +38,9 @@ static char testfile[PATH_MAX] = "testfile";
 #define DROP_CACHES_FNAME "/proc/sys/vm/drop_caches"
 #define MEMINFO_FNAME "/proc/meminfo"
 #define PROC_IO_FNAME "/proc/self/io"
-static size_t testfile_size = 64 * 1024 * 1024;
+#define DEFAULT_FILESIZE (64 * 1024 * 1024)
+
+static size_t testfile_size = DEFAULT_FILESIZE;
 static char *opt_fsizestr;
 static int pagesize;
 static unsigned long cached_max;
@@ -365,8 +367,10 @@ static void setup_readahead_length(void)
 
 static void setup(void)
 {
-	if (opt_fsizestr)
+	if (opt_fsizestr) {
 		testfile_size = SAFE_STRTOL(opt_fsizestr, 1, INT_MAX);
+		tst_set_max_runtime(1 + testfile_size / (DEFAULT_FILESIZE/32));
+	}
 
 	if (access(PROC_IO_FNAME, F_OK))
 		tst_brk(TCONF, "Requires " PROC_IO_FNAME);
@@ -406,6 +410,7 @@ static struct tst_test test = {
 	},
 	.test = test_readahead,
 	.tcnt = ARRAY_SIZE(tcases),
+	.max_runtime = 30,
 	.tags = (const struct tst_tag[]) {
 		{"linux-git", "b833a3660394"},
 		{"linux-git", "5b910bd615ba"},
Signature · 5 lines
2.37.3


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v2 4/5
#10 lore raw

Re: [LTP] [PATCH v2 4/5] readahead02: Add max_runtime

Hi Martin,

Quoted 5 lines

Also calculate max_runtime dynamically if the test gets called with non-default filesize.

Changes since v1:
- Added dynamic runtime calculation for non-default filesize

LGTM, thanks!

Kind regards,
Petr

Quoted 38 lines
 testcases/kernel/syscalls/readahead/readahead02.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
testcases/kernel/syscalls/readahead/readahead02.c +7 -2
index 4fa8cfaf8..02e866e82 100644
@@ -38,7 +38,9 @@ static char testfile[PATH_MAX] = "testfile";
 #define DROP_CACHES_FNAME "/proc/sys/vm/drop_caches"
 #define MEMINFO_FNAME "/proc/meminfo"
 #define PROC_IO_FNAME "/proc/self/io"
-static size_t testfile_size = 64 * 1024 * 1024;
+#define DEFAULT_FILESIZE (64 * 1024 * 1024)
+
+static size_t testfile_size = DEFAULT_FILESIZE;
 static char *opt_fsizestr;
 static int pagesize;
 static unsigned long cached_max;
@@ -365,8 +367,10 @@ static void setup_readahead_length(void)
 
 static void setup(void)
 {
-	if (opt_fsizestr)
+	if (opt_fsizestr) {
 		testfile_size = SAFE_STRTOL(opt_fsizestr, 1, INT_MAX);
+		tst_set_max_runtime(1 + testfile_size / (DEFAULT_FILESIZE/32));
+	}
 
 	if (access(PROC_IO_FNAME, F_OK))
 		tst_brk(TCONF, "Requires " PROC_IO_FNAME);
@@ -406,6 +410,7 @@ static struct tst_test test = {
 	},
 	.test = test_readahead,
 	.tcnt = ARRAY_SIZE(tcases),
+	.max_runtime = 30,
 	.tags = (const struct tst_tag[]) {
 		{"linux-git", "b833a3660394"},
 		{"linux-git", "5b910bd615ba"},
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#11 lore raw

Re: [LTP] [PATCH v2 4/5] readahead02: Add max_runtime

In reply to Martin Doucha

Hi!
Pushed, thanks.

I guess that for the rest of the problems we should open an issue so that we do not forget. Or do you plan to continue working on the test after the release?

Signature · 5 lines
Cyril Hrubis
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#12 lore raw

Re: [LTP] [PATCH v2 4/5] readahead02: Add max_runtime

Quoted 6 lines · Cyril Hrubis

Hi!
Pushed, thanks.

I guess that for the rest of the problems we should open an issue so that we do not forget. Or do you plan to continue working on the test after the release?

I'm planning to go back to ULP and KVM tests after release so feel free to open a new ticket for the other suggested improvements.

Signature · 11 lines
Martin Doucha   [email protected]
QA Engineer for Software Maintenance
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#14 lore raw

PATCH v2 5/5 sendfile09: Add max_runtime

In reply to Martin Doucha

---

Changes since v1:
- Changed max_runtime from 20 to 120

 testcases/kernel/syscalls/sendfile/sendfile09.c | 1 +
 1 file changed, 1 insertion(+)
testcases/kernel/syscalls/sendfile/sendfile09.c +1 -0
index 320649dcd..07c43eb59 100644
@@ -97,6 +97,7 @@ static struct tst_test test = {
 	.test = run,
 	.tcnt = ARRAY_SIZE(tc),
 	.min_kver = "2.6.33",
+	.max_runtime = 120,
 	.tags = (const struct tst_tag[]) {
 		{"linux-git", "5d73320a96fcc"},
 		{}
Signature · 5 lines
2.37.3


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v2 5/5
#15 lore raw

Re: [LTP] [PATCH v2 5/5] sendfile09: Add max_runtime

Hi Martin, Jan,

Quoted 5 lines

---

Changes since v1:
- Changed max_runtime from 20 to 120

Quoted 15 lines
 testcases/kernel/syscalls/sendfile/sendfile09.c | 1 +
 1 file changed, 1 insertion(+)
testcases/kernel/syscalls/sendfile/sendfile09.c +1 -0
index 320649dcd..07c43eb59 100644
@@ -97,6 +97,7 @@ static struct tst_test test = {
 	.test = run,
 	.tcnt = ARRAY_SIZE(tc),
 	.min_kver = "2.6.33",
+	.max_runtime = 120,
 	.tags = (const struct tst_tag[]) {
 		{"linux-git", "5d73320a96fcc"},
 		{}
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#16 lore raw

Re: [LTP] [PATCH v2 5/5] sendfile09: Add max_runtime

Hi!
Pushed as well, thanks.

Signature · 5 lines
Cyril Hrubis
[email protected]

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