Thread (24 messages) 24 messages, 3 authors, 2017-06-21
STALE3312d REVIEWED: 4 (4M)
Revisions (2)
  1. v4 [diff vs current]
  2. v5 current

[PATCH v5 07/12] block: Add a comment above queue_lockdep_assert_held()

From: Bart Van Assche <hidden>
Date: 2017-06-20 18:15:44
Subsystem: block layer, the rest · Maintainers: Jens Axboe, Linus Torvalds

From: Bart Van Assche <redacted>

Add a comment above the queue_lockdep_assert_held() macro that
explains the purpose of the q->queue_lock test.

Signed-off-by: Bart Van Assche <redacted>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Omar Sandoval <redacted>
Cc: Ming Lei <redacted>
---
 include/linux/blkdev.h | 7 +++++++
 1 file changed, 7 insertions(+)
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index ff0ae83235ea..c00a6b99e77c 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -635,6 +635,13 @@ struct request_queue {
 				 (1 << QUEUE_FLAG_SAME_COMP)	|	\
 				 (1 << QUEUE_FLAG_POLL))
 
+/*
+ * @q->queue_lock is set while a queue is being initialized. Since we know
+ * that no other threads access the queue object before @q->queue_lock has
+ * been set, it is safe to manipulate queue flags without holding the
+ * queue_lock if @q->queue_lock == NULL. See also blk_alloc_queue_node() and
+ * blk_init_allocated_queue().
+ */
 static inline void queue_lockdep_assert_held(struct request_queue *q)
 {
 	if (q->queue_lock)
-- 
2.13.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help