linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHSET] Replace io_uring workqueues with io-wq
@ 2019-10-24 13:44 Jens Axboe
  2019-10-24 13:44 ` [PATCH 1/2] io-wq: small threadpool implementation for io_uring Jens Axboe
  2019-10-24 13:44 ` [PATCH 2/2] io_uring: replace workqueue usage with io-wq Jens Axboe
  0 siblings, 2 replies; 6+ messages in thread
From: Jens Axboe @ 2019-10-24 13:44 UTC (permalink / raw)
  To: linux-block; +Cc: tj, peterz, mingo

Most of the justification for this work is done in the commit messages
themselves, but the tldr is that there are various bits of functionality
that io_uring needs that workqueues don't (and can't) provide. Hence
this adds a small replacement thread pool implementation that caters to
the needs of io_uring, both current and future ones.

Hopefully the sched core changes are palatable. io-wq uses the same
sched in/out hooks as workqueue, and if the task isn't either a
workqueue or io-wq worker, there should be no extra overhead there.

Patches are on top of my for-5.5/io_uring branch, and can also be found
here:

http://git.kernel.dk/cgit/linux-block/log/?h=for-5.5/io_uring-wq

This passes io_uring IO testing and repeated runs of the liburing
regressions suite, and passes tests that would previously deadlock.

 fs/Kconfig            |   3 +
 fs/Makefile           |   1 +
 fs/io-wq.c            | 790 ++++++++++++++++++++++++++++++++++++++++++
 fs/io-wq.h            |  55 +++
 fs/io_uring.c         | 402 +++++----------------
 include/linux/sched.h |   1 +
 init/Kconfig          |   1 +
 kernel/sched/core.c   |  16 +-
 8 files changed, 948 insertions(+), 321 deletions(-)

-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 6+ messages in thread
* [PATCHSET v2 0/2] Replace io_uring workqueues with io-wq
@ 2019-10-25 17:22 Jens Axboe
  2019-10-25 17:22 ` [PATCH 1/2] io-wq: small threadpool implementation for io_uring Jens Axboe
  0 siblings, 1 reply; 6+ messages in thread
From: Jens Axboe @ 2019-10-25 17:22 UTC (permalink / raw)
  To: linux-block; +Cc: peterz, mingo

Hopefully the sched core changes are palatable. io-wq uses the same
sched in/out hooks as workqueue, and if the task isn't either a
workqueue or io-wq worker, there should be no extra overhead there.

Patches are on top of my for-5.5/io_uring branch, and can also be found
here:

http://git.kernel.dk/cgit/linux-block/log/?h=for-5.5/io_uring-wq

This passes io_uring IO testing and repeated runs of the liburing
regressions suite, and passes tests that would previously deadlock.

Also see LWN article here:

https://lwn.net/Articles/803070/

Changes since v1:

- Fix dependent work hash
- Turn wqe->state into wqe->flags
- Fix issue with unusing mm/files if worker got busy at exit timo
- Fix issue with hashed work bit mangling (Colin)
- Fix issue with dependent work
- Rebase

 fs/Kconfig                      |   3 +
 fs/Makefile                     |   1 +
 fs/io-wq.c                      | 805 ++++++++++++++++++++++++++++++++
 fs/io-wq.h                      |  55 +++
 fs/io_uring.c                   | 414 ++++------------
 include/linux/sched.h           |   1 +
 include/trace/events/io_uring.h |  12 +-
 init/Kconfig                    |   1 +
 kernel/sched/core.c             |  16 +-
 9 files changed, 981 insertions(+), 327 deletions(-)

-- 
Jens Axboe



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

end of thread, other threads:[~2019-10-28 21:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-24 13:44 [PATCHSET] Replace io_uring workqueues with io-wq Jens Axboe
2019-10-24 13:44 ` [PATCH 1/2] io-wq: small threadpool implementation for io_uring Jens Axboe
2019-10-24 13:44 ` [PATCH 2/2] io_uring: replace workqueue usage with io-wq Jens Axboe
2019-10-25 17:22 [PATCHSET v2 0/2] Replace io_uring workqueues " Jens Axboe
2019-10-25 17:22 ` [PATCH 1/2] io-wq: small threadpool implementation for io_uring Jens Axboe
2019-10-28 17:10   ` Peter Zijlstra
2019-10-28 21:21     ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).