From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: [PATCH v4 07/12] block: Add a comment above queue_lockdep_assert_held() To: Bart Van Assche , Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Bart Van Assche , Hannes Reinecke , Omar Sandoval , Ming Lei References: <20170619220801.12557-1-bart.vanassche@wdc.com> <20170619220801.12557-8-bart.vanassche@wdc.com> From: Hannes Reinecke Message-ID: Date: Tue, 20 Jun 2017 08:39:30 +0200 MIME-Version: 1.0 In-Reply-To: <20170619220801.12557-8-bart.vanassche@wdc.com> Content-Type: text/plain; charset=utf-8 List-ID: On 06/20/2017 12:07 AM, Bart Van Assche wrote: > From: Bart Van Assche > > 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 > Reviewed-by: Christoph Hellwig > Cc: Hannes Reinecke > Cc: Omar Sandoval > Cc: Ming Lei > --- > 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) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)