Skip to content

Commit 316cc67

Browse files
Shaohua LiJens Axboe
authored andcommitted
block: document blk_plug list access
I'm often confused why not disable preempt when changing blk_plug list. It would be better to add comments here in case others have the similar concerns. Signed-off-by: Shaohua Li <shaohua.li@intel.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
1 parent 55c022b commit 316cc67

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎include/linux/blkdev.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,12 @@ struct request_queue *blk_alloc_queue(gfp_t);
857857
struct request_queue *blk_alloc_queue_node(gfp_t, int);
858858
extern void blk_put_queue(struct request_queue *);
859859

860+
/*
861+
* Note: Code in between changing the blk_plug list/cb_list or element of such
862+
* lists is preemptable, but such code can't do sleep (or be very careful),
863+
* otherwise data is corrupted. For details, please check schedule() where
864+
* blk_schedule_flush_plug() is called.
865+
*/
860866
struct blk_plug {
861867
unsigned long magic;
862868
struct list_head list;

0 commit comments

Comments
 (0)