git: kernel - Refactor dsched ref/unref routines

看板DFBSD_commit作者時間15年前 (2011/03/02 08:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
commit 265b0d4af67ddbef1cf048a4fd2783bfdec1795c Author: Matthew Dillon <dillon@apollo.backplane.com> Date: Tue Mar 1 15:52:19 2011 -0800 kernel - Refactor dsched ref/unref routines * Refactor the dsched ref/unref routines to handle 1->0 transitions atomically and to properly deal with 1->0 races related to any re-referencing of the structure which can occur concurrently. Such races can occur because the structure must acquire other locks while removing itself from the various lists it is on and thus can be accessed via those lists in the mean time. Instead of using -0x400 as a separate atomic op after a 1->0 transition we directly transition from 1 to 0x80000000, removing a race condition. This also allows temporary references to be made during destruction. * Get a temporary ref and re-check flag state after acquiring a lock to determine if the structure in question is still on the list we are trying to remove it from. Summary of changes: sys/kern/kern_dsched.c | 260 ++++++++++++++++++++++++++++++++--------------- 1 files changed, 177 insertions(+), 83 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/265b0d4af67ddbef1cf048a4fd2783bfdec1795c -- DragonFly BSD source repository
文章代碼(AID): #1DROZ7v_ (DFBSD_commit)