linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Qiang Huang <h.huangqiang@huawei.com>
To: David Rientjes <rientjes@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Michal Hocko <mhocko@suse.cz>,
	hannes@cmpxchg.org, Li Zefan <lizefan@huawei.com>,
	Cgroups <cgroups@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [PATCH] mm, memcg: add a helper function to check may oom condition
Date: Tue, 10 Sep 2013 08:57:03 +0800	[thread overview]
Message-ID: <522E6E5F.7050006@huawei.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1309091317570.16291@chino.kir.corp.google.com>

On 2013/9/10 4:22, David Rientjes wrote:
> 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".

Yes, oom_gfp_allowed() seems better, I'll send a second version,
thanks for you advice, David.

> 
> 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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2013-09-10  0:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-09  2:18 Qiang Huang
2013-09-09 20:22 ` David Rientjes
2013-09-10  0:57   ` Qiang Huang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=522E6E5F.7050006@huawei.com \
    --to=h.huangqiang@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-mm@kvack.org \
    --cc=lizefan@huawei.com \
    --cc=mhocko@suse.cz \
    --cc=rientjes@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox