* [patch]block: document blk_plug list access
@ 2011-07-08 1:59 Shaohua Li
2011-07-08 6:17 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Shaohua Li @ 2011-07-08 1:59 UTC (permalink / raw)
To: Jens Axboe; +Cc: lkml
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>
---
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;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch]block: document blk_plug list access
2011-07-08 1:59 [patch]block: document blk_plug list access Shaohua Li
@ 2011-07-08 6:17 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2011-07-08 6:17 UTC (permalink / raw)
To: Shaohua Li; +Cc: lkml
On 2011-07-08 03:59, Shaohua Li wrote:
> 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.
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-07-08 6:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-08 1:59 [patch]block: document blk_plug list access Shaohua Li
2011-07-08 6:17 ` Jens Axboe
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.