[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: MADV_DONTNEED
Stephen C. Tweedie wrote:
> The requests I've seen from database vendors are specifically for
> function 1 above. I'd expect that they could live with function 3
> too, though --- perhaps the main reason they asked for 1 is that
> this is what they are used to working with on some other systems
> (I don't know offhand of anybody who implements 3: it seems an odd
> thing to want to do for shared pages, and is equivalent to 1 for
> private mappings.)
For private file mappings, 1 and 3 are different. 1 reverts pages to
the underlying object. 3 as equivalent to writing zeros over the page.
It's only for /dev/zero mappings that they are the same.
Probably nobody implements 3, but some documentation suggests
otherwise. Digital Unix:
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.
Clearly for non-anonymous mappings, the two underlined phrases
contradict one another. Does MADV_DONTNEED on DU zero pages in private
file mappings, or does it revert to the original file pages?
-- 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/