Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1138007imm; Wed, 1 Aug 2018 10:49:05 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdzNwVxLUv0lR6k9vt9x7S9dKF4CcqJ3XJGHZyfYKCL4KuuVi61VgL6p+Oh29yHyrzd9HMb X-Received: by 2002:a17:902:3041:: with SMTP id u59-v6mr12359019plb.99.1533145745146; Wed, 01 Aug 2018 10:49:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533145745; cv=none; d=google.com; s=arc-20160816; b=P+pTu5Yhx74Y/sjLUDHFc27YL87l1kIvxhXw4d02cgFCy+a1dntvgJIwf/3HZcJ22e kT9hrFmHm5TFagjA8hwsgsAK+ICivRwkMi116GqOsWFtX1ipMqD72yoDkiuvRTLLELqz SrGn6A6GHoZk9XBQSWh+WHB6og5Xuc9oDXCE1BxZZfY9eldHzkHW1HvVo4zRyHsqVKB+ mUWTbt5lXRfj4KNgPBddOkjQVcbigGQVZR2cnTIXjf18u0XYO09MhUwjfoiesRuXK6uJ QDh1VjEGF2BBoL2T9eV+U4WJOGf3F8HxI9DDhEWLSx/uCKNTA8tCKrIZ1kAKUtVrp9yz 4zLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=d+PBr8yO/t0mYb/vcUiOOS5iptLMm0cqwwE8LlY3BE0=; b=zq+E2Bt0VOG1QlYMjK4HQZ70bMCWW1R1znZmxiT35FObxvXiQJfdLBmhcByGmlXw7c Xum453VEB1uHk71VLncTb8BOvw8G5d8cTNG4hSBZN7zvoGYZGDV0GlHCaHUDVf4sTgr6 atwqX79KxLpByOB7smWRhzihxplvgmu/Wiwn0FLpVlxaaw2WIv6XB6tyEIqekT07jgP3 DKfTxLpLEYfjqZMYykoIczXGHqcBbmuY38ous1XH0UpZUs8U8MsnoOTRnEWg0Mqur9rn wSlujalFTikQOnA9vLFmM0i5jWgkpZYz4M6g+ZwykCQdoCBw6T8biiVNLQ9wtlXP0WOt 0JeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=bPdWNxSX; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x16-v6si17130904pgf.311.2018.08.01.10.48.50; Wed, 01 Aug 2018 10:49:05 -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=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=bPdWNxSX; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390351AbeHATex (ORCPT + 99 others); Wed, 1 Aug 2018 15:34:53 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:34067 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389959AbeHATew (ORCPT ); Wed, 1 Aug 2018 15:34:52 -0400 Received: by mail-qt0-f195.google.com with SMTP id m13-v6so20848912qth.1 for ; Wed, 01 Aug 2018 10:48:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=d+PBr8yO/t0mYb/vcUiOOS5iptLMm0cqwwE8LlY3BE0=; b=bPdWNxSXI+0vCy+e3+jWmRP2+l7U45EmvX3FrwuNItgHBLyfoaaKgR/hyawLZGlhq4 OvkKkdXVeAGTiT+wYiq86Pv4qwfKrB5T0HVNueXQP40p5S7oopeG+zT1blQCYkeylhUd aiMtfoKmoyRG3Q5dHTpNQcy9OYXSEhW5tIbqYR6uutvi9nFRuNhLX7RxtmJNfv8qNT81 LuyhrvFGELK1doY9nmiEy0VNXIrLucQDpFIOXUaEI0LRj/dtW9i2akaRLu2UgQlfQsqf tuMQnxs4tC9c4AXC4VXOQ1c0ioGzpwvQw/ZW/MDlqDflHGm5kkaqiSheIzQYy487BX9C Wytg== 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:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=d+PBr8yO/t0mYb/vcUiOOS5iptLMm0cqwwE8LlY3BE0=; b=Iw8vNEGJVqjJ3tqMt7xII6ICbm+rERZObp/v7ibiJRvNZ/sHNdfwwc4M+P20Z04Yfl ayoDIFBOEmmzZHjS5ZDCIfKEBDiFVyPXcONnblVZqfqirDQXWy0NSGncO/NM7WLA6BQ5 DFjcGlHDJ1aGbJpcw0kfqD+wCGEQBZP6vXMtSXsKy7O1ceFN/xH1Q9VRJD2mIrw/Gpph 3tVrb5A8wHvDl76Fl/YlhlKjW1zbgTRi0XBsSxDDjrRogyJ0BssMqNn8GYKMRfyXDUBY 2u6ezv2iRW6Wjp49gFEUUjMWwpO0tHdfGMPI+CBKhCzOiD/cYD8BDnit8QYNiP+WfSSi 3Fsw== X-Gm-Message-State: AOUpUlHgakJ3atTFeIiw6e70QTu8yI+O94HknnnUQuH2TOQYKN+tX9E5 KxGNoCaLShB6GLhGBjj9GRahQQ== X-Received: by 2002:ac8:fdc:: with SMTP id f28-v6mr21158125qtk.63.1533145683495; Wed, 01 Aug 2018 10:48:03 -0700 (PDT) Received: from localhost (216.49.36.201.res-cmts.bus.ptd.net. [216.49.36.201]) by smtp.gmail.com with ESMTPSA id l5-v6sm11097189qte.20.2018.08.01.10.48.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Aug 2018 10:48:02 -0700 (PDT) Date: Wed, 1 Aug 2018 13:50:57 -0400 From: Johannes Weiner To: Roman Gushchin Cc: linux-mm@kvack.org, Michal Hocko , David Rientjes , Tetsuo Handa , Tejun Heo , kernel-team@fb.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] mm, oom: introduce memory.oom.group Message-ID: <20180801175057.GD11386@cmpxchg.org> References: <20180730180100.25079-1-guro@fb.com> <20180730180100.25079-4-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180730180100.25079-4-guro@fb.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 30, 2018 at 11:01:00AM -0700, Roman Gushchin wrote: > For some workloads an intervention from the OOM killer > can be painful. Killing a random task can bring > the workload into an inconsistent state. > > Historically, there are two common solutions for this > problem: > 1) enabling panic_on_oom, > 2) using a userspace daemon to monitor OOMs and kill > all outstanding processes. > > Both approaches have their downsides: > rebooting on each OOM is an obvious waste of capacity, > and handling all in userspace is tricky and requires > a userspace agent, which will monitor all cgroups > for OOMs. > > In most cases an in-kernel after-OOM cleaning-up > mechanism can eliminate the necessity of enabling > panic_on_oom. Also, it can simplify the cgroup > management for userspace applications. > > This commit introduces a new knob for cgroup v2 memory > controller: memory.oom.group. The knob determines > whether the cgroup should be treated as a single > unit by the OOM killer. If set, the cgroup and its > descendants are killed together or not at all. > > To determine which cgroup has to be killed, we do > traverse the cgroup hierarchy from the victim task's > cgroup up to the OOMing cgroup (or root) and looking > for the highest-level cgroup with memory.oom.group set. > > Tasks with the OOM protection (oom_score_adj set to -1000) > are treated as an exception and are never killed. > > This patch doesn't change the OOM victim selection algorithm. > > Signed-off-by: Roman Gushchin > Cc: Michal Hocko > Cc: Johannes Weiner > Cc: David Rientjes > Cc: Tetsuo Handa > Cc: Tejun Heo The semantics make sense to me and the code is straight-forward. With Michal's other feedback incorporated, please feel free to add: Acked-by: Johannes Weiner