[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4632D0EF.9050701@redhat.com>
Date: Sat, 28 Apr 2007 00:43:27 -0400
From: Rik van Riel <riel@...hat.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
CC: linux-kernel <linux-kernel@...r.kernel.org>,
linux-mm <linux-mm@...ck.org>
Subject: [PATCH] MM: implement MADV_FREE lazy freeing of anonymous memory
With lazy freeing of anonymous pages through MADV_FREE, performance of
the MySQL sysbench workload more than doubles on my quad-core system.
Madvise with MADV_FREE is used by applications to tell the kernel that
memory no longer contains useful data and can be reclaimed by the
kernel if it is needed elsewhere. However, if the application puts
new data in the page (dirty bit gets set by hardware), the kernel
will not throw away the data.
This makes applications that free() and then later on malloc() the
same data again run a lot faster, since page faults are avoided.
In low memory situations, the kernel still knows which pages to
reclaim.
"Doing it all in userspace" is not a good solution for this problem,
because if the system needs the memory it is way cheaper to just throw
away these freed pages than to do the disk IO of swapping them out and
back in.
Signed-off-by: Rik van Riel <riel@...hat.com>
View attachment "linux-2.6.21-madv_free.patch" of type "text/x-patch" (13538 bytes)
Powered by blists - more mailing lists