Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 29 Jul 2002 00:47:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 29 Jul 2002 00:47:00 -0400 Received: from neon-gw-l3.transmeta.com ([63.209.4.196]:21253 "EHLO neon-gw.transmeta.com") by vger.kernel.org with ESMTP id ; Mon, 29 Jul 2002 00:47:00 -0400 Date: Sun, 28 Jul 2002 21:50:54 -0700 (PDT) From: Linus Torvalds To: Andrew Morton cc: "David S. Miller" , Subject: Re: [patch 2/13] remove pages from the LRU in __free_pages_ok() In-Reply-To: <3D44CA21.71742425@zip.com.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1336 Lines: 34 On Sun, 28 Jul 2002, Andrew Morton wrote: > > Problem is that the rmap VM doesn't perform swapout via pagetables. > It performs it via the LRU. > > If someone is sleeping on a pagefault against a mmapped file, and a > truncate happens meanwhile, that page comes back as an anonymous > page. It's not on the LRU any more so it has become unswappable. Note that there is nothing fundamentally wrong with keeping the anonymous page on the LRU either. Some of th e2.4.x kernels kept _all_ anonymous pages on the LRU. That added a lot of LRU overhead, but there could be a fairly simple workaround: don't add anon pages to the LRU normally, but if a LRU page is turned into an anonymous page _and_ it is still mapped, keep it on the LRU list as an anonymous page. Then, when it is unmapped, the last unmapper (even if it isn't necessarily the last count) removes it from the LRU list. This wouldn't have worked in 2.4.x - because without rmap you can't know whether a count comes from mapping or not. But with rmap you can know, and you can also notice the "last unmapper" thing. Linus - 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/