From: "Thorbjørn Lind" <mtl@slowbone.net>
To: <linux-kernel@vger.kernel.org>
Subject: Re: [patch] 2.5.48-bk, md raid0 fix
Date: Wed, 20 Nov 2002 07:26:04 +0100 [thread overview]
Message-ID: <003e01c2905d$b413a5e0$0201a8c0@mtl> (raw)
In-Reply-To: 15835.5488.59408.747895@wombat.chubb.wattle.id.au
> Are you not using power-of-two sized chunks? If not, use the
Yes
> You could try ... (untested)
> - return (chunk_size - ((block & (chunk_size - 1)) + bio_sz)) << 10;
> + return (chunk_size - (sector_div(block, chunk_size) + bio_sz)) << 10;
No good either.. not many using raid0 I guess :)
... here is what happenes with either of the above.
raid0_mergeable: chunk_size 32768 bi_sector 524288, bi_size 0, bv_len 4096, ret 28672
raid0_mergeable: chunk_size 32768 bi_sector 100401152, bi_size 0, bv_len 4096, ret 28672
raid0_mergeable: chunk_size 32768 bi_sector 96, bi_size 0, bv_len 4096, ret 12288
raid0_mergeable: chunk_size 32768 bi_sector 4216, bi_size 0, bv_len 4096, ret 0
kernel BUG at drivers/block/ll_rw_blk.c:1995!
invalid operand: 0000
Should it really return 0 when we are actually ready to recieve that 4k request? That is.. should it
return how much can be merged or how much it can take after the merge. The first seems to work.
That would be something like:
--- a/drivers/md/raid0.c 2002-11-18 05:29:46.000000000 +0100
+++ b/drivers/md/raid0.c 2002-11-20 07:19:15.000000000 +0100
@@ -173,15 +173,10 @@
static int raid0_mergeable_bvec(request_queue_t *q, struct bio *bio, struct bio_vec *biovec)
{
mddev_t *mddev = q->queuedata;
- sector_t block;
- unsigned int chunk_size;
- unsigned int bio_sz;
+ unsigned int chunk_sects = mddev->chunk_size >> 9;
+ unsigned int max_sectors = chunk_sects - (bio->bi_sector % chunk_sects);
- chunk_size = mddev->chunk_size >> 10;
- block = bio->bi_sector >> 1;
- bio_sz = (bio->bi_size + biovec->bv_len) >> 10;
-
- return (chunk_size - ((block & (chunk_size - 1)) + bio_sz)) << 10;
+ return (max_sectors - (bio->bi_size >> 9)) << 9;
}
static int raid0_run (mddev_t *mddev)
next prev parent reply other threads:[~2002-11-20 6:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <101840980@toto.iv>
2002-11-20 4:54 ` [patch] 2.5.48-bk, md raid0 fix Peter Chubb
2002-11-20 6:26 ` Thorbjørn Lind [this message]
2002-11-20 1:28 Thorbjørn Lind
2002-11-20 7:09 ` Andrew Morton
2002-11-20 7:38 ` Thorbjørn Lind
2002-11-21 0:36 ` Neil Brown
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='003e01c2905d$b413a5e0$0201a8c0@mtl' \
--to=mtl@slowbone.net \
--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