Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2030458imm; Tue, 10 Jul 2018 11:56:53 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdB0G28Hs8AZX93J6nrE0w8saC9Fs78ew2t99NxCQs9du+GuW2R8dWeCOSmObY8B1Hxujdi X-Received: by 2002:a17:902:42a3:: with SMTP id h32-v6mr25533406pld.72.1531249013569; Tue, 10 Jul 2018 11:56:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531249013; cv=none; d=google.com; s=arc-20160816; b=TIBDkFwbqw66Ay9WwYe722MjmQcyo58JVnijjihr08oHKhb3727NMCglOpBkkCm5UQ CbBdX7BTCg0w8Ln0GWih/1wbnELXAFvFtjUiF79Vhbfix1BP0PthX17v/h6X44UfcRO8 dDHhAvhORB6w8lm3J5nBlHBYuJvtbKtj+GCTKeT1qP71PJz6+KuxLVTTVBLHosNMpWNy ApU5rhrRkqBK7syDnGHUGbJYn5ygUd3eQtM+8hArZL2VoU2CXgWXOwwzbQkJ+YNJKd51 a0ro1FqcXS3JWgK6eqA1TvlOdZd78l7FFpPrYg9n+GA02O5Wreh8LvtCDZs2lg080FR7 gTJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=oUcTQPJzSIJnS2T45OrSBkyAi4U5y/CIwwnKpblntmQ=; b=D2m35XByFNziYILHfg/l974F0L22uPq2SF4wpV2yyuTEiPVA9Hw2tdMExzABAhY6fw qoU0QrqhLPq7OF9M07s6/TFumw/HdwZ2t9r06s5UFMLqlrTHhXhLCD3iOPfOq8WwetnW MIyp4CcqEBkC8Tho++JKAZhWVglRFy91MU3Dk6A6rpp2j7snbk48OkfPlwyx/66hOljX EuOUZiS91NqE7/Ar/e3CK8hyRYqLavZJb3YUrBAXwZDCELMKJEveC7Ivzu1ZvpVEVhQs wXKMPg+i64xsw2LNU+HOZ1a+LYPshSA2ce305Mm9/Xq17yyXox46jgI++Aj7uWLbKRT+ D52g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CwOfcNOc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9-v6si5130012pls.291.2018.07.10.11.56.38; Tue, 10 Jul 2018 11:56:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CwOfcNOc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733200AbeGJSzn (ORCPT + 99 others); Tue, 10 Jul 2018 14:55:43 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:40119 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732459AbeGJSzm (ORCPT ); Tue, 10 Jul 2018 14:55:42 -0400 Received: by mail-pf0-f195.google.com with SMTP id e13-v6so3329329pff.7 for ; Tue, 10 Jul 2018 11:55:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=oUcTQPJzSIJnS2T45OrSBkyAi4U5y/CIwwnKpblntmQ=; b=CwOfcNOcM1zwQiNvXCHI60/dgXOvBKCeoLvND+2gUmHDOkc6x1LvPenkNSx220Q483 GBYAzxYrc7GPFpDmvGPcgYX1BWz131T6Y+/mlTz0FaIwgl4NaIROdLHlvmyhTQSLzynm R6htIIcv1FGVyvkA7a4v5IOejH9fw/dryfNt+VGU/wkX0pmE1tvcPR4WSxjxJmlXkJzn wtBoCrYYRK0ZQsE3L7KDFaJyKnTkpHpSgT2b0oMZbd0OMIMg+/VQJc/8IYqztiaJSLLC I0JPMEqp987TQmpN8roKZcEAQ1LwBYrtCzNbzTq46SCKhNb1h/Pti9nmhGqAFBTgeGUK v52g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=oUcTQPJzSIJnS2T45OrSBkyAi4U5y/CIwwnKpblntmQ=; b=qfmm3fFWZ7dtJu+mQIdUCzXAtULvVEZ79OdxhSYrBK3irtG+Pjg9oj9wj8acVM4lI0 x5QCCeuhG+mHIg6e2vBhZ+vZn4UCDIOVnlAy+ZDgQf+TGZPD8Gky3jN8/r0E9iDgBovD uIxv9DE06K5vbZJqj16U+MDJi2E1UMc7JWVDYlv394BFVB3HKf8QKnJJMhpvEHhLtn7w 8CVuI54iDtqV7cYK7tapiTjwDSeWgpv7pdFqdzgx2Ve+ZSFFi2TZUE6ixuTu3rQ1wlrm /IgE0yps9413FoTQOZseRfULKj0974ZOov+ob7zrF0D1iBOKHv0zgMmu3WSJ3Ekv3dJR dEcQ== X-Gm-Message-State: APt69E03gSFHIRZUbN7uNopKTBG4OV7ssC+V+Q/PcWsmhjORakKPTZ1C 5q6ZPA5lRRq+k6O8J8eQ3c/JBObjFYU= X-Received: by 2002:a65:630e:: with SMTP id g14-v6mr3273759pgv.153.1531248922486; Tue, 10 Jul 2018 11:55:22 -0700 (PDT) Received: from [2620:15c:17:3:3a5:23a7:5e32:4598] ([2620:15c:17:3:3a5:23a7:5e32:4598]) by smtp.gmail.com with ESMTPSA id l8-v6sm36993415pfb.102.2018.07.10.11.55.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Jul 2018 11:55:21 -0700 (PDT) Date: Tue, 10 Jul 2018 11:55:21 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Michal Hocko cc: Andrew Morton , Tetsuo Handa , linux-mm@kvack.org, LKML Subject: Re: [PATCH] mm, oom: remove sleep from under oom_lock In-Reply-To: <20180710094341.GD14284@dhcp22.suse.cz> Message-ID: References: <20180709074706.30635-1-mhocko@kernel.org> <20180710094341.GD14284@dhcp22.suse.cz> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 Jul 2018, Michal Hocko wrote: > What do you think about the following? > > diff --git a/mm/oom_kill.c b/mm/oom_kill.c > index ed9d473c571e..32e6f7becb40 100644 > --- a/mm/oom_kill.c > +++ b/mm/oom_kill.c > @@ -53,6 +53,14 @@ int sysctl_panic_on_oom; > int sysctl_oom_kill_allocating_task; > int sysctl_oom_dump_tasks = 1; > > +/* > + * Serializes oom killer invocations (out_of_memory()) from all contexts to > + * prevent from over eager oom killing (e.g. when the oom killer is invoked > + * from different domains). > + * > + * oom_killer_disable() relies on this lock to stabilize oom_killer_disabled > + * and mark_oom_victim > + */ > DEFINE_MUTEX(oom_lock); > > #ifdef CONFIG_NUMA I think it's better, thanks. However, does it address the question about why __oom_reap_task_mm() needs oom_lock protection? Perhaps it would be helpful to mention synchronization between reaping triggered from oom_reaper and by exit_mmap().