mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: shaohua.li@intel.com
To: linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org
Cc: jaxboe@fusionio.com, htejun@gmail.com, jgarzik@pobox.com,
	hch@infradead.org, djwong@us.ibm.com,
	Shaohua Li <shaohua.li@intel.com>
Subject: [patch v2 1/3] block: add a non-queueable flush flag
Date: Wed, 04 May 2011 16:17:26 +0800	[thread overview]
Message-ID: <20110504082115.093981766@sli10-conroe.sh.intel.com> (raw)
In-Reply-To: <20110504081725.946950281@sli10-conroe.sh.intel.com>

[-- Attachment #1: blk-nonqueueable-flush-flag.patch --]
[-- Type: text/plain, Size: 1234 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>
---
 include/linux/blkdev.h |   11 +++++++++++
 1 file changed, 11 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-04 14:24:40.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;
@@ -549,6 +550,16 @@ static inline void blk_clear_queue_full(
 		queue_flag_clear(QUEUE_FLAG_ASYNCFULL, q);
 }
 
+static inline void blk_set_queue_flush_queueable(struct request_queue *q,
+		bool queueable)
+{
+	q->flush_not_queueable = !queueable;
+}
+
+static inline bool blk_queue_flush_queueable(struct request_queue *q)
+{
+	return !q->flush_not_queueable;
+}
 
 /*
  * mergeable request must not have _NOMERGE or _BARRIER bit set, nor may


  reply	other threads:[~2011-05-04  8:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-04  8:17 [patch v2 0/3] block: optimize flush for non-queueable flush drive shaohua.li
2011-05-04  8:17 ` shaohua.li [this message]
2011-05-04  9:05   ` [patch v2 1/3] block: add a non-queueable flush flag Tejun Heo
2011-05-04  8:17 ` [patch v2 2/3] block: hold queue if flush is running for non-queueable flush drive shaohua.li
2011-05-04  9:09   ` Tejun Heo
2011-05-04 10:42   ` Sergei Shtylyov
2011-05-04  8:17 ` [patch v2 3/3] SATA: enable non-queueable flush flag shaohua.li
2011-05-04  8:53   ` Tejun Heo
2011-05-04 10:29     ` 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=20110504082115.093981766@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 \
    /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®