lkml.org 
[lkml]   [2007]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: missing madvise functionality
Date
On Tuesday 03 April 2007, Ulrich Drepper wrote:
> The problem is glibc has to work around kernel limitations.  If the
> malloc implementation detects that a large chunk of previously allocated
> memory is now free and unused it wants to return the memory to the
> system.  What we currently have to do is this:
>
>   to free:      mmap(PROT_NONE) over the area
>   to reuse:     mprotect(PROT_READ|PROT_WRITE)
>
> Yep, that's expensive, both operations need to get locks preventing
> other threads from doing the same.

I thought this is what the read_zero_pagealigned hack [1] was used
for (read from /dev/zero replaces target pages with empty_zero_page).
Now if read_zero_pagealigned does not solve _this_ scenario, is it
good for anything else then?
Can we simply kill that function as a misfeature and avoid future
pain arising from it?

Arnd <><

[1] http://lkml.org/lkml/1997/1/16/49
-
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-04 00:09    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site