test/io-wq-exit: test io-wq workers exiting before idle timeout

Lewis Campbell reported that a basic test case was slower if run from
a created thread, rather than just from main itself. The test sets up
a thread, and in that thread, a ring and submits two splice ops, waits
for them to finish, and then exits. The parent does pthread_join() on
the thread. On a buggy kernel, this ends up taking the time required
to perform the two splice ops, and then waits for the io-wq idle worker
timeout before pthread_join() returns. This is because the userspace
thread waits on its children before being able to exit, and the io-wq
thread is one such child.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 files changed