[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200704040007.16916.arnd@arndb.de>
Date: Wed, 4 Apr 2007 00:07:16 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Ulrich Drepper <drepper@...hat.com>
Cc: Rik van Riel <riel@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux Kernel <linux-kernel@...r.kernel.org>,
Jakub Jelinek <jakub@...hat.com>
Subject: Re: missing madvise functionality
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists