From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [PATCH 2 of 3] block: Block layer data integrity support
Date: Tue, 17 Jun 2008 00:54:19 -0400 [thread overview]
Message-ID: <yq1zlpkd5l0.fsf@sermon.lab.mkp.net> (raw)
In-Reply-To: <20080616192104.GV20851@kernel.dk> (Jens Axboe's message of "Mon\, 16 Jun 2008 21\:21\:04 +0200")
>>>>> "Jens" == Jens Axboe <jens.axboe@oracle.com> writes:
Jens,
I've fixed pretty much everything you pointed out. So unless
otherwise noted it's an ACK.
> + if (bi->sector_size == 4096)
> + sectors >>= 3;
Jens> This could do with a comment on why it's only 512b or 4kb.
Ok, I've fanned all occurrences of these into a helper function that
explains the "block layer" sector to hardware sector conversion.
> + /* Allocate kernel buffer for protection data */
> + len = sectors * blk_integrity_tuple_size(bi);
> + buf = kmalloc(len, GFP_NOIO | q->bounce_gfp);
> + if (unlikely(buf == NULL)) {
> + printk(KERN_ERR "could not allocate integrity buffer\n");
> + return -EIO;
> + }
Jens> Is that good enough, don't you want to handle this error
Jens> condition? IOW, doesn't this allocation want mempool backing or
Jens> similar?
When I originally wrote this I had a couple of mempools that worked
well with ext2/3 because they blow everything into 4KB (or 1KB)
atoms. Due to the problems with ext2/3 modifying pages in flight I've
mostly used XFS and btrfs for development. And they both generate a
much more varied set of bio sizes that in turn will require a whole
whack of different sized integrity pools.
I did gather quite a bit of statistics from runs with different
filesystems a few months ago. kmalloc provided a good set of pre-made
sizes and I felt it was an overkill to replicate that. But you are
right that we should probably be more conservative in terms of failing
the I/O. I'll look at it again.
> struct bio_pair {
> struct bio bio1, bio2;
> struct bio_vec bv1, bv2;
> +#if defined(CONFIG_BLK_DEV_INTEGRITY)
> + struct bip bip1, bip2;
> + struct bio_vec iv1, iv2;
> +#endif
> atomic_t cnt;
> int error;
> };
Jens> That's somewhat of a shame, it makes bio_pair a LOT bigger. bio
Jens> grows a pointer if CONFIG_BLK_DEV_INTEGRITY, that we can live
Jens> with. In reality, very few people will use this stuff so adding
Jens> a sizable chunk of data to struct bio_pair is somewhat of a
Jens> bother.
Yeah, well. Wasn't sure what else to do. But the pool is tiny (2
entries by default) and only pktdvd and raid 0/10 actually use
bio_pairs. I figured if you had CONFIG_BLK_DEV_INTEGRITY on you'd
probably want to use integrity it on your MD disks anyway. And on
your desktop box with pktdvd integrity wasn't likely to be compiled
in.
Dynamic allocation would defeat the purpose of the pool. But I guess
I could make another dedicated bio_integrity_pair pool and wire the
integrity portion into bio_pair using pointers. What do you think?
--
Martin K. Petersen Oracle Linux Engineering
next prev parent reply other threads:[~2008-06-17 4:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-16 4:10 [PATCH 0 of 3] Block Layer Data Integrity Martin K. Petersen
2008-06-16 4:10 ` [PATCH 1 of 3] block: Globalize bio_set and bio_vec_slab Martin K. Petersen
2008-06-16 19:21 ` Jens Axboe
2008-06-16 4:10 ` [PATCH 2 of 3] block: Block layer data integrity support Martin K. Petersen
2008-06-16 19:21 ` Jens Axboe
2008-06-17 4:54 ` Martin K. Petersen [this message]
2008-06-17 7:20 ` Jens Axboe
2008-06-16 4:10 ` [PATCH 3 of 3] block: Data integrity infrastructure documentation Martin K. Petersen
2008-06-16 19:20 ` Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2008-06-17 15:57 [PATCH 0 of 3] Block Layer Data Integrity Martin K. Petersen
2008-06-17 15:57 ` [PATCH 2 of 3] block: Block layer data integrity support Martin K. Petersen
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=yq1zlpkd5l0.fsf@sermon.lab.mkp.net \
--to=martin.petersen@oracle.com \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@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