From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx187.postini.com [74.125.245.187]) by kanga.kvack.org (Postfix) with SMTP id B5BE96B0034 for ; Mon, 9 Sep 2013 16:22:21 -0400 (EDT) Received: by mail-pb0-f50.google.com with SMTP id uo5so6594997pbc.37 for ; Mon, 09 Sep 2013 13:22:21 -0700 (PDT) Date: Mon, 9 Sep 2013 13:22:18 -0700 (PDT) From: David Rientjes Subject: Re: [PATCH] mm, memcg: add a helper function to check may oom condition In-Reply-To: <522D2FE5.3080606@huawei.com> Message-ID: References: <522D2FE5.3080606@huawei.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org List-ID: To: Qiang Huang Cc: Andrew Morton , Michal Hocko , hannes@cmpxchg.org, Li Zefan , Cgroups , "linux-mm@kvack.org" On Mon, 9 Sep 2013, Qiang Huang wrote: > diff --git a/include/linux/oom.h b/include/linux/oom.h > index da60007..d061c63 100644 > --- a/include/linux/oom.h > +++ b/include/linux/oom.h > @@ -82,6 +82,11 @@ static inline void oom_killer_enable(void) > oom_killer_disabled = false; > } > > +static inline bool may_oom(gfp_t gfp_mask) Makes sense, but I think the name should be more specific to gfp flags to make it clear what it's using to determine eligibility, maybe oom_gfp_allowed()? We usually prefix oom killer functions with "oom". Nice taste. > +{ > + return (gfp_mask & __GFP_FS) && !(gfp_mask & __GFP_NORETRY); > +} > + > extern struct task_struct *find_lock_task_mm(struct task_struct *p); > > /* sysctls */ -- 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