mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: lsorense@csclub.uwaterloo.ca (Lennart Sorensen)
To: Francis Moreau <francis.moro@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: How to avoid data copies in a driver ?
Date: Thu, 15 May 2008 09:59:01 -0400	[thread overview]
Message-ID: <20080515135901.GX7577@csclub.uwaterloo.ca> (raw)
In-Reply-To: <38b2ab8a0805150044q3f336d64v20dd5ac78a2c1af2@mail.gmail.com>

On Thu, May 15, 2008 at 09:44:37AM +0200, Francis Moreau wrote:
> 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 ?

I was asking if that would work.  Does the to_user and from_user work on
a pointer from user space if that pointer points at a memory mapped
file?

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

Oh I thought you just wanted user space to be able to ask for a chunk of
data.  I wouldn't want to write to a file in an interrupt handler.
Compared to the disk I/O a memory copy sounds rather insignificant to
the overall process.

-- 
Len Sorensen

  reply	other threads:[~2008-05-15 13:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-14 19:54 Francis Moreau
2008-05-14 20:02 ` Lennart Sorensen
2008-05-15  7:44   ` Francis Moreau
2008-05-15 13:59     ` Lennart Sorensen [this message]
2008-05-16 20:17       ` Francis Moreau
2008-05-14 21:23 ` linux-os (Dick Johnson)
2008-05-15  7:40   ` Francis Moreau
2008-05-15 11:50     ` Arnd Hannemann
2008-05-15 12:08       ` Francis Moreau
2008-05-15 13:16     ` linux-os (Dick Johnson)
2008-05-16  8:10     ` Jeremy Fitzhardinge
2008-05-16 11:44       ` Francis Moreau
2008-05-21 10:41 ` Pavel Machek

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=20080515135901.GX7577@csclub.uwaterloo.ca \
    --to=lsorense@csclub.uwaterloo.ca \
    --cc=francis.moro@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®