From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail143.messagelabs.com (mail143.messagelabs.com [216.82.254.35]) by kanga.kvack.org (Postfix) with ESMTP id 7E1016B01FB for ; Fri, 26 Mar 2010 17:33:17 -0400 (EDT) Received: from kpbe11.cbf.corp.google.com (kpbe11.cbf.corp.google.com [172.25.105.75]) by smtp-out.google.com with ESMTP id o2QLWo63016330 for ; Fri, 26 Mar 2010 22:32:50 +0100 Received: from ewy24 (ewy24.prod.google.com [10.241.103.24]) by kpbe11.cbf.corp.google.com with ESMTP id o2QLWlnU012012 for ; Fri, 26 Mar 2010 16:32:48 -0500 Received: by ewy24 with SMTP id 24so205790ewy.33 for ; Fri, 26 Mar 2010 14:32:46 -0700 (PDT) Date: Fri, 26 Mar 2010 21:32:28 +0000 (GMT) From: Hugh Dickins Subject: Re: [PATCH 35 of 41] don't leave orhpaned swap cache after ksm merging In-Reply-To: <20100326172321.GA5825@random.random> Message-ID: References: <6a19c093c020d009e736.1269622839@v2.random> <4BACEBF8.90909@redhat.com> <20100326172321.GA5825@random.random> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org To: Andrea Arcangeli Cc: Rik van Riel , linux-mm@kvack.org, Andrew Morton , Marcelo Tosatti , Adam Litke , Avi Kivity , Izik Eidus , Hugh Dickins , Nick Piggin , Mel Gorman , Dave Hansen , Benjamin Herrenschmidt , Ingo Molnar , Mike Travis , KAMEZAWA Hiroyuki , Christoph Lameter , Chris Wright , bpicco@redhat.com, KOSAKI Motohiro , Balbir Singh , Arnd Bergmann , "Michael S. Tsirkin" , Peter Zijlstra , Johannes Weiner List-ID: On Fri, 26 Mar 2010, Andrea Arcangeli wrote: > On Fri, Mar 26, 2010 at 01:16:40PM -0400, Rik van Riel wrote: > > On 03/26/2010 01:00 PM, Andrea Arcangeli wrote: > > > From: Andrea Arcangeli > > > > > > When swapcache is replaced by a ksm page don't leave orhpaned swap cache. > > > > Why is this part of the hugepage series? > > This is a not relevant for hugepages. There's another ksm change so I > thought I could sneak it in. It's still separated so it can be pulled > off separately as needed. It's a nice little catch, but you certainly shouldn't have buried it amidst 40 other patches unrelated to it! I was going to ack that patch and urge you to forward it to Andrew separately, but did you test whether it works? Isn't it actually a no-op? Because KSM is holding page lock across replace_page() (maybe that's something I added after you were last there - at the time I did it just from instinct, and to make a block look prettier; but later I believe it turned out to be necessary), and free_swap_cache() only works if trylock_page() succeeds. So if we want the fix, I think it would have to be reworked, perhaps slightly messier. Something needed for -stable? No, I think not, it's a situation that gradually increases memory pressure, and then memory pressure frees it (vmscan.c's __delete_from_swap_cache); it never prevents swapoff. But it would be nice to fix it all the same: thanks for spotting. Hugh -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org