From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glauber Costa Subject: Re: [PATCH v5 06/14] memcg: kmem controller infrastructure Date: Mon, 22 Oct 2012 16:34:15 +0400 Message-ID: <50853D47.4030409@parallels.com> References: <1350382611-20579-1-git-send-email-glommer@parallels.com> <1350382611-20579-7-git-send-email-glommer@parallels.com> <507FCA90.8060307@parallels.com> <5081269B.5000603@parallels.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" To: David Rientjes Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Mel Gorman , Tejun Heo , Andrew Morton , Michal Hocko , Johannes Weiner , KAMEZAWA Hiroyuki , Christoph Lameter , Pekka Enberg , devel-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Pekka Enberg On 10/20/2012 12:34 AM, David Rientjes wrote: > On Fri, 19 Oct 2012, Glauber Costa wrote: > >>>>> What about gfp & __GFP_FS? >>>>> >>>> >>>> Do you intend to prevent or allow OOM under that flag? I personally >>>> think that anything that accepts to be OOM-killed should have GFP_WAIT >>>> set, so that ought to be enough. >>>> >>> >>> The oom killer in the page allocator cannot trigger without __GFP_FS >>> because direct reclaim has little chance of being very successful and >>> thus we end up needlessly killing processes, and that tends to happen >>> quite a bit if we dont check for it. Seems like this would also happen >>> with memcg if mem_cgroup_reclaim() has a large probability of failing? >>> >> >> I can indeed see tests for GFP_FS in some key locations in mm/ before >> calling the OOM Killer. >> >> Should I test for GFP_IO as well? > > It's not really necessary, if __GFP_IO isn't set then it wouldn't make > sense for __GFP_FS to be set. > >> If the idea is preventing OOM to >> trigger for allocations that can write their pages back, how would you >> feel about the following test: >> >> may_oom = (gfp & GFP_KERNEL) && !(gfp & __GFP_NORETRY) ? >> > > I would simply copy the logic from the page allocator and only trigger oom > for __GFP_FS and !__GFP_NORETRY. > That seems reasonable to me. Michal ? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx114.postini.com [74.125.245.114]) by kanga.kvack.org (Postfix) with SMTP id C516F6B0062 for ; Mon, 22 Oct 2012 08:34:39 -0400 (EDT) Message-ID: <50853D47.4030409@parallels.com> Date: Mon, 22 Oct 2012 16:34:15 +0400 From: Glauber Costa MIME-Version: 1.0 Subject: Re: [PATCH v5 06/14] memcg: kmem controller infrastructure References: <1350382611-20579-1-git-send-email-glommer@parallels.com> <1350382611-20579-7-git-send-email-glommer@parallels.com> <507FCA90.8060307@parallels.com> <5081269B.5000603@parallels.com> In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: David Rientjes Cc: linux-mm@kvack.org, cgroups@vger.kernel.org, Mel Gorman , Tejun Heo , Andrew Morton , Michal Hocko , Johannes Weiner , KAMEZAWA Hiroyuki , Christoph Lameter , Pekka Enberg , devel@openvz.org, linux-kernel@vger.kernel.org, Pekka Enberg On 10/20/2012 12:34 AM, David Rientjes wrote: > On Fri, 19 Oct 2012, Glauber Costa wrote: > >>>>> What about gfp & __GFP_FS? >>>>> >>>> >>>> Do you intend to prevent or allow OOM under that flag? I personally >>>> think that anything that accepts to be OOM-killed should have GFP_WAIT >>>> set, so that ought to be enough. >>>> >>> >>> The oom killer in the page allocator cannot trigger without __GFP_FS >>> because direct reclaim has little chance of being very successful and >>> thus we end up needlessly killing processes, and that tends to happen >>> quite a bit if we dont check for it. Seems like this would also happen >>> with memcg if mem_cgroup_reclaim() has a large probability of failing? >>> >> >> I can indeed see tests for GFP_FS in some key locations in mm/ before >> calling the OOM Killer. >> >> Should I test for GFP_IO as well? > > It's not really necessary, if __GFP_IO isn't set then it wouldn't make > sense for __GFP_FS to be set. > >> If the idea is preventing OOM to >> trigger for allocations that can write their pages back, how would you >> feel about the following test: >> >> may_oom = (gfp & GFP_KERNEL) && !(gfp & __GFP_NORETRY) ? >> > > I would simply copy the logic from the page allocator and only trigger oom > for __GFP_FS and !__GFP_NORETRY. > That seems reasonable to me. Michal ? -- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753946Ab2JVMej (ORCPT ); Mon, 22 Oct 2012 08:34:39 -0400 Received: from mx2.parallels.com ([64.131.90.16]:41000 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753182Ab2JVMei (ORCPT ); Mon, 22 Oct 2012 08:34:38 -0400 Message-ID: <50853D47.4030409@parallels.com> Date: Mon, 22 Oct 2012 16:34:15 +0400 From: Glauber Costa User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121016 Thunderbird/16.0.1 MIME-Version: 1.0 To: David Rientjes CC: , , Mel Gorman , Tejun Heo , Andrew Morton , Michal Hocko , Johannes Weiner , KAMEZAWA Hiroyuki , Christoph Lameter , Pekka Enberg , , , Pekka Enberg Subject: Re: [PATCH v5 06/14] memcg: kmem controller infrastructure References: <1350382611-20579-1-git-send-email-glommer@parallels.com> <1350382611-20579-7-git-send-email-glommer@parallels.com> <507FCA90.8060307@parallels.com> <5081269B.5000603@parallels.com> In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/20/2012 12:34 AM, David Rientjes wrote: > On Fri, 19 Oct 2012, Glauber Costa wrote: > >>>>> What about gfp & __GFP_FS? >>>>> >>>> >>>> Do you intend to prevent or allow OOM under that flag? I personally >>>> think that anything that accepts to be OOM-killed should have GFP_WAIT >>>> set, so that ought to be enough. >>>> >>> >>> The oom killer in the page allocator cannot trigger without __GFP_FS >>> because direct reclaim has little chance of being very successful and >>> thus we end up needlessly killing processes, and that tends to happen >>> quite a bit if we dont check for it. Seems like this would also happen >>> with memcg if mem_cgroup_reclaim() has a large probability of failing? >>> >> >> I can indeed see tests for GFP_FS in some key locations in mm/ before >> calling the OOM Killer. >> >> Should I test for GFP_IO as well? > > It's not really necessary, if __GFP_IO isn't set then it wouldn't make > sense for __GFP_FS to be set. > >> If the idea is preventing OOM to >> trigger for allocations that can write their pages back, how would you >> feel about the following test: >> >> may_oom = (gfp & GFP_KERNEL) && !(gfp & __GFP_NORETRY) ? >> > > I would simply copy the logic from the page allocator and only trigger oom > for __GFP_FS and !__GFP_NORETRY. > That seems reasonable to me. Michal ?