Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754512AbZDUIUq (ORCPT ); Tue, 21 Apr 2009 04:20:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751083AbZDUIU3 (ORCPT ); Tue, 21 Apr 2009 04:20:29 -0400 Received: from cmpxchg.org ([85.214.51.133]:39112 "EHLO cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750884AbZDUIU2 (ORCPT ); Tue, 21 Apr 2009 04:20:28 -0400 Date: Tue, 21 Apr 2009 10:19:03 +0200 From: Johannes Weiner To: Balbir Singh Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [patch 1/3] mm: fix pageref leak in do_swap_page() Message-ID: <20090421081903.GA2527@cmpxchg.org> References: <1240259085-25872-1-git-send-email-hannes@cmpxchg.org> <20090421031419.GB30001@balbir.in.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090421031419.GB30001@balbir.in.ibm.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1205 Lines: 29 On Tue, Apr 21, 2009 at 08:44:20AM +0530, Balbir Singh wrote: > * Johannes Weiner [2009-04-20 22:24:43]: > > > By the time the memory cgroup code is notified about a swapin we > > already hold a reference on the fault page. > > > > If the cgroup callback fails make sure to unlock AND release the page > > or we leak the reference. > > > > Signed-off-by: Johannes Weiner > > Cc: Balbir Singh > > Seems reasonable to me, could you make the changelog more verbose and > mention that lookup_swap_cache() gets a reference to the page and we > need to release the extra reference. Okay, I will add that information. > BTW, have you had any luck reproducing the issue? How did you catch > the problem? I reviewed all the exit points when I shuffled code around in there for another series that uses a lighter version of do_wp_page() for swap write-faults. I never triggered that problem. -- 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/