Date: Fri, 9 Jul 2004 17:46:27 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/kern subr_witness.c Message-ID: <200407091746.i69HkRJS087027@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
jhb 2004-07-09 17:46:27 UTC FreeBSD src repository Modified files: sys/kern subr_witness.c Log: Check the lock lists to see if they are empty directly rather than assigning a pointer to the list and then dereferencing the pointer as a second step. When the first spin lock is acquired, curthread is not in a critical section so it may be preempted and would end up using another CPUs lock list instead of its own. When this code was in witness_lock() this sequence was safe as curthread was in a critical section already since witness_lock() is called after the lock is acquired. Tested by: Daniel Lang dl at leo.org Revision Changes Path 1.175 +21 -9 src/sys/kern/subr_witness.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200407091746.i69HkRJS087027>