lkml.org 
[lkml]   [2007]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] make MADV_FREE lazily free memory
Nick Piggin wrote:
> Nick Piggin wrote:
>> Eric Dumazet wrote:
>>
>
>>>> Two things can happen here.
>>>>
>>>> If this program used the pages before the kernel needed
>>>> them, the program will be reusing its old pages.
>>>
>>>
>>>
>>> ah ok, this is because accessed/dirty bits are set by hardware and
>>> not a page fault.
>>
>>
>> No it isn't.
>
> That is to say, it isn't required for correctness. But if the
> question was about avoiding a fault, then yes ;)

Making the pte clean also needs to clear the hardware writable
bit on architectures where we do pte dirtying in software.

If we don't, we would have corruption problems all over the VM,
for example in the code around pte_clean_one :)

> But as Linus recently said, even hardware handled faults still
> take expensive microarchitectural traps.

Nowhere near as expensive as a full page fault, though...

The lazy freeing is aimed at avoiding page faults on memory
that is freed and later realloced, which is quite a common
thing in many workloads.

--
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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-04-12 09:27    [W:0.043 / U:1.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site