git: kernel - Fix races in disk iteration and diskctx handling
Matthew Dillon
dillon at crater.dragonflybsd.org
Fri Nov 30 12:59:03 PST 2012
commit 5374d04ff57a66cc5c140a32249db93546195130
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date: Fri Nov 30 11:17:50 2012 -0800
kernel - Fix races in disk iteration and diskctx handling
* Add disk->d_refs to prevent a disk structure from being destroyed out
from under an iteration.
* Redo the disk_enumeration() API to use markers and d_refs.
* Make adjustments to the dsched API. In particular, do not return
unreferenced tdio pointers in situations where they aren't used by
the caller.
* Properly implement the ref count on the tdio's, one for each of the two
lists the tdio belongs to, and ensure that dsched_thread_io_alloc()
keeps an extra ref on the tdio after releasing the diskctx lock to prevent
it from being ripped out while the code is pondering whether to place
the tdio on the tdctx list.
* When deleting the tdio's for a tdctx try to destroy the diskctx. That is,
simply dereferencing it from the thread is not sufficient.
* When deleting the tdio's for a diskctx try to destroy the tdctx. That is,
simply dereferencing it from the diskctx is not sufficient.
* Handle destroy/ref races.
Summary of changes:
sys/kern/dsched/bfq/bfq_helper_thread.c | 4 +-
sys/kern/dsched/fq/fq_core.c | 8 +-
sys/kern/kern_dsched.c | 192 +++++++++++++++++++++++--------
sys/kern/subr_disk.c | 86 +++++++++++---
sys/sys/disk.h | 12 +-
sys/sys/dsched.h | 16 ++-
6 files changed, 229 insertions(+), 89 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/5374d04ff57a66cc5c140a32249db93546195130
--
DragonFly BSD source repository
More information about the Commits
mailing list