RE: kernel virtual page locking..

Eric Lowe (ELowe@SYSTRAN.com)
Fri, 30 Apr 1999 12:57:37 -0400


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01BE932A.902A1D80
Content-Type: text/plain;
charset="iso-8859-1"

> If I want to do a DMA operation in a character driver, i
> believe i have
> to use physical memory. ( by getting kvirt_to_phys() ).
> Is there a fear of this memory getting swapped out while the DMA
> operation is in progress.? If so, then there must be some mechanism of
> locking the pages in the driver. What are the utilities available for
> locking kernel virtual memory.?

There have been several threads discussing this over the past few weeks.
One such thread was "Process VM Addr to Kernel VM Addr at Interrupt Time".
You'll want to see our comments in there.

Currently, there is no standard mechanism for doing this in the kernel.
Instead, you must vmalloc() or kmalloc() memory and use mmap() to map the
kernel memory into the application space. (See the bttv driver in the 2.2.x
kernels for an example) The second method is to use bounce buffers (e.g.
copy_from_user), though your CPU utilization will be high if you do this.

There is real work going on to support user space I/O. If your driver is a
block driver, there is a Raw I/O patch already out there; see Stephen
Tweedie (sct@redhat.com) with questions or comments about that. It's at
ftp://ftp.linux.org.uk/pub/linux/sct/fs/raw*.

--
Eric Lowe
elowe@systran.com
Software Engineer Co-op, Systran Corporation
937-252-5601 x330
((my e-mail gateway is adding the HTML, I can't disable it; please don't
flame me))

------_=_NextPart_001_01BE932A.902A1D80 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> RE: kernel virtual page locking..

> If I want to do a DMA operation in a character = driver, i
> believe i have
> to  use physical memory. ( by getting = kvirt_to_phys() ).
> Is there a fear of this memory getting swapped = out while the DMA
> operation is in progress.? If so, then there = must be some mechanism of
> locking the pages in the driver. What are the = utilities available for
> locking kernel virtual memory.?

There have been several threads discussing this over = the past few weeks.  One such thread was "Process VM Addr to = Kernel VM Addr at Interrupt Time".  You'll want to see our = comments in there.

Currently, there is no standard mechanism for doing = this in the kernel.  Instead, you must vmalloc() or kmalloc() = memory and use mmap() to map the kernel memory into the application = space.  (See the bttv driver in the 2.2.x kernels for an = example)  The second method is to use bounce buffers (e.g. = copy_from_user), though your CPU utilization will be high if you do = this.

There is real work going on to support user space = I/O.  If your driver is a block driver, there is a Raw I/O patch = already out there; see Stephen Tweedie (sct@redhat.com) with questions = or comments about that.  It's at ftp://ftp.linux.org.uk/pub/linux/sct/fs/raw*.

--
Eric Lowe
elowe@systran.com
Software Engineer Co-op, Systran Corporation
937-252-5601 x330
((my e-mail gateway is adding the HTML, I can't = disable it; please don't flame me))

------_=_NextPart_001_01BE932A.902A1D80--

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