From: Greg KH <gregkh@linuxfoundation.org>
To: Xiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
Cc: Guixin Liu <kanie@linux.alibaba.com>,
bostroesser@gmail.com, martin.petersen@oracle.com,
linux-scsi@vger.kernel.org, target-devel@vger.kernel.org,
linux-kernel@vger.kernel.org, xlpang@linux.alibaba.com
Subject: Re: [PATCH 1/2] uio: add ioctl to uio
Date: Thu, 17 Feb 2022 13:30:18 +0100 [thread overview]
Message-ID: <Yg4/2rZsCmOazYgb@kroah.com> (raw)
In-Reply-To: <362edb61-b8ad-495e-2346-8020355c0938@linux.alibaba.com>
On Thu, Feb 17, 2022 at 08:15:29PM +0800, Xiaoguang Wang wrote:
> hi,
>
> > On Thu, Feb 17, 2022 at 10:29:21AM +0800, Guixin Liu wrote:
> > > In TCMU, if backstore holds its own userspace buffer, for read cmd, the
> > > data needs to be copied from userspace buffer to tcmu data area first,
> > > and then needs to be copied from tcmu data area to scsi sgl pages again.
> > >
> > > To solve this problem, add ioctl to uio to let userspace backstore can
> > > copy data between scsi sgl pages and its own buffer directly.
> > >
> > > Reviewed-by: Xiaoguang Wang<xiaoguang.wang@linux.alibaba.com>
> > > Signed-off-by: Guixin Liu<kanie@linux.alibaba.com>
> > > ---
> > > drivers/uio/uio.c | 22 ++++++++++++++++++++++
> > > include/linux/uio_driver.h | 1 +
> > No, sorry, thie uio driver will not be adding ioctls to them. If you
> > need an ioctl, then you should not be using the UIO api but rather use a
> > custom character driver instead.
>
> I found that early in 2015, there was developer trying to add ioctl interface
> to uio framework:https://lore.kernel.org/lkml/20151005080149.GB1747@kroah.com/
See, I rejected your ioctl for the very same reasons :)
It's good that I was consistent...
> Some of my customers use tcm_loop & tcmu to simulate block devices, it's tcmu
> driver that uses uio framework. There maybe more extra work if we tries to replace
> uio with a new character driver.
Why is tcmu using uio at all?
> Currently tcmu has performance bottleneck, Guixin's patch uses ioctl interface
> to bypass tcmu data area. I also have implemented a tcmu zero-copy feature that
> allows tcmu driver map io request sgl's pages to user space, which uses ioctl
> to do this mapping work, similar to network getsockopt(TCP_ZEROCOPY_RECEIVE).
>
> I also understand your concerns about ioctl interface. Except that replacing
> uio with a new character driver in tcmu, are there any less complicated methods
> to complete our needs? Thanks.
I do not know what your needs are, nor what tcmu is, nor why you would
want to simulate a block device to userspace like this through the uio
api, sorry.
good luck!
greg k-h
next prev parent reply other threads:[~2022-02-17 12:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-17 2:29 [PATCH 1/2] uio: add ioctl to uio Guixin Liu
2022-02-17 2:29 ` [PATCH 2/2] scsi:target:tcmu: reduce once copy by using uio ioctl Guixin Liu
2022-02-17 6:45 ` kernel test robot
2022-02-17 8:07 ` kernel test robot
2022-02-17 10:15 ` Greg KH
2022-02-17 11:13 ` Xiaoguang Wang
2022-02-17 12:28 ` Greg KH
2022-02-17 11:10 ` [RFC PATCH] scsi:target:tcmu: tcmu_ioctl_copy_between_sgl_and_iovec() can be static kernel test robot
2022-02-17 11:12 ` [PATCH 2/2] scsi:target:tcmu: reduce once copy by using uio ioctl kernel test robot
2022-02-21 17:09 ` Bodo Stroesser
2022-02-28 8:52 ` Xiaoguang Wang
2022-02-28 10:47 ` Greg KH
2022-02-17 6:13 ` [PATCH 1/2] uio: add ioctl to uio Greg KH
[not found] ` <362edb61-b8ad-495e-2346-8020355c0938@linux.alibaba.com>
2022-02-17 12:30 ` Greg KH [this message]
2022-02-17 12:30 ` Xiaoguang Wang
2022-02-17 6:55 ` kernel test robot
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=Yg4/2rZsCmOazYgb@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=bostroesser@gmail.com \
--cc=kanie@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=target-devel@vger.kernel.org \
--cc=xiaoguang.wang@linux.alibaba.com \
--cc=xlpang@linux.alibaba.com \
/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