[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mmap/munmap semantics



Stephen C. Tweedie wrote:
> > - I need to "drop" a mapping sometimes without writing the contents
> >   back to disk - I cannot see a way to do this with linux currently.
> 
> The only way is to use Chuck Lever's madvise() patches:
> madvise(MADV_DONTNEED) is exactly what you need there.  It's not yet in
> Linus's 2.3 tree, but the API is pretty standard.

I don't think MADV_DONTNEED actually drops privately modified data does
it?  I thought it was merely a hint to the kernel that the data will not
be accessed again soon, so it can be paged out or, if unmodified,
dropped.  All the other MADV_* flags are access hints.

-- Jamie
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/