lkml.org 
[lkml]   [1999]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: kernel virtual page locking..
Date
<!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>
\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.029 / U:1.652 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site