lkml.org 
[lkml]   [2000]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectmmap/munmap semantics
Hi!

With the ongoing development of GLAME there arise the following
problems with the backing-store management, which is a mmaped
file and does "userspace virtual memory management":
- I cannot see a way to mmap a part of the file but set the
contents initially to zero, i.e. I want to setup an initially
dirty zero-mapping which is assigned to a part of the file.
Currently I'm just mmaping the part and do the zeroing by
reading from /dev/zero (which does as I understand from the
kernel code just create this zero mappings) - is there a more
portable way to achieve this?
- 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.
Ideally a hole could be created in the mmapped file on drop time -
is this possible at all with the VFS/ext2 at the moment (creating
a hole in a file by dropping parts of it)?

So for the first case we could add a flag to mmap like MAP_ZERO to
indicate a zero-map (dirty).

For the second case either the munmap call needs to be extended or
some sort of madvise with a MADV_CLEAN flag? Or we can just adjust
mprotect(PROT_NONE) and subsequent munmap() to do the dropping?

Richard.

--
The GLAME Project: http://www.glame.de/
Hosted by SourceForge: http://glame.sourceforge.net/




-
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.249 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site