lkml.org 
[lkml]   [2001]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: __get_free_pages(): is the MEM really mine?
From
Date
Bernd Harries <mlbha@gmx.de> writes:

> Hi all,

> In a driver I'm writing, in the open() method, I use multiple
> __get_free_pages() to allocate a 4 MB kernel (image)buffer for DMA purposes.
> The buffer I get is contiguous (I try until it is) and is freed in
> close(). Order count is 9.

Ouch. This is where I give you the standard recommendation. If you
do this scatter gatter (so you don't need megs of continuous memory)
you should be much better off, and your driver should be more
reliable. All of the other techniques you have used like mmap should
still apply.

Also if you are exporting this data to user space, before your DMA
complets you want to zero the pages you have allocated, so you don't
have an information leak.

Eric

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

\
 
 \ /
  Last update: 2005-03-22 13:03    [W:0.091 / U:0.244 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site