Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759290Ab2FUKQk (ORCPT ); Thu, 21 Jun 2012 06:16:40 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:44761 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759261Ab2FUKQj (ORCPT ); Thu, 21 Jun 2012 06:16:39 -0400 Date: Thu, 21 Jun 2012 03:16:36 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Kamezawa Hiroyuki cc: Minchan Kim , Andrew Morton , Mel Gorman , Rik van Riel , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [patch] mm, thp: abort compaction if migration page cannot be charged to memcg In-Reply-To: <4FE2F1DA.8030608@jp.fujitsu.com> Message-ID: References: <4FE2D73C.3060001@kernel.org> <4FE2F1DA.8030608@jp.fujitsu.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1184 Lines: 27 On Thu, 21 Jun 2012, Kamezawa Hiroyuki wrote: > I guess the best way will be never calling charge/uncharge at migration. > ....but it has been a battle with many race conditions.. > > Here is an alternative way, remove -ENOMEM in mem_cgroup_prepare_migration() > by using res_counter_charge_nofail(). > > Could you try this ? I would love to be able to remove the -ENOMEM as the result of charging the temporary page, but what happens if all cpus are calling into migrate_pages() that are unmapping pages from the same memcg? This need not only be happening from compaction, either. It feels like this wouldn't scale appropriately and you risk going significantly over the limit even for a brief enough period of time. I'd hate to be 128K over my limit on a machine with 32 cores. Comments from the memcg folks on if this is acceptable? In the interim, do you have an objection to merging this patch as bandaid for stable? -- 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/