RE: Zero-copy for large amounts of streaming data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks, Shawn. I did look at the SCSI st and sg drivers briefly and will
continue to do so. I guess I did not understand the purpose of the
nopage handler. 

You said: --start quote--
I should also mention that get_user_pages() does not map a user-mode >
buffer into the kernel address space.  It only returns a page locked
array of the physical pages from the user-mode buffer.  That is OK
because you normally don't need the buffer mapped to the kernel address
space when performing direct I/O.
--end quote--

Would it then be possible for my driver to submit the user buffer
addresses for DMA? Basically, I am asking is get_user_pages() the right
way to go for my problem?

- priya

-----Original Message-----
From: Shawn Bohrer [mailto:shawn.bohrer@xxxxxxxxx] 
Sent: Thursday, March 19, 2009 4:23 AM
To: Priya Suryanarayanan
Cc: kernelnewbies@xxxxxxxxxxxx; Priya Suryanarayanan
Subject: Re: Zero-copy for large amounts of streaming data

On Wed, Mar 18, 2009 at 05:30:16PM -0500, Shawn Bohrer wrote:
> On Wed, Mar 18, 2009 at 08:52:40PM +0800, Priya Suryanarayanan wrote:
> >    I have not ever used the direct I/O APIs. I understand these
enable
> >    mapping user buffers to kernel address space ( get_user_pages() )
and
> >    the reverse - mapping kernel buffers to user address space (
mmap() ).
> >    However, I find the explanation in Rubini hard to follow,
(especially
> >    for mmap()), and the sample drivers are slightly better.
> 
> I would recommend reading chapter 15 of Linux Device Drivers, Third
> Edition:
> 
> http://lwn.net/Kernel/LDD3/

Sorry I just realized that when you said "Rubini" that you probably were
referring to LDD3.  So if reading chapter 15 of LDD3 didn't answer your
questions then the next thing I would look for is some example code.
Luckily the kernel source is almost always full of good examples so why
not grap the kernel tree and try:

git grep get_user_pages drivers/

The list is actually rather small but there is still enough there to
give you several examples.

--
Shawn


This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.



--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux