Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755823AbYLHCd7 (ORCPT ); Sun, 7 Dec 2008 21:33:59 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754066AbYLHCdt (ORCPT ); Sun, 7 Dec 2008 21:33:49 -0500 Received: from TYO201.gate.nec.co.jp ([202.32.8.193]:57761 "EHLO tyo201.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753300AbYLHCds (ORCPT ); Sun, 7 Dec 2008 21:33:48 -0500 Date: Mon, 8 Dec 2008 11:02:42 +0900 From: Daisuke Nishimura To: Andrew Morton Cc: LKML , linux-mm , Balbir Singh , KAMEZAWA Hiroyuki , Pavel Emelyanov , Li Zefan , Paul Menage , nishimura@mxp.nes.nec.co.jp Subject: [PATCH -mmotm 1/4] memcg: don't trigger oom at page migration Message-Id: <20081208110242.477e0837.nishimura@mxp.nes.nec.co.jp> In-Reply-To: <20081208105824.f8f5d67b.nishimura@mxp.nes.nec.co.jp> References: <20081208105824.f8f5d67b.nishimura@mxp.nes.nec.co.jp> Organization: NEC Soft, Ltd. X-Mailer: Sylpheed 2.4.8 (GTK+ 2.10.14; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1120 Lines: 30 I think triggering OOM at mem_cgroup_prepare_migration would be just a bit overkill. Returning -ENOMEM would be enough for mem_cgroup_prepare_migration. The caller would handle the case anyway. Signed-off-by: Daisuke Nishimura Acked-by: KAMEZAWA Hiroyuki Acked-by: Balbir Singh --- mm/memcontrol.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index a4854a7..0683459 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -1331,7 +1331,7 @@ int mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr) unlock_page_cgroup(pc); if (mem) { - ret = mem_cgroup_try_charge(NULL, GFP_KERNEL, &mem); + ret = __mem_cgroup_try_charge(NULL, GFP_KERNEL, &mem, false); css_put(&mem->css); } *ptr = mem; -- 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/