Skip to contentSkip to conversation

preadv203: guarantee the subloop exit timely

PATCH In review Li Wang 1 participant 2 messages Jun 8, 2023 – Jun 21, 2023

lore
Share & tools
lore

Li Wang

author
#0 lore raw

PATCH 1/1 preadv203: guarantee the subloop exit timely

We observed that timeout is still occasionally happening even with introducing the tst_remaining_runtime. The likely reason is that writer_thread needs more time in subloop.

Here exit it instantly when stop set to 1.

---
 testcases/kernel/syscalls/preadv2/preadv203.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/syscalls/preadv2/preadv203.c +1 -1
index 25c6e1c2e..c87deb674 100644
@@ -159,7 +159,7 @@ static void *writer_thread(void *unused)
 	while (!stop) {
 		int fd = fds[random() % FILES];
 
-		for (j = 0; j < CHUNKS; j++) {
+		for (j = 0; j < CHUNKS && !stop; j++) {
 			memset(buf, '0' + j, sizeof(buf));
 
 			off_t off = CHUNK_SZ * j;
Signature · 5 lines
2.40.1


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

Hi All,

As these two are simply to reduce the timed-out issue, I dare to merge them directly.

1790832 New readahead02: set dynamic run time
1792108 New preadv203: guarantee the subloop exit timely

Signature · 5 lines
Regards,
Li Wang

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