diff options
author | gibbs <gibbs@FreeBSD.org> | 2015-01-04 19:55:44 +0000 |
---|---|---|
committer | gibbs <gibbs@FreeBSD.org> | 2015-01-04 19:55:44 +0000 |
commit | 7646916ff089c355a68002d03e370cbee7257a36 (patch) | |
tree | 2544a011500870de18dccea5ae7774609f97951e /share/man/man9/taskqueue.9 | |
parent | 8c983408f92d71a82eab4da6311e4a9133158247 (diff) | |
download | FreeBSD-src-7646916ff089c355a68002d03e370cbee7257a36.zip FreeBSD-src-7646916ff089c355a68002d03e370cbee7257a36.tar.gz |
Prevent live-lock and access of destroyed data in taskqueue_drain_all().
Phabric: https://reviews.freebsd.org/D1247
Reviewed by: jhb, avg
Sponsored by: Spectra Logic Corporation
sys/kern_subr_taskqueue.c:
Modify taskqueue_drain_all() processing to use a temporary
"barrier task", rather than rely on a user task that may
be destroyed during taskqueue_drain_all()'s execution. The
barrier task is queued behind all previously queued tasks
and then has its priority elevated so that future tasks
cannot pass it in the queue.
Use a similar barrier scheme to drain threads processing
current tasks. This requires taskqueue_run_locked() to
insert and remove the taskqueue_busy object for the running
thread for every task processed.
share/man/man9/taskqueue.9:
Remove warning about live-lock issues with taskqueue_drain_all()
and indicate that it does not wait for tasks queued after
it begins processing.
Diffstat (limited to 'share/man/man9/taskqueue.9')
-rw-r--r-- | share/man/man9/taskqueue.9 | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/share/man/man9/taskqueue.9 b/share/man/man9/taskqueue.9 index 662a9d5..e2b105f 100644 --- a/share/man/man9/taskqueue.9 +++ b/share/man/man9/taskqueue.9 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 24, 2014 +.Dd January 4, 2015 .Dt TASKQUEUE 9 .Os .Sh NAME @@ -285,10 +285,16 @@ The .Fn taskqueue_drain_all function is used to wait for all pending and running tasks that are enqueued on the taskqueue to finish. -The caller must arrange that the tasks are not re-enqueued. -Note that +Tasks posted to the taskqueue after .Fn taskqueue_drain_all -currently does not handle tasks with delayed enqueueing. +begins processing, +including pending enqueues scheduled by a previous call to +.Fn taskqueue_enqueue_timeout , +do not extend the wait time of +.Fn taskqueue_drain_all +and may complete after +.Fn taskqueue_drain_all +returns. .Pp The .Fn taskqueue_block |