Re: [PATCH] speed up fork performance

Russell King
2004-08-27T14:30:07Z

On Fri, Aug 27, 2004 at 10:09:38AM -0400, Rik van Riel wrote:
>
> OK, this patch is _completely_ untested, but since I'm about to run
> off to a conference I guess I should get it to you anyway.
>
> Basically in 2.6 lru_cache_add_active() takes an extra reference to
> the page, but do_wp_page() and friends don't expect a private anonymous
> page to have 2 references instead of 1. This little patchlet changes
> can_share_swap_page() and exclusive_swap_page() to expect the extra
> reference.
>
> Note that we cannot test for PageLRU(page) since lru_cache_add_active()
> uses a delayed insertion onto the LRU, so the PG_lru might not get set
> for a while...
>
> Use at your own risk.

As I've just mentioned to Rik, this is probably buggy - pages which are
in the page cache and are then faulted into userspace seem to have a
page count of 2 even though they're part of a private mapping. We don't
particularly want to allow these to be written to...

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/
2.6 Serial core