[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1310090369.15392.264.camel@sli10-conroe>
Date: Fri, 08 Jul 2011 09:59:29 +0800
From: Shaohua Li <shaohua.li@...el.com>
To: Jens Axboe <jaxboe@...ionio.com>
Cc: lkml <linux-kernel@...r.kernel.org>
Subject: [patch]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@...el.com>
---
include/linux/blkdev.h | 6 ++++++
1 file changed, 6 insertions(+)
Index: linux/include/linux/blkdev.h
===================================================================
--- linux.orig/include/linux/blkdev.h 2011-07-08 09:21:19.000000000 +0800
+++ linux/include/linux/blkdev.h 2011-07-08 09:34:39.000000000 +0800
@@ -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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists