Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1035282imm; Mon, 9 Jul 2018 15:51:52 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf2645d4Z/daufeq9zbBaiaxpfpVPwuF0wnQdExIoeJtlvvNHqKztTBrYO+sr0NFvxSh1Cp X-Received: by 2002:a17:902:8bc6:: with SMTP id r6-v6mr21818740plo.257.1531176712358; Mon, 09 Jul 2018 15:51:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531176712; cv=none; d=google.com; s=arc-20160816; b=frukNJ04WAiHDSJLt7q8quhUrYfY/sR+6BdoJ9Dy1a2b0pPIKAv9pAgggBubHLiirn LnFfrnRevfozd/M8QT31iHZM9/c3kp9cYCDJ0TKC/YQXmd1AF3nqrmRGWpEfIoQHOehW UenpkIGwpyf84MfuAFcri92Ik05NL/f9O6ZvG5sKygn9/+TPxcfyVR3deHzlhnnw15pt 6PrKyPutW6wroHJUu5vQBGtKCXFmQe3oaD5H1M1rhkUBexfO7G0J36fWdWi5mdEv2uSN 7smGS+BzC71m2CYJVBvLgN+Nqw9O8iP+iWXLzbnHMkVZjNK+QLdT9cvYCaikBw302JL+ 68uw== 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=PNtm2kG90euFft8QWr7crmO0ot8N2x6U5jLBbpaYZWU=; b=mogLhA02kte84Yd6vFVmpyDnb0722i3w/vucm/Bu+FC5sN5bNAp2NWO/OZVKIMAk7z mGYMQ0rndXHekPNUQKsSyigizDbP+VbOTVbjNQchKdmFofOcm98x7O9ZkAycSMiXbiuG ePn0eookpsZC3J9f9llm6Q4k54/LuuzwVz5CSQ2tVVm4soDgzylWlbM3UwtLjSzas9zC v3H8clsvA3eRcLKfb96+iaIFbAebtSxqz0qYFRPykARc3QS648k1seMxZiG6owINLr1q lUDqACaN3TqcqPGh2zL9fnpYiGSS4qlX9IphGForeCC05CcQDgnn4g03A66ywaQWEmz6 mRRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=s8MYiiEh; 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 q10-v6si7550191pge.684.2018.07.09.15.51.37; Mon, 09 Jul 2018 15:51:52 -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=s8MYiiEh; 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 S933115AbeGIWt5 (ORCPT + 99 others); Mon, 9 Jul 2018 18:49:57 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:33850 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932685AbeGIWtz (ORCPT ); Mon, 9 Jul 2018 18:49:55 -0400 Received: by mail-pl0-f68.google.com with SMTP id z9-v6so6678835plo.1 for ; Mon, 09 Jul 2018 15:49:55 -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=PNtm2kG90euFft8QWr7crmO0ot8N2x6U5jLBbpaYZWU=; b=s8MYiiEhtAzrHbGH0xejdr7SwhUJ38XWVCSIBQr70tVIiGStPNJvyk9MlIs+FQjztN 0qN6CSSkjR4BxlHcxkjpOUvvBrwwHCOO6uzuUdkYYVuG/Gl/Xg1evMsZ8W2aXsmnuj9z 7/9iajbqA9RwXU2Z1E/1IIj50CMO6Z8KRsZjGDtgpAnuyAUqoidypTO17w34o7hpPUOu d4S9NDi3BxW2SXr2nrACjV5mnSb9guq7tqN+niwfukWxc7ndhaM5VGKIhu3uyL35xlpT 923iTBFKNOkgPjP1vI9KMzg8yQxCEnF1fmK3WfV+L6tuxB8+aG5WvIa7VeZ2VjMFLArs wpeg== 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=PNtm2kG90euFft8QWr7crmO0ot8N2x6U5jLBbpaYZWU=; b=m42WSFbbCyuflCPGQDbeuqn+Ds9B1ZIIuM32efo9eXwtTiEgdhkJL+qySC7Vm57SOa EG9hR4l2jdoA2cLEJ6Yd/rWdYH4nwEb9MiT1yws7uQHX/vVYkkoRdLgF/DaW8j1k+1wu 1lR3fjTXaWn6fIWiGLo5iaf9qBA6laUo+0LY0QmuYSWWsHlVt2A87zAb/b1hO7l1cPy9 wf9f/+DsjT2tY4Ri8m47SIcuS2nEObr/UrbC/Xj9asH4acawwQkMBI0wwL+mGsKaf5qj uhmc5bkKQzuVtPQXUIClbffw2q8R7sLn/9dtW5aXvUgnkG3DaMVwOfQ5JJZo2F6STFKY cxRg== X-Gm-Message-State: APt69E31xqB6f1w7pVP8cl1WMLvDgdZ7dHFY2li9VTip6Z77sWG8OVyz 0ARxQnchg3G2puoQCuwIULddKRSwRcc= X-Received: by 2002:a17:902:c85:: with SMTP id 5-v6mr22371901plt.126.1531176595218; Mon, 09 Jul 2018 15:49:55 -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 h8-v6sm22117666pgq.35.2018.07.09.15.49.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jul 2018 15:49:54 -0700 (PDT) Date: Mon, 9 Jul 2018 15:49:53 -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 , Michal Hocko Subject: Re: [PATCH] mm, oom: remove sleep from under oom_lock In-Reply-To: <20180709074706.30635-1-mhocko@kernel.org> Message-ID: References: <20180709074706.30635-1-mhocko@kernel.org> 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 Mon, 9 Jul 2018, Michal Hocko wrote: > From: Michal Hocko > > Tetsuo has pointed out that since 27ae357fa82b ("mm, oom: fix concurrent > munlock and oom reaper unmap, v3") we have a strong synchronization > between the oom_killer and victim's exiting because both have to take > the oom_lock. Therefore the original heuristic to sleep for a short time > in out_of_memory doesn't serve the original purpose. > > Moreover Tetsuo has noticed that the short sleep can be more harmful > than actually useful. Hammering the system with many processes can lead > to a starvation when the task holding the oom_lock can block for a > long time (minutes) and block any further progress because the > oom_reaper depends on the oom_lock as well. > > Drop the short sleep from out_of_memory when we hold the lock. Keep the > sleep when the trylock fails to throttle the concurrent OOM paths a bit. > This should be solved in a more reasonable way (e.g. sleep proportional > to the time spent in the active reclaiming etc.) but this is much more > complex thing to achieve. This is a quick fixup to remove a stale code. > > Reported-by: Tetsuo Handa > Signed-off-by: Michal Hocko This reminds me: mm/oom_kill.c 54) int sysctl_oom_dump_tasks = 1; 55) 56) DEFINE_MUTEX(oom_lock); 57) 58) #ifdef CONFIG_NUMA Would you mind documenting oom_lock to specify what it's protecting?