[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-kernel
Subject:    RE: kernel virtual page locking..
From:       Eric Lowe <ELowe () SYSTRAN ! com>
Date:       1999-04-30 16:57:37
[Download RAW message or body]

> 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))

[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2448.0">
<TITLE>RE: kernel virtual page locking..</TITLE>
</HEAD>
<BODY>

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

<P><FONT SIZE=2>There have been several threads discussing this over the past few weeks.&nbsp; One such \
thread was &quot;Process VM Addr to Kernel VM Addr at Interrupt Time&quot;.&nbsp; You'll want to see our \
comments in there.</FONT></P>

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

<P><FONT SIZE=2>There is real work going on to support user space I/O.&nbsp; 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.&nbsp; It's at <A HREF="ftp://ftp.linux.org.uk/pub/linux/sct/fs/raw*" \
TARGET="_blank">ftp://ftp.linux.org.uk/pub/linux/sct/fs/raw*</A>.</FONT></P>

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

</BODY>
</HTML>


-
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/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic