From: Tejun Heo <tj@kernel.org>
To: Vladislav Bolkhovitin <vst@vlnb.net>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
scst-devel@lists.sourceforge.net,
Boaz Harrosh <bharrosh@panasas.com>,
James Bottomley <James.Bottomley@HansenPartnership.com>,
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
Jens Axboe <jens.axboe@oracle.com>,
Joe Eykholt <jeykholt@cisco.com>
Subject: Re: [PATCH v2]: New implementation of scsi_execute_async()
Date: Thu, 16 Jul 2009 16:52:51 +0900 [thread overview]
Message-ID: <4A5EDC53.5050902@kernel.org> (raw)
In-Reply-To: <4A5CAFB5.1000901@vlnb.net>
Hello, Vladislav.
Sorry about the delay.
Vladislav Bolkhovitin wrote:
> This patch reimplements scsi_execute_async(). In the new version
> it's a lot less hackish and also has additional features. Namely:
:-)
> 1. Possibility to insert commands both in tail and in head of the queue.
>
> 2. Possibility to explicitly specify if the last SG element has
> space for padding.
>
> This patch based on the previous patches posted by Tejun
> Heo. Comparing to them it has the following improvements:
>
> 1. It uses BIOs chaining instead of kmalloc()ing the whole bio.
>
> 2. It uses SGs chaining instead of kmalloc()ing one big SG in case
> if direct mapping failed (e.g. because of DMA alignment or padding).
>
> 3. If direct mapping failed, if possible, it copies only the last SG
> element, not the whole SG.
>
> 4. When needed, copy_page() is used instead of memcpy() to copy the
> whole pages.
>
> Also this patch adds and exports functions sg_copy() and
> sg_copy_elem(), which cop one SG to another and one SG element to
> another respectively.
>
> At the moment SCST is the only user of this functionality. It needs
> it, because its target drivers, which are, basically, SCSI drivers,
> can deal only with SGs, not with BIOs. But, according the latest
> discussions, there are other potential users for of this
> functionality, so I'm sending this patch in a hope that it will be
> also useful for them and eventually will be merged in the mainline
> kernel.
>
> This patch requires previously sent patch with subject "[PATCH]:
> Rename REQ_COPY_USER to more descriptive
> REQ_HAS_TAIL_SPACE_FOR_PADDING".
The original patchset was focused more on unifying user and kernel and
user sg mapping handling. It seems you implemented the kernel part
completely separately. Wouldn't it be better to unify where possible?
Or is there some fundamental reason that can't be done that I missed?
Also, code organization-wise, I think good part of the posted code
belongs to bio.c.
The tail-only copying is nice but I'm not entirely sure whether such
full-blown approach is necessary. The tail padding was added
primarily for dumb ATAPI devices which want to transfer more bytes
than requested. Having extra space at the end makes the driver's job
much easier as it can just overflow into the area. Some controller do
have "drain after this" flag in the dma table but some simply can't
handle such situations properly without explicit overflow area.
So, being the horrid hack it is and highly unlikely to be used in
performance sensitive path, I think it would be better to keep the
implementation simple and dull. It just isn't something worth
investing complexity over. Of course, if you have a use case which
requires high performance tail padding, it's a different story.
Thanks.
--
tejun
next prev parent reply other threads:[~2009-07-16 7:54 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-09 18:14 [PATCH]: New implementation of scsi_execute_async() Vladislav Bolkhovitin
2009-07-09 19:35 ` Joe Eykholt
2009-07-10 10:59 ` Joe Eykholt
2009-07-14 16:16 ` Vladislav Bolkhovitin
2009-07-12 13:03 ` Boaz Harrosh
2009-07-14 16:16 ` Vladislav Bolkhovitin
2009-07-15 8:19 ` Boaz Harrosh
2009-07-16 18:13 ` Vladislav Bolkhovitin
2009-07-19 11:34 ` Boaz Harrosh
2009-07-20 17:54 ` Vladislav Bolkhovitin
2009-07-21 8:03 ` Boaz Harrosh
2009-07-21 18:26 ` Vladislav Bolkhovitin
2009-07-14 16:17 ` [PATCH v2]: " Vladislav Bolkhovitin
2009-07-14 18:24 ` Vladislav Bolkhovitin
2009-07-15 9:07 ` Boaz Harrosh
2009-07-15 17:48 ` Joe Eykholt
2009-07-16 18:15 ` Vladislav Bolkhovitin
2009-07-16 7:54 ` Tejun Heo
2009-07-16 18:15 ` Vladislav Bolkhovitin
2009-07-19 11:35 ` Boaz Harrosh
2009-07-20 17:56 ` Vladislav Bolkhovitin
2009-07-16 7:52 ` Tejun Heo [this message]
2009-07-16 18:17 ` Vladislav Bolkhovitin
2009-08-12 17:47 ` [PATCH]: Implementation of blk_rq_map_kern_sg() (aka New implementation of scsi_execute_async() v3) Vladislav Bolkhovitin
2009-08-15 8:22 ` Jens Axboe
2009-09-03 16:34 ` Vladislav Bolkhovitin
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=4A5EDC53.5050902@kernel.org \
--to=tj@kernel.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=bharrosh@panasas.com \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=jens.axboe@oracle.com \
--cc=jeykholt@cisco.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=scst-devel@lists.sourceforge.net \
--cc=vst@vlnb.net \
/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).