Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964861AbZKYOX6 (ORCPT ); Wed, 25 Nov 2009 09:23:58 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S934707AbZKYOX6 (ORCPT ); Wed, 25 Nov 2009 09:23:58 -0500 Received: from e23smtp05.au.ibm.com ([202.81.31.147]:44248 "EHLO e23smtp05.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934706AbZKYOX5 (ORCPT ); Wed, 25 Nov 2009 09:23:57 -0500 Date: Wed, 25 Nov 2009 19:53:55 +0530 From: Balbir Singh To: Hugh Dickins Cc: Andrew Morton , Izik Eidus , Andrea Arcangeli , Chris Wright , KAMEZAWA Hiroyuki , Daisuke Nishimura , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 6/9] ksm: mem cgroup charge swapin copy Message-ID: <20091125142355.GD2970@balbir.in.ibm.com> Reply-To: balbir@linux.vnet.ibm.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1471 Lines: 34 * Hugh Dickins [2009-11-24 16:51:13]: > But ksm swapping does require one small change in mem cgroup handling. > When do_swap_page()'s call to ksm_might_need_to_copy() does indeed > substitute a duplicate page to accommodate a different anon_vma (or a > different index), that page escaped mem cgroup accounting, because of > the !PageSwapCache check in mem_cgroup_try_charge_swapin(). > The duplicate page doesn't show up as PageSwapCache or are we optimizing for the race condition where the page is not in SwapCache? I should probably look at the full series. > That was returning success without charging, on the assumption that > pte_same() would fail after, which is not the case here. Originally I > proposed that success, so that an unshrinkable mem cgroup at its limit > would not fail unnecessarily; but that's a minor point, and there are > plenty of other places where we may fail an overallocation which might > later prove unnecessary. So just go ahead and do what all the other > exceptions do: proceed to charge current mm. > > Signed-off-by: Hugh Dickins Thanks for the patch! Acked-by: Balbir Singh -- Balbir -- 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/