lkml.org 
[lkml]   [2000]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: mmap/munmap semantics
On Thu, 24 Feb 2000, Stephen C. Tweedie wrote:

> Hi,
>
> On Thu, 24 Feb 2000 03:35:02 +0100, Jamie Lokier
> <lk@tantalophile.demon.co.uk> said:
>
> > I don't think MADV_DONTNEED actually drops privately modified data does
> > it?
>
> Yes, it does. From the DU man pages:
>
> MADV_DONTNEED
> Do not need these pages
>
> The system will free any whole pages in the specified
> region. All modifications will be lost and any swapped
> out pages will be discarded. Subsequent access to the
> region will result in a zero-fill-on-demand fault as
> though it is being accessed for the first time.
> Reserved swap space is not affected by this call.

Ah, this is cool - exactly what we need. I.e. an madvise(MADV_DONTNEED)
and a subsequent munmap should not generate any disk io?

> Regarding the other half of the problem --- zeroing out a portion of a
> file without further IO --- the splice code I hope to have using kiobufs
> in 2.5 will allow this to be done very easily. You'll be able to take a
> region of /dev/zero and splice it into your open file with zero-copy.

Cool, too. So for now we will stay with zeroing by reading from /dev/zero
which does vm tricks in linux already.

Richard.

> --Stephen
>
> _______________________________________________
> glame-devel mailing list
> glame-devel@lists.sourceforge.net
> http://lists.sourceforge.net/mailman/listinfo/glame-devel
>


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

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