git: fq - fix a (possible) deadlock

Alex Hornung alexh at crater.dragonflybsd.org
Sat Aug 27 01:37:29 PDT 2011


commit 009da86a5800b6fefcda0a946ab02a089bd9254f
Author: Alex Hornung <ahornung at gmail.com>
Date:   Fri Aug 26 00:29:17 2011 +0000

    fq - fix a (possible) deadlock
    
     * A deadlock can occur if a lock is held around the strategy call when
       the completion is synchronous and ends up in the destruction of a
       tdio, as both will acquire the same diskctx lock.
    
     * Refactor the code around strategy calls so that the bios are first
       prepared, under the protection of the lock, and inserted into a local
       array. Once that is ready and the bios are ready and taken out of
       their respective queues, the locks are dropped and the strategy call
       occurs locklessly.
    
    Reported-by: Antonio Huete (tuxillo@)

Summary of changes:
 sys/kern/dsched/fq/fq.h         |    7 +++++++
 sys/kern/dsched/fq/fq_core.c    |   39 +++++++++++++++++++++++++++++++++++----
 sys/kern/dsched/fq/fq_diskops.c |   25 +++++++++++++++++++++++--
 3 files changed, 65 insertions(+), 6 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/009da86a5800b6fefcda0a946ab02a089bd9254f


-- 
DragonFly BSD source repository





More information about the Commits mailing list