From: Kevin Corry <corryk@us.ibm.com>
To: Denis Vlasenko <vda@port.imtp.ilyichevsk.odessa.ua>,
Joe Thornber <joe@fib011235813.fsnet.co.uk>
Cc: Linus Torvalds <torvalds@transmeta.com>,
Kernel Mailing List <linux-kernel@vger.kernel.org>,
lvm-devel@sistina.com
Subject: Re: [PATCH] dm.c - device-mapper I/O path fixes
Date: Wed, 11 Dec 2002 07:16:53 -0600 [thread overview]
Message-ID: <02121107165303.29515@boiler> (raw)
In-Reply-To: <200212111330.gBBDTTa06416@Port.imtp.ilyichevsk.odessa.ua>
On Wednesday 11 December 2002 12:19, Denis Vlasenko wrote:
> On 11 December 2002 10:19, Joe Thornber wrote:
> > dec_pending(): only bother spin locking if io->error is going to be
> > updated. [Kevin Corry]
> >
> > --- diff/drivers/md/dm.c 2002-12-11 12:00:29.000000000 +0000
> > +++ source/drivers/md/dm.c 2002-12-11 12:00:34.000000000 +0000
> > @@ -238,10 +238,11 @@
> > static spinlock_t _uptodate_lock = SPIN_LOCK_UNLOCKED;
> > unsigned long flags;
> >
> > - spin_lock_irqsave(&_uptodate_lock, flags);
> > - if (error)
> > + if (error) {
> > + spin_lock_irqsave(&_uptodate_lock, flags);
> > io->error = error;
> > - spin_unlock_irqrestore(&_uptodate_lock, flags);
> > + spin_unlock_irqrestore(&_uptodate_lock, flags);
> > + }
> >
> > if (atomic_dec_and_test(&io->io_count)) {
> > if (atomic_dec_and_test(&io->md->pending))
>
> This seems pointless, end result:
>
> spin_lock_irqsave(&_uptodate_lock, flags);
> io->error = error;
> spin_unlock_irqrestore(&_uptodate_lock, flags);
Are you saying the "if (error)" part is pointless? If so, I have to disagree.
A bio may be split into several sub-bio's. When each of those split bio's
completes, they are going to call this function. But if only one of those
split bio's has an error, then the error might get lost without that "if"
statement.
However, it might be a good idea to consider how bio's keep track of errors.
When a bio is created, it is marked UPTODATE. Then, if any part of a bio
takes an error, the UPTODATE flag is turned off. When the whole bio
completes, if the UPTODATE flag is still on, there were no errors during the
i/o. Perhaps the "error" field in "struct dm_io" could be modified to use
this method of error tracking? Then we could change dec_pending() to be
something like:
if (error)
clear_bit(DM_IO_UPTODATE, &io->error);
with a "set_bit(DM_IO_UPTODATE, &ci.io->error);" in __bio_split().
--
Kevin Corry
corryk@us.ibm.com
http://evms.sourceforge.net/
next prev parent reply other threads:[~2002-12-11 13:55 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-10 22:03 [PATCH] dm.c - device-mapper I/O path fixes Kevin Corry
2002-12-11 12:17 ` Joe Thornber
2002-12-11 12:19 ` Joe Thornber
2002-12-11 18:19 ` Denis Vlasenko
2002-12-11 13:16 ` Kevin Corry [this message]
2002-12-11 14:18 ` Joe Thornber
2002-12-11 19:24 ` Denis Vlasenko
2002-12-11 14:06 ` Kevin Corry
2002-12-11 21:12 ` Paul Mackerras
2002-12-12 12:30 ` Kevin Corry
2002-12-11 19:19 ` Denis Vlasenko
2002-12-11 14:02 ` Kevin Corry
2002-12-11 15:12 ` [lvm-devel] " Joe Thornber
2002-12-11 14:58 ` Joe Thornber
2002-12-11 12:19 ` Joe Thornber
2002-12-11 12:20 ` Joe Thornber
2002-12-11 12:21 ` Joe Thornber
2002-12-11 12:52 ` [lvm-devel] " Kevin Corry
2002-12-16 0:50 ` Linus Torvalds
2002-12-16 10:04 ` Joe Thornber
2002-12-16 10:06 ` 1/19 Joe Thornber
2002-12-16 17:07 ` 1/19 Linus Torvalds
2002-12-16 10:06 ` 2/19 Joe Thornber
2002-12-16 10:07 ` 3/19 Joe Thornber
2002-12-16 10:08 ` 4/19 Joe Thornber
2002-12-16 10:09 ` 5/19 Joe Thornber
2002-12-16 10:09 ` 6/19 Joe Thornber
2002-12-16 10:35 ` 6/19 Tomas Szepe
2002-12-16 10:38 ` 6/19 Tomas Szepe
2002-12-16 10:10 ` 7/19 Joe Thornber
2002-12-16 10:11 ` 8/19 Joe Thornber
2002-12-16 10:11 ` 9/19 Joe Thornber
2002-12-16 10:12 ` 10/19 Joe Thornber
2002-12-16 10:13 ` 11/19 Joe Thornber
2002-12-16 10:14 ` 12/19 Joe Thornber
2002-12-16 10:14 ` 13/19 Joe Thornber
2002-12-16 10:15 ` 14/19 Joe Thornber
2002-12-16 10:16 ` 15/19 Joe Thornber
2002-12-16 10:16 ` 16/19 Joe Thornber
2002-12-16 10:17 ` 17/19 Joe Thornber
2002-12-16 10:18 ` 18/19 Joe Thornber
2002-12-16 10:19 ` 19/19 Joe Thornber
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=02121107165303.29515@boiler \
--to=corryk@us.ibm.com \
--cc=joe@fib011235813.fsnet.co.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=lvm-devel@sistina.com \
--cc=torvalds@transmeta.com \
--cc=vda@port.imtp.ilyichevsk.odessa.ua \
/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