Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Apr 2015 12:10:43 -0700
From:      Adrian Chadd <adrian@freebsd.org>
To:        Warner Losh <imp@bsdimp.com>
Cc:        John Baldwin <jhb@freebsd.org>, Konstantin Belousov <kostikbel@gmail.com>,  Jason Harmening <jason.harmening@gmail.com>, Svatopluk Kraus <onwahe@gmail.com>,  freebsd-arch <freebsd-arch@freebsd.org>
Subject:   Re: bus_dmamap_sync() for bounced client buffers from user address space
Message-ID:  <CAJ-VmomqGkEFVauya%2BrmPGcD_-=Z-mmg1RSDf1D2bT_DfwPBGA@mail.gmail.com>
In-Reply-To: <38574E63-2D74-4ECB-8D68-09AC76DFB30C@bsdimp.com>
References:  <CAFHCsPXMjge84AR2cR8KXMXWP4kH2YvuV_uqtPKUvn5C3ygknw@mail.gmail.com> <553B9E64.8030907@gmail.com> <20150425163444.GL2390@kib.kiev.ua> <1876382.0PQNo3Rp24@ralph.baldwin.cx> <38574E63-2D74-4ECB-8D68-09AC76DFB30C@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 28 April 2015 at 09:19, Warner Losh <imp@bsdimp.com> wrote:
>
>> On Apr 28, 2015, at 7:40 AM, John Baldwin <jhb@FreeBSD.org> wrote:
>>
>>> I believe UIO_USERSPACE is almost unused, it might be there for some
>>> obscure (and buggy) driver.
>>
>> I believe it was added (and only ever used) in crypto drivers, and that =
they
>> all did bus_dma operations in the context of the thread that passed in t=
he
>> uio.  I definitely think it is fragile and should be replaced with somet=
hing
>> more reliable.
>
> Fusion I/O=E2=80=99s SDK used this trick to allow mapping of userspace bu=
ffers down
> into the block layer after doing the requisite locking / pinning / etc of=
 the buffers
> into memory. That=E2=80=99s if memory serves correctly (the SDK did these=
 things, I can=E2=80=99t
> easily check on that detail since I=E2=80=99m no longer at FIO).

This is a long-standing trick. physio() does it too,
aio_read/aio_write does it for direct block accesses. Now that pbufs
aren't involved anymore, it should scale rather well.

So I'd like to see more of it in the kernel and disk/net APIs and drivers.


-adrian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-VmomqGkEFVauya%2BrmPGcD_-=Z-mmg1RSDf1D2bT_DfwPBGA>