summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_lock.c
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2010-01-07 01:19:01 +0000
committerattilio <attilio@FreeBSD.org>2010-01-07 01:19:01 +0000
commit80498ec26cbddc4754bb64a55078d6364878a881 (patch)
tree25647384888806c4bc594e15fbf1bdbc0330f281 /sys/kern/kern_lock.c
parent5d0cfcfe1ddc88db5f4d35bf5376a4c8d2147efc (diff)
downloadFreeBSD-src-80498ec26cbddc4754bb64a55078d6364878a881.zip
FreeBSD-src-80498ec26cbddc4754bb64a55078d6364878a881.tar.gz
Tweak comments.
Diffstat (limited to 'sys/kern/kern_lock.c')
-rw-r--r--sys/kern/kern_lock.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c
index 6783a43..0d0444f 100644
--- a/sys/kern/kern_lock.c
+++ b/sys/kern/kern_lock.c
@@ -277,6 +277,11 @@ wakeupshlk(struct lock *lk, const char *file, int line)
* avoid a starvation for the threads sleeping on the shared
* queue by giving them precedence and cleaning up the
* exclusive waiters bit anyway.
+ * Please note that lk_exslpfail count may be lying about
+ * the real number of waiters with the LK_SLEEPFAIL flag on
+ * because they may be used in conjuction with interruptible
+ * sleeps so lk_exslpfail is consider as a 'upper limit'
+ * bound, considering the edge cases.
*/
realexslp = sleepq_sleepcnt(&lk->lock_object,
SQ_EXCLUSIVE_QUEUE);
@@ -943,6 +948,12 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk,
* empty avoid a starvation for the threads sleeping
* on the shared queue by giving them precedence
* and cleaning up the exclusive waiters bit anyway.
+ * Please note that lk_exslpfail count may be lying
+ * about the real number of waiters with the
+ * LK_SLEEPFAIL flag on because they may be used in
+ * conjuction with interruptible sleeps so
+ * lk_exslpfail is consider as a 'upper limit' bound,
+ * considering the edge cases.
*/
MPASS((x & LK_EXCLUSIVE_SPINNERS) == 0);
realexslp = sleepq_sleepcnt(&lk->lock_object,
@@ -1046,6 +1057,13 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk,
* threads sleeping on the shared queue by
* giving them precedence and cleaning up the
* exclusive waiters bit anyway.
+ * Please note that lk_exslpfail count may be
+ * lying about the real number of waiters with
+ * the LK_SLEEPFAIL flag on because they may
+ * be used in conjuction with interruptible
+ * sleeps so lk_exslpfail is consider as a
+ * 'upper limit' bound, considering the edge
+ * cases.
*/
if (v & LK_EXCLUSIVE_WAITERS) {
queue = SQ_EXCLUSIVE_QUEUE;
OpenPOWER on IntegriCloud