public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCHSET 0/4] io_uring and task_work interactions
@ 2020-04-06 19:48 Jens Axboe
  2020-04-06 19:48 ` [PATCH 1/4] task_work: add task_work_pending() helper Jens Axboe
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Jens Axboe @ 2020-04-06 19:48 UTC (permalink / raw)
  To: io-uring; +Cc: peterz

There's a case for io_uring where we want to run the task_work on ring
exit, but we can't easily do that as we don't know if the task_works has
work, or if exit work has already been queued.

Here's two prep patches that adds a task_work_pending() helper, and
makes task_work_run() check it. Then we can remove these checks from
the caller, and we can have io_uring check if we need to run work if
it needs to on ring exit.

-- 
Jens Axboe




^ permalink raw reply	[flat|nested] 17+ messages in thread
* [PATCHSET v2] io_uring and task_work interactions
@ 2020-04-07 16:02 Jens Axboe
  2020-04-07 16:02 ` [PATCH 1/4] task_work: add task_work_pending() helper Jens Axboe
  0 siblings, 1 reply; 17+ messages in thread
From: Jens Axboe @ 2020-04-07 16:02 UTC (permalink / raw)
  To: io-uring; +Cc: viro

There's a case for io_uring where we want to run the task_work on ring
exit, but we can't easily do that as we don't know if the task_works has
work, or if exit work has already been queued.

First two are just cleanups, third one makes task_work_exited externally
visible, and fourth one let's io_uring call task_work_run() off the
fops->release() path to fix an issue where we need to potentially flush
work here.

Since v1:
- Don't add task_work_exited check to the fast path
- Ensure exit_task_work() always runs

-- 
Jens Axboe



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

end of thread, other threads:[~2020-04-07 17:52 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-06 19:48 [PATCHSET 0/4] io_uring and task_work interactions Jens Axboe
2020-04-06 19:48 ` [PATCH 1/4] task_work: add task_work_pending() helper Jens Axboe
2020-04-07 11:28   ` Oleg Nesterov
2020-04-07 15:43     ` Jens Axboe
2020-04-06 19:48 ` [PATCH 2/4] task_work: don't run task_work if task_work_exited is queued Jens Axboe
2020-04-07 11:39   ` Oleg Nesterov
2020-04-07 11:54     ` Oleg Nesterov
2020-04-07 15:40     ` Jens Axboe
2020-04-07 16:19       ` Oleg Nesterov
2020-04-07 16:59         ` Jens Axboe
2020-04-07 17:43           ` Oleg Nesterov
2020-04-07 12:47   ` Peter Zijlstra
2020-04-07 15:43     ` Jens Axboe
2020-04-06 19:48 ` [PATCH 3/4] task_work: kill current->task_works checking in callers Jens Axboe
2020-04-06 19:48 ` [PATCH 4/4] io_uring: flush task work before waiting for ring exit Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2020-04-07 16:02 [PATCHSET v2] io_uring and task_work interactions Jens Axboe
2020-04-07 16:02 ` [PATCH 1/4] task_work: add task_work_pending() helper Jens Axboe
2020-04-07 17:52   ` Jann Horn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox