From: Tejun Heo <htejun@gmail.com>
To: Boaz Harrosh <bharrosh@panasas.com>
Cc: bzolnier@gmail.com, linux-kernel@vger.kernel.org,
axboe@kernel.dk, linux-ide@vger.kernel.org
Subject: Re: [PATCH 03/14] block: implement blk_rq_map_kern_prealloc()
Date: Thu, 26 Mar 2009 21:07:20 +0900 [thread overview]
Message-ID: <49CB6FF8.7050701@gmail.com> (raw)
In-Reply-To: <49CB65CB.1030905@panasas.com>
Hello, Boaz.
Boaz Harrosh wrote:
>> For the latter, the APIs are blk_rq_map_{user[_iov]|kern}(). To add
>> to the fun, we have blk_rq_map_sg() which does a completely different
>> thing of mapping an rq's bios to sg and is usually called from low
>> level do_request() when starting to process a request.
>
> Lets just remove for a moment blk_rq_map_sg() from the discussion.
> That one is totally bogus name that gives me the crips every time
> I read its name. If using the same terminology then at minimum it should have
> been blk_sg_map_request() (Which I agree is even more cryptic but at least
> it gets the source-destination right).
Ah... yeah, one of the two definitely needs to get a different name.
>> You're suggesting to add blk_rq_map_bio() which doesn't really map
>> anything but rather allocates and initializes an rq from bio and
>> basically boils down to blk_rq_bio_prep() and blk_queue_bounce().
>
> Yes, as I said, I completely agree. It does not map anything and
> should not be named blk_rq_map_. It should have a different better
> name. Hell it exists today, as blk_rq_append_bio(), but that one
> suggests usage in ways some people don't like, and they want to
> remove it. My opinion is that: Both me and you could just use the
> good old blk_rq_append_bio() and be happy.
>
> So basically in practice it just comes down to renaming
> blk_rq_append_bio() to something. We both just don't know how to call
> it?
Subtly different. blk_rq_append_bio() doesn't bounce. It seems we
really need to figure out who needs what and how to provide the
interface in uniform way.
>> I think it's about time to cool it a bit and try to see what's going
>> on. We don't really want blk_rq_map_*() to do three completely
>> different things, right? Usage of blk_rq_map_{user[_iov]|kern}()
>> isn't too wide spread, so cleaning up the API shouldn't be difficult.
>
> Currently blk_rq_map_sg() is the only odd ball, renaming that to something
> sane will fix the current situation.
>
> What additionally we both want is just plain old blk_rq_append_bio and
> maybe with a better name?
Yeah, basically, something similar to that but without the subtle
traps. :-)
>> The difference explains why we have two different
>> initialization directions, so to me, the current API seems logical
>> although we really should be using different names.
>>
>> Can you please explain what your need is? Why do you want
>> blk_make_request()?
>>
>
> I don't need blk_make_request per-se, I just need a way to
> allocate a request and then associate a pre built bio with it,
> that was prepared by an upper filesystem.
>
> (Which talks OSD, which does not fit the block device model at all,
> but this is too much information for you)
>
> Farther more, My life is more complicated then that because, I need
> a bidi-request which is second request hanging on the first one. And
> each request can map up to 6 segments of source information that
> are finally laid linear on the wire. So my bio can not be built
> with a single blk_rq_map_xxx call.
>
> To make the story short blk_rq_append_bio() can be used by your
> code and mine, perhaps with a better name.
>
> I feel I took to much of your time with my petty problems, Just
> that I felt that if adding an associate-this-request-with-this-bio
> API to blkdev.h could be done in a way that makes both of us happy.
Thanks for the explanation.
I think the problem is unclear distinction between bio initialization
and rq initialization. Ideally, blk_rq_map*() functions should
initialize rq, call appropriate bio map function, link the result into
rq and be done with it, but currently blk_rq_map*() functions do more
than that and that makes cutting out the bio initialization apart
difficult, so in case where bios need to be initialized separately
from rq, the interface gets weird. What level of bio initialization
should the init-rq-from-bio function should expect? Is it already
bounced? Does it have aligned buffer and etc?
If we can define cleaner bio mapping interface and make rq mapping
functions thinner wrapper around those, it will be much better, but
that doesn't seem to be a trivial thing. Is it possible for you to
stay with blk_rq_append_bio() for the time being? I'll revisit the
mapping API once the current pile of patches I'm sitting on settle
down a bit.
Thanks.
--
tejun
next prev parent reply other threads:[~2009-03-26 12:07 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-24 16:06 [PATCHSET pata-2.6] ide: rq->buffer, data, special and misc cleanups Tejun Heo
2009-03-24 16:06 ` [PATCH 01/14] block: clear req->errors on bio completion only for fs requests Tejun Heo
2009-03-24 16:06 ` [PATCH 02/14] block: reorganize [__]bio_map_kern() Tejun Heo
2009-03-24 16:06 ` [PATCH 03/14] block: implement blk_rq_map_kern_prealloc() Tejun Heo
2009-03-25 15:18 ` Boaz Harrosh
2009-03-26 2:10 ` Tejun Heo
2009-03-26 7:42 ` Tejun Heo
2009-03-26 8:05 ` Boaz Harrosh
2009-03-26 8:10 ` Boaz Harrosh
2009-03-26 10:19 ` Tejun Heo
2009-03-26 11:23 ` Boaz Harrosh
2009-03-26 12:07 ` Tejun Heo [this message]
2009-03-26 14:44 ` Boaz Harrosh
2009-03-27 2:26 ` Tejun Heo
2009-04-13 10:07 ` FUJITA Tomonori
2009-03-24 16:06 ` [PATCH 04/14] ide: use blk_run_queue() instead of blk_start_queueing() Tejun Heo
2009-03-24 16:06 ` [PATCH 05/14] ide: don't set REQ_SOFTBARRIER Tejun Heo
2009-03-24 16:06 ` [PATCH 06/14] ide kill unused ide_cmd->special Tejun Heo
2009-03-24 16:06 ` [PATCH 07/14] ide-cd: clear sense buffer before issuing request sense Tejun Heo
2009-03-26 7:20 ` Borislav Petkov
2009-03-26 7:26 ` Tejun Heo
2009-03-24 16:06 ` [PATCH 08/14] ide-floppy: block pc always uses bio Tejun Heo
2009-03-24 16:06 ` [PATCH 09/14] ide-taskfile: don't abuse rq->buffer Tejun Heo
2009-03-24 16:06 ` [PATCH 10/14] ide-atapi: " Tejun Heo
2009-03-24 16:06 ` [PATCH 11/14] ide-cd: " Tejun Heo
2009-03-26 8:34 ` Borislav Petkov
2009-03-24 16:06 ` [PATCH 12/14] ide-pm: don't abuse rq->data Tejun Heo
2009-03-24 16:06 ` [PATCH 13/14] ide-atapi: use bio for request sense Tejun Heo
2009-03-28 8:43 ` Borislav Petkov
2009-03-24 16:06 ` [PATCH 14/14] ide-cd: " Tejun Heo
2009-04-13 8:52 ` Borislav Petkov
2009-03-28 13:51 ` [PATCHSET pata-2.6] ide: rq->buffer, data, special and misc cleanups Bartlomiej Zolnierkiewicz
2009-03-28 14:04 ` Borislav Petkov
2009-03-30 9:12 ` Tejun Heo
2009-03-30 11:14 ` Boaz Harrosh
2009-03-30 17:20 ` Tejun Heo
2009-03-31 8:43 ` Boaz Harrosh
2009-03-31 9:05 ` Tejun Heo
2009-03-31 9:10 ` Tejun Heo
2009-03-31 13:04 ` Boaz Harrosh
2009-03-31 13:43 ` Tejun Heo
2009-04-01 11:50 ` Boaz Harrosh
2009-04-13 7:41 ` FUJITA Tomonori
2009-04-13 7:54 ` Jeff Garzik
2009-04-13 8:22 ` FUJITA Tomonori
2009-04-13 8:31 ` Jeff Garzik
2009-04-13 10:07 ` FUJITA Tomonori
2009-04-13 14:16 ` James Bottomley
2009-03-30 14:50 ` Bartlomiej Zolnierkiewicz
2009-03-30 17:21 ` Tejun Heo
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=49CB6FF8.7050701@gmail.com \
--to=htejun@gmail.com \
--cc=axboe@kernel.dk \
--cc=bharrosh@panasas.com \
--cc=bzolnier@gmail.com \
--cc=linux-ide@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).