lkml.org 
[lkml]   [2005]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: data + pendrive + memory


On Mon, 25 Jul 2005, Rodrigo Ramos wrote:
>
> IMHO, if a lack of memory happens the Linux will start using swap, then
> the file will end in the hard drive. When I am working with a file in a
> pendrive any information of it is sent to the hard drive ? If it happens
> what is/are the reason(s).

If you always access the file only with mmap(..MAP_SHARED..) (or
MAP_PRIVATE in a read-only manner), or if you always make sure that any
programs that access the data use mlock() to protect it, you'll never hit
the regular disk.

mmap() is generally the better option, since locking down memory may not
be available to normal users.

Linus
-
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: 2009-11-18 23:46    [W:0.026 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site