Re: missing madvise functionality

Rik van Riel
2007-04-03T21:15:45Z

Eric Dumazet wrote:
> Rik van Riel a A(C)crit :
>> Andrew Morton wrote:
>>
>>> Oh. I was assuming that we'd want to unmap these pages from
>>> pagetables and
>>> mark then super-easily-reclaimable. So a later touch would incur a
>>> minor
>>> fault.
>>>
>>> But you think that we should leave them mapped into pagetables so no
>>> such
>>> fault occurs.
>>
>>> Leaving the pages mapped into pagetables means that they are
>>> considerably
>>> less likely to be reclaimed.
>>
>> If we move the pages to a place where they are very likely to be
>> reclaimed quickly (end of the inactive list, or a separate
>> reclaim list) and clear the dirty and referenced lists, we can
>> both reclaim the page easily *and* avoid the page fault penalty.
>>
>
> There is one possible speedup :
>
> - If an user app does a madvise(MADV_DONTNEED), we can assume the pages
> can later be bring back without need to zero them. The application
> doesnt care.

... however, the application that previously used that page might
care a lot!

> mmap()/brk() must give fresh NULL pages, but maybe
> madvise(MADV_DONTNEED) can relax this requirement (if the pages were
> reclaimed, then a page fault could bring a new page with random content)

If we bring in a new page, it has to be zeroed for security
reasons.

You don't want somebody else's process to get a page with
your password in it.

--
Politics is the struggle between those who want to make their country
the best in the world, and those who believe it already is. Each group
calls the other unpatriotic.