lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <38b2ab8a0805150044q3f336d64v20dd5ac78a2c1af2@mail.gmail.com>
Date:	Thu, 15 May 2008 09:44:37 +0200
From:	"Francis Moreau" <francis.moro@...il.com>
To:	"Lennart Sorensen" <lsorense@...lub.uwaterloo.ca>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: How to avoid data copies in a driver ?

On Wed, May 14, 2008 at 10:02 PM, Lennart Sorensen
<lsorense@...lub.uwaterloo.ca> wrote:
> On Wed, May 14, 2008 at 09:54:03PM +0200, Francis Moreau wrote:
>> Hello,
>>
>> I'd like to optimize my driver, which receives data through a fifo and gives
>> them to a user space application. In turns this application moves this data
>> into a file.
>>
>> To avoid several useless copies, I'd like the application to pass to the driver
>> a  file descriptor (?) to  the driver and then the driver can directly move the
>> received data to that file.
>>
>> Could anybody give me some example of such scheme ?
>
> If the application memory mapped the file, would it be able to simply
> pass a pointer to that mapped file as part of the call to the driver and
> the driver would place the data directly at the requested location which
> would then be directly to the file?
>

So I would need to map this pointer into the kernel space, then fill it, take
care of cache coherency, unmap the kernel pointer.

Do you have any example of that in the kernel tree ?

BTW, data are received in interrupt context. Is it safe to put them in mapped
memory  (can I have page fault ?) in this context ?

Thanks
-- 
Francis
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ