From: Miquel van Smoorenburg <miquels@cistron.nl>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, Jens Axboe <axboe@suse.de>,
Joe Thornber <thornber@redhat.com>
Subject: Re: [PATCH] backing dev unplugging
Date: Thu, 11 Mar 2004 01:05:07 +0100 [thread overview]
Message-ID: <20040311000507.GE18222@drinkel.cistron.nl> (raw)
In-Reply-To: <20040310150542.13d71a39.akpm@osdl.org> (from akpm@osdl.org on Thu, Mar 11, 2004 at 00:05:42 +0100)
On Thu, 11 Mar 2004 00:05:42, Andrew Morton wrote:
> "Miquel van Smoorenburg" <miquels@cistron.nl> wrote:
> >
> >
> > With the latest patches from Joe it would be more like
> >
> > map = dm_get_table(md);
> > if (map) {
> > dm_table_unplug_all(map);
> > dm_table_put(map);
> > }
> >
> > No lock ranking issues, you just get a refcounted map (table, really).
>
> Ah, OK. Jens, you'll be needing this (on rc2-mm1):
>
> dm.c: protect md->map with a rw spin lock rather than the md->lock
> semaphore. Also ensure that everyone accesses md->map through
> dm_get_table(), rather than directly.
>
> 25-akpm/drivers/md/dm-table.c | 3 +
> 25-akpm/drivers/md/dm.c | 88 +++++++++++++++++++++++++-----------------
.. and this final one on top of it, presumably.
See https://www.redhat.com/archives/dm-devel/2004-March/msg00036.html
dm.c: remove __dm_request (merge with previous patch).
--- diff/drivers/md/dm.c 2004-03-08 15:48:05.000000000 +0000
+++ source/drivers/md/dm.c 2004-03-09 09:40:37.000000000 +0000
@@ -506,8 +506,13 @@ static void __split_bio(struct mapped_de
{
struct clone_info ci;
- ci.md = md;
ci.map = dm_get_table(md);
+ if (!ci.map) {
+ bio_io_error(bio, bio->bi_size);
+ return;
+ }
+
+ ci.md = md;
ci.bio = bio;
ci.io = alloc_io(md);
ci.io->error = 0;
@@ -530,17 +535,6 @@ static void __split_bio(struct mapped_de
* CRUD END
*---------------------------------------------------------------*/
-
-static inline void __dm_request(struct mapped_device *md, struct bio *bio)
-{
- if (!md->map) {
- bio_io_error(bio, bio->bi_size);
- return;
- }
-
- __split_bio(md, bio);
-}
-
/*
* The request function that just remaps the bio built up by
* dm_merge_bvec.
@@ -579,7 +573,7 @@ static int dm_request(request_queue_t *q
down_read(&md->lock);
}
- __dm_request(md, bio);
+ __split_bio(md, bio);
up_read(&md->lock);
return 0;
}
@@ -591,7 +585,6 @@ static int dm_any_congested(void *conges
struct dm_table *map = dm_get_table(md);
if (!map || test_bit(DMF_BLOCK_IO, &md->flags))
- /* FIXME: shouldn't suspended count a congested ? */
r = bdi_bits;
else
r = dm_table_any_congested(map, bdi_bits);
@@ -850,7 +843,7 @@ static void __flush_deferred_io(struct m
while (c) {
n = c->bi_next;
c->bi_next = NULL;
- __dm_request(md, c);
+ __split_bio(md, c);
c = n;
}
}
Mike.
next prev parent reply other threads:[~2004-03-11 0:07 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-10 12:45 Jens Axboe
2004-03-10 19:55 ` Andrew Morton
2004-03-10 20:03 ` Kenneth Chen
2004-03-10 20:20 ` Jens Axboe
2004-03-10 20:45 ` Jesse Barnes
2004-03-10 20:49 ` Jens Axboe
[not found] ` <20040310205237.GK15087@suse.de>
2004-03-10 21:01 ` Jesse Barnes
2004-03-10 21:02 ` Jens Axboe
2004-03-10 21:35 ` Jesse Barnes
2004-03-10 23:54 ` Andrew Morton
2004-03-11 0:03 ` David Mosberger
2004-03-11 6:30 ` Jesse Barnes
2004-03-10 20:17 ` Jens Axboe
2004-03-15 5:53 ` Kenneth Chen
2004-03-10 20:14 ` Jeff Garzik
2004-03-10 20:19 ` Jens Axboe
2004-03-10 21:00 ` Andrew Morton
2004-03-10 21:02 ` Jens Axboe
2004-03-10 21:40 ` Miquel van Smoorenburg
2004-03-10 23:05 ` Andrew Morton
2004-03-11 0:05 ` Miquel van Smoorenburg [this message]
2004-03-11 0:17 ` Andrew Morton
2004-03-11 6:43 ` Jens Axboe
2004-03-10 22:22 ` Nathan Scott
2004-03-10 23:32 ` Steve Lord
2004-03-11 7:05 ` Jens Axboe
2004-03-11 9:14 ` Joe Thornber
2004-03-11 9:16 ` Jens Axboe
2004-03-11 12:17 ` Christophe Saout
2004-03-11 12:22 ` Jens Axboe
2004-03-11 13:11 ` Christophe Saout
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=20040311000507.GE18222@drinkel.cistron.nl \
--to=miquels@cistron.nl \
--cc=akpm@osdl.org \
--cc=axboe@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=thornber@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 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®