All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
To: Alasdair Kergon <agk@redhat.com>
Cc: device-mapper development <dm-devel@redhat.com>
Subject: [PATCH 4/7] dm core: don't set QUEUE_ORDERED_DRAIN for request-based dm
Date: Fri, 24 Apr 2009 17:14:43 +0900	[thread overview]
Message-ID: <49F174F3.8010008@ct.jp.nec.com> (raw)
In-Reply-To: <49F17409.4060201@ct.jp.nec.com>

Request-based dm doesn't have barrier support yet.
So we need to set QUEUE_ORDERED_DRAIN only for bio-based dm.
Since the device type is decided at the first table loading time,
the flag set is deferred until then.


Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: Alasdair G Kergon <agk@redhat.com>
---
 drivers/md/dm-table.c |    5 +++++
 drivers/md/dm.c       |   11 ++++++++++-
 drivers/md/dm.h       |    1 +
 3 files changed, 16 insertions(+), 1 deletion(-)

Index: 2.6.30-rc3/drivers/md/dm-table.c
===================================================================
--- 2.6.30-rc3.orig/drivers/md/dm-table.c
+++ 2.6.30-rc3/drivers/md/dm-table.c
@@ -819,6 +819,11 @@ int dm_table_get_type(struct dm_table *t
 		DM_TYPE_BIO_BASED : DM_TYPE_REQUEST_BASED;
 }
 
+int dm_table_bio_based(struct dm_table *t)
+{
+	return dm_table_get_type(t) == DM_TYPE_BIO_BASED;
+}
+
 int dm_table_request_based(struct dm_table *t)
 {
 	return dm_table_get_type(t) == DM_TYPE_REQUEST_BASED;
Index: 2.6.30-rc3/drivers/md/dm.c
===================================================================
--- 2.6.30-rc3.orig/drivers/md/dm.c
+++ 2.6.30-rc3/drivers/md/dm.c
@@ -1779,7 +1779,6 @@ static struct mapped_device *alloc_dev(i
 	md->queue->backing_dev_info.congested_fn = dm_any_congested;
 	md->queue->backing_dev_info.congested_data = md;
 	blk_queue_make_request(md->queue, dm_request);
-	blk_queue_ordered(md->queue, QUEUE_ORDERED_DRAIN, NULL);
 	blk_queue_bounce_limit(md->queue, BLK_BOUNCE_ANY);
 	md->queue->unplug_fn = dm_unplug_all;
 	blk_queue_merge_bvec(md->queue, dm_merge_bvec);
@@ -2206,6 +2205,16 @@ int dm_swap_table(struct mapped_device *
 		goto out;
 	}
 
+	/*
+	 * It is enought that blk_queue_ordered() is called only once when
+	 * the first bio-based table is bound.
+	 *
+	 * This setting should be moved to alloc_dev() when request-based dm
+	 * supports barrier.
+	 */
+	if (!md->map && dm_table_bio_based(table))
+		blk_queue_ordered(md->queue, QUEUE_ORDERED_DRAIN, NULL);
+
 	__unbind(md);
 	r = __bind(md, table);
 
Index: 2.6.30-rc3/drivers/md/dm.h
===================================================================
--- 2.6.30-rc3.orig/drivers/md/dm.h
+++ 2.6.30-rc3/drivers/md/dm.h
@@ -58,6 +58,7 @@ int dm_table_any_congested(struct dm_tab
 int dm_table_any_busy_target(struct dm_table *t);
 int dm_table_set_type(struct dm_table *t);
 int dm_table_get_type(struct dm_table *t);
+int dm_table_bio_based(struct dm_table *t);
 int dm_table_request_based(struct dm_table *t);
 int dm_table_alloc_md_mempools(struct dm_table *t);
 void dm_table_free_md_mempools(struct dm_table *t);

  parent reply	other threads:[~2009-04-24  8:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-24  8:10 [PATCH 0/7] request-based dm-multipath (v2) Kiyoshi Ueda
2009-04-24  8:12 ` [PATCH 1/7] dm core: add core functions for request-based dm Kiyoshi Ueda
2009-04-24  8:45   ` Hannes Reinecke
2009-04-24  8:13 ` [PATCH 2/7] dm core: add integrity feature to " Kiyoshi Ueda
2009-04-24  8:46   ` Hannes Reinecke
2009-04-24  8:14 ` [PATCH 3/7] dm core: enable " Kiyoshi Ueda
2009-04-24  8:50   ` Hannes Reinecke
2009-04-24  8:14 ` Kiyoshi Ueda [this message]
2009-04-24  8:51   ` [PATCH 4/7] dm core: don't set QUEUE_ORDERED_DRAIN for " Hannes Reinecke
2009-04-24  8:15 ` [PATCH 5/7] dm core: reject I/O violating new queue limits Kiyoshi Ueda
2009-04-24  8:59   ` Hannes Reinecke
2009-04-28  7:49     ` Kiyoshi Ueda
2009-06-23  5:46       ` Kiyoshi Ueda
2009-04-24  8:15 ` [PATCH 6/7] dm core: disable interrupt when taking map_lock Kiyoshi Ueda
2009-04-24  9:00   ` Hannes Reinecke
2009-04-24 11:50   ` Christof Schmitt
2009-04-24  8:16 ` [PATCH 7/7] dm-mpath: convert to request-based Kiyoshi Ueda
2009-04-24  9:04   ` Hannes Reinecke

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=49F174F3.8010008@ct.jp.nec.com \
    --to=k-ueda@ct.jp.nec.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.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 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.