From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752408AbbCYIGx (ORCPT ); Wed, 25 Mar 2015 04:06:53 -0400 Received: from out114-136.biz.mail.alibaba.com ([205.204.114.136]:57812 "EHLO out21.biz.mail.alibaba.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752331AbbCYIGu (ORCPT ); Wed, 25 Mar 2015 04:06:50 -0400 X-Greylist: delayed 13529 seconds by postgrey-1.27 at vger.kernel.org; Wed, 25 Mar 2015 04:06:50 EDT X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R401e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=r46d02013;MF=hillf.zj@alibaba-inc.com;PH=DS;RN=4;RT=4;SR=0; Reply-To: "Hillf Danton" From: "Hillf Danton" To: "Johannes Weiner" Cc: "linux-kernel" , , "Hillf Danton" References: <048301d066d1$653e63d0$2fbb2b70$@alibaba-inc.com> In-Reply-To: <048301d066d1$653e63d0$2fbb2b70$@alibaba-inc.com> Subject: Re: [patch 06/12] mm: oom_kill: simplify OOM killer locking Date: Wed, 25 Mar 2015 16:05:57 +0800 Message-ID: <048701d066d2$86b182d0$94148870$@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQJCcl4zuzd1v8YLbviEv1mE5WLok5xIvhOg Content-Language: zh-cn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > --- a/include/linux/oom.h > +++ b/include/linux/oom.h > @@ -32,6 +32,8 @@ enum oom_scan_t { > /* Thread is the potential origin of an oom condition; kill first on oom */ > #define OOM_FLAG_ORIGIN ((__force oom_flags_t)0x1) > > +extern struct mutex oom_lock; > + > static inline void set_current_oom_origin(void) > { > current->signal->oom_flags |= OOM_FLAG_ORIGIN; > @@ -60,9 +62,6 @@ extern void oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order, > struct mem_cgroup *memcg, nodemask_t *nodemask, > const char *message); > > -extern bool oom_zonelist_trylock(struct zonelist *zonelist, gfp_t gfp_flags); > -extern void oom_zonelist_unlock(struct zonelist *zonelist, gfp_t gfp_flags); Alternately expose three functions, rather than oom_lock mutex? bool oom_trylock(void); void oom_lock(void); void oom_unlock(void); Hillf