Skip to contentSkip to conversation

Fix synchronization problem with dio tests

PATCH In review Andrea Cervesato 4 participants 5 messages Jan 29, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix synchronization problem with dio tests

From: Andrea Cervesato <[email protected]>

When system is really fast processing I/O syscalls, multiple childrean running I/O operations might lock the parent, causing tst_reap_childrean() to stuck. By adding a small usleep at the end of the reading I/O operations, which are used by dio_append and dio_read tests, we ensure that system has enough breath to end tests correctly and to process children exit.

---
 testcases/kernel/io/ltp-aiodio/common.h | 4 ++++
 1 file changed, 4 insertions(+)
testcases/kernel/io/ltp-aiodio/common.h +4 -0
index 200bbe18e..281072c3b 100644
@@ -90,6 +90,8 @@ static inline void io_read(const char *filename, int filesize, volatile int *run
 			if (!*run_child || !tst_remaining_runtime())
 				goto exit;
 		}
+
+		usleep(100);
 	}
 
 exit:
@@ -121,6 +123,8 @@ static inline void io_read_eof(const char *filename, volatile int *run_child)
 				break;
 			}
 		}
+
+		usleep(100);
 	}
 
 	SAFE_CLOSE(fd);
Signature · 5 lines
2.35.3


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

Hi Andrea,

Quoted 6 lines

When system is really fast processing I/O syscalls, multiple childrean running I/O operations might lock the parent, causing tst_reap_childrean() to stuck. By adding a small usleep at the end of the reading I/O operations, which are used by dio_append and dio_read tests, we ensure that system has enough breath to end tests correctly and to process children exit.

Thanks for fixing this! Test already does some usleep(100).

For a record, this triggered a failure on s39Ox on SLE 15-SP6.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw
In reply to Andrea Cervesato

Hi!

Quoted 6 lines

When system is really fast processing I/O syscalls, multiple childrean running I/O operations might lock the parent, causing tst_reap_childrean() to stuck. By adding a small usleep at the end of the reading I/O operations, which are used by dio_append and dio_read tests, we ensure that system has enough breath to end tests correctly and to process children exit.

This does smell like a kernel bug to be honest.

Which test is this? How to reproduce?

Quoted 33 lines
---
 testcases/kernel/io/ltp-aiodio/common.h | 4 ++++
 1 file changed, 4 insertions(+)
testcases/kernel/io/ltp-aiodio/common.h +4 -0
index 200bbe18e..281072c3b 100644
@@ -90,6 +90,8 @@ static inline void io_read(const char *filename, int filesize, volatile int *run
 			if (!*run_child || !tst_remaining_runtime())
 				goto exit;
 		}
+
+		usleep(100);
 	}
 
 exit:
@@ -121,6 +123,8 @@ static inline void io_read_eof(const char *filename, volatile int *run_child)
 				break;
 			}
 		}
+
+		usleep(100);
 	}
 
 	SAFE_CLOSE(fd);
Signature · 5 lines
2.35.3


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Signature · 5 lines
Cyril Hrubis
[email protected]

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

Hi!

Quoted 8 lines · Cyril Hrubis

Hi!

Quoted 6 lines

When system is really fast processing I/O syscalls, multiple childrean running I/O operations might lock the parent, causing tst_reap_childrean() to stuck. By adding a small usleep at the end of the reading I/O operations, which are used by dio_append and dio_read tests, we ensure that system has enough breath to end tests correctly and to process children exit.

This does smell like a kernel bug to be honest.

I thought the same at first, but I didn't find issues in the kernel. We can take a look deeper for sure.

Quoted 28 lines

Which test is this? How to reproduce?

Quoted 26 lines
---
  testcases/kernel/io/ltp-aiodio/common.h | 4 ++++
  1 file changed, 4 insertions(+)
testcases/kernel/io/ltp-aiodio/common.h +4 -0
index 200bbe18e..281072c3b 100644
@@ -90,6 +90,8 @@ static inline void io_read(const char *filename, int filesize, volatile int *run
  			if (!*run_child || !tst_remaining_runtime())
  				goto exit;
  		}
+
+		usleep(100);
  	}
 
  exit:
@@ -121,6 +123,8 @@ static inline void io_read_eof(const char *filename, volatile int *run_child)
  				break;
  			}
  		}
+
+		usleep(100);
  	}
 
Quoted 7 lines
Quoted 7 lines
testcases/kernel/io/ltp-aiodio/common.h +0 -0
  	SAFE_CLOSE(fd);
Signature · 5 lines
2.35.3


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

Andrea

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#4 lore raw
Quoted 10 lines

Hi!

Quoted 7 lines · Cyril Hrubis

Hi!

Quoted 6 lines

When system is really fast processing I/O syscalls, multiple childrean running I/O operations might lock the parent, causing tst_reap_childrean() to stuck. By adding a small usleep at the end of the reading I/O operations, which are used by dio_append and dio_read tests, we ensure that system has enough breath to end tests correctly and to process children exit.

Quoted 4 lines
Quoted 1 line

This does smell like a kernel bug to be honest.

I thought the same at first, but I didn't find issues in the kernel. We can take a look deeper for sure.

Quoted 1 line

Which test is this? How to reproduce?

FYI It's ADI000 => dio_append (without params), which is failing on s39Ox on SLE 15-SP6. It runs pretty quickly on other common archs.

Kind regards,
Petr

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