From: shaohua.li@intel.com
To: linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org
Cc: jaxboe@fusionio.com, htejun@gmail.com, hch@infradead.org,
jgarzik@pobox.com, djwong@us.ibm.com, sshtylyov@mvista.com,
Shaohua Li <shaohua.li@intel.com>
Subject: [patch v3 1/3] block: add a non-queueable flush flag
Date: Thu, 05 May 2011 09:59:33 +0800 [thread overview]
Message-ID: <20110505020417.586891398@sli10-conroe.sh.intel.com> (raw)
In-Reply-To: <20110505015932.306763905@sli10-conroe.sh.intel.com>
[-- Attachment #1: blk-nonqueueable-flush-flag.patch --]
[-- Type: text/plain, Size: 2296 bytes --]
flush request isn't queueable in some drives. Add a flag to let driver
notify block layer about this. We can optimize flush performance with the
knowledge.
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
---
block/blk-settings.c | 6 ++++++
include/linux/blkdev.h | 7 +++++++
2 files changed, 13 insertions(+)
Index: linux/include/linux/blkdev.h
===================================================================
--- linux.orig/include/linux/blkdev.h 2011-05-04 14:23:42.000000000 +0800
+++ linux/include/linux/blkdev.h 2011-05-05 09:05:18.000000000 +0800
@@ -364,6 +364,7 @@ struct request_queue
* for flush operations
*/
unsigned int flush_flags;
+ unsigned int flush_not_queueable:1;
unsigned int flush_pending_idx:1;
unsigned int flush_running_idx:1;
unsigned long flush_pending_since;
@@ -843,6 +844,7 @@ extern void blk_queue_softirq_done(struc
extern void blk_queue_rq_timed_out(struct request_queue *, rq_timed_out_fn *);
extern void blk_queue_rq_timeout(struct request_queue *, unsigned int);
extern void blk_queue_flush(struct request_queue *q, unsigned int flush);
+extern void blk_queue_flush_queueable(struct request_queue *q, bool queueable);
extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev);
extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *);
@@ -1111,6 +1113,11 @@ static inline unsigned int block_size(st
return bdev->bd_block_size;
}
+static inline bool queue_flush_queueable(struct request_queue *q)
+{
+ return !q->flush_not_queueable;
+}
+
typedef struct {struct page *v;} Sector;
unsigned char *read_dev_sector(struct block_device *, sector_t, Sector *);
Index: linux/block/blk-settings.c
===================================================================
--- linux.orig/block/blk-settings.c 2011-05-05 08:37:05.000000000 +0800
+++ linux/block/blk-settings.c 2011-05-05 09:02:16.000000000 +0800
@@ -790,6 +790,12 @@ void blk_queue_flush(struct request_queu
}
EXPORT_SYMBOL_GPL(blk_queue_flush);
+void blk_queue_flush_queueable(struct request_queue *q, bool queueable)
+{
+ q->flush_not_queueable = !queueable;
+}
+EXPORT_SYMBOL_GPL(blk_queue_flush_queueable);
+
static int __init blk_settings_init(void)
{
blk_max_low_pfn = max_low_pfn - 1;
next prev parent reply other threads:[~2011-05-05 2:04 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-05 1:59 [patch v3 0/3] block: optimize flush for non-queueable flush drive shaohua.li
2011-05-05 1:59 ` shaohua.li [this message]
2011-05-05 2:17 ` [patch v3 1/3] block: add a non-queueable flush flag Jeff Garzik
2011-05-05 2:21 ` Shaohua Li
2011-05-05 7:53 ` Tejun Heo
2011-05-05 1:59 ` [patch v3 2/3] block: hold queue if flush is running for non-queueable flush drive shaohua.li
2011-05-05 8:38 ` Tejun Heo
2011-05-06 4:32 ` Shaohua Li
2011-05-06 6:53 ` Tejun Heo
2011-05-06 17:28 ` Jens Axboe
2011-05-09 13:03 ` Vivek Goyal
2011-05-09 13:50 ` Shaohua Li
2011-05-09 13:58 ` Vivek Goyal
2011-05-09 14:37 ` Tejun Heo
2011-05-05 1:59 ` [patch v3 3/3] SATA: enable non-queueable flush flag shaohua.li
2011-05-05 7:54 ` Tejun Heo
2011-05-05 12:33 ` Jeff Garzik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110505020417.586891398@sli10-conroe.sh.intel.com \
--to=shaohua.li@intel.com \
--cc=djwong@us.ibm.com \
--cc=hch@infradead.org \
--cc=htejun@gmail.com \
--cc=jaxboe@fusionio.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sshtylyov@mvista.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®