Skip to contentSkip to conversation

block: document blk_plug list access

PATCH In review Shaohua Li 2 participants 2 messages Jul 8, 2011 Block layer

lore
Share & tools
lore

Shaohua Li

author
#0 lore raw

PATCH 1/1 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.

---
 include/linux/blkdev.h |    6 ++++++
 1 file changed, 6 insertions(+)
include/linux/blkdev.h +6 -0
Index: linux/include/linux/blkdev.h
===================================================================
@@ -857,6 +857,12 @@ struct request_queue *blk_alloc_queue(gf
 struct request_queue *blk_alloc_queue_node(gfp_t, int);
 extern void blk_put_queue(struct request_queue *);
 
+/*
+ * Note: Code in between changing the blk_plug list/cb_list or element of such
+ * lists is preemptable, but such code can't do sleep (or be very careful),
+ * otherwise data is corrupted. For details, please check schedule() where
+ * blk_schedule_flush_plug() is called.
+ */
 struct blk_plug {
 	unsigned long magic;
 	struct list_head list;
#1 lore raw
Quoted 2 lines · Shaohua Li

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.

Sure, I'll add this.

Signature · 1 line
Jens Axboe