Received: by 10.213.65.68 with SMTP id h4csp640977imn; Fri, 16 Mar 2018 14:13:23 -0700 (PDT) X-Google-Smtp-Source: AG47ELvti/2yTHuY18LwMtKJ5/0tEO+/nFQiaU/a9PYpj9cPJoYUYg2ZwJUVLPeIJyJWU0XXLpvs X-Received: by 10.98.30.66 with SMTP id e63mr2784227pfe.67.1521234803070; Fri, 16 Mar 2018 14:13:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521234803; cv=none; d=google.com; s=arc-20160816; b=Ve3m2J1CR9OSJXOPpnJDHll5rj0LuSWUVAG5uL1vgLmhgLeyEffP/odMUcSlRzneXc o1SS5Eohlh8balYEzDQHrYg9Uuu5Jl6PwhhflMjbez0dZItyHF4qPPnNhQbYZbDDrCsP pU9I2bowsiTa4l7RLreNYPiyDbhx0VhzfvQTcmIzJLkTDmNJ0ve3vxRK+Lh1R2OWecT9 l369j3OH63Qmv0AaGiUPIGo93FjijYZU5P00xh1zWk3B1+VyIsCuNkbjoIl3u1O1RT2N LqTeFbGxuXe7KNv6N5QCMU154QnGXKZw8pPsiVUd4NJvwz9I35mh7BFSuGQyYO7TrSWQ JH5Q== 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=N72TC+qOwynd7rWhPmbIkxIz5vKrVeEuLaLu0FJ9oIY=; b=mqoSqacyJveJs+Du1oYRbq2R8NIGvlXy93dqVR+p+3kR3dGzyA7oQZ8aFlu0zwYamr vycCto4Hi/iw2GLeNWoOprzyNhj8WaQklbgQBZN2GpX43P3arD2OBfyFDSk42qLLjbIz lie8G/AxUGg0PfCvHMAY8KNRs2Bf++vDaErJhzkH1igcgqn15iwrU+H3UTkHFNwszhNR mECt3egN1/9dhDWkAUIa/LL7zRG5mMoZrXiVgZa0c8Vk+KZRcEQi29uvcBtQMQnsEfpR 9qJEcMjWK+e+BBcESAuKj/JjOS77MyR9UKjN/Wl4H6ztoeRAUr9XWB4LzeqDa99imCpF J1rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=iHGdXV4+; 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 o6si4219214pgf.82.2018.03.16.14.13.08; Fri, 16 Mar 2018 14:13:23 -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=iHGdXV4+; 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 S1751542AbeCPVIu (ORCPT + 99 others); Fri, 16 Mar 2018 17:08:50 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:33492 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751454AbeCPVIs (ORCPT ); Fri, 16 Mar 2018 17:08:48 -0400 Received: by mail-pl0-f67.google.com with SMTP id c11-v6so6614777plo.0 for ; Fri, 16 Mar 2018 14:08:48 -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=N72TC+qOwynd7rWhPmbIkxIz5vKrVeEuLaLu0FJ9oIY=; b=iHGdXV4+AsKdY1vS8qlTM7GFnXd0bfugFpmKifj6Pm4umhZ8BHfLD4V+VtlSFZKn39 ThwnOETFIBoZRv31pY8SAFySppwOlSod5r1mLZhaAGDrhSekvTL3+gXJ/Zc2vYPtgxul JeBSZtp9Ev68NBQIlGNd2xgRUhn9Pb9dA4H4toL/OwqvN46F6pzmwkuFXh0sJdxvUUX1 vk3xO0rbEtRNlhlpmJ1C9z/ChPi3/icDzLpmtEA8CKEzQ4Lgb3HEnAw+ydRNEAymR9FE 37RxdG26SQ4EB/M2DNHUXpt20XfMUwPrCbM0lVtrUIhY9m+Lod7KjO9uNfdZCrbNxxfm sBRg== 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=N72TC+qOwynd7rWhPmbIkxIz5vKrVeEuLaLu0FJ9oIY=; b=cVLIrwHT5LW4cib3bN/k94/E87bfrC3OXO4dWwupELGLM73/kfzC+OGVR6WbChnbWW 9ZJ4EYVvOiqs89tUWvt9hP62p1dmoBdQfDocMQrNFIYOPJdta9EXfWk+9KHiuv0l957r vvhWjKbL0USbwWDI6wKxDU4H9tFM/JbqyQdLdqm9bt+dexau/ChcmS1jyf4p7TsWrXEf +xv3jwKPMHbstZ8HIvdItcz+HpzNE4gW/2wzwyNt0FxSneGN2KhXb9Ws0nfAxQkyHNfh GD2m9Q7rGViU214MFDMofr/fLeOEwhso5Oc6W/j2EvnISif05oIiYzC7UeXaulI4nUtw LSkg== X-Gm-Message-State: AElRT7HfvVkom+PterY6B4ek6VQaDg47KYFlRPbMwRZjuTzxtztJr+KJ xDYmE/FGoUOmpFDeqeSaohiNmQ== X-Received: by 2002:a17:902:8bc2:: with SMTP id r2-v6mr3559390plo.213.1521234527272; Fri, 16 Mar 2018 14:08:47 -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 o82sm19844758pfj.163.2018.03.16.14.08.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Mar 2018 14:08:46 -0700 (PDT) Date: Fri, 16 Mar 2018 14:08:45 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Andrew Morton , Roman Gushchin cc: Michal Hocko , Vladimir Davydov , Johannes Weiner , Tejun Heo , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [patch -mm 0/6] rewrite cgroup aware oom killer for general use In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) 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 There are three significant concerns about the cgroup aware oom killer as it is implemented in -mm: (1) allows users to evade the oom killer by creating subcontainers or using other controllers since scoring is done per cgroup and not hierarchically, (2) unfairly compares the root mem cgroup using completely different criteria than leaf mem cgroups and allows wildly inaccurate results if oom_score_adj is used, and (3) does not allow the user to influence the decisionmaking, such that important subtrees cannot be preferred or biased. This patchset fixes (1) and (2) completely and, by doing so, introduces a completely extensible user interface that can be expanded in the future. Concern (3) could subsequently be addressed either before or after the cgroup-aware oom killer feature is merged. It preserves all functionality that currently exists in -mm and extends it to be generally useful outside of very specialized usecases. It eliminates the mount option for the cgroup aware oom killer entirely since it is now enabled through the root mem cgroup's oom policy. --- - Rebased to next-20180305 - Fixed issue where total_sock_pages was not being modified - Changed output of memory.oom_policy to show all available policies Documentation/cgroup-v2.txt | 100 ++++++++-------- include/linux/cgroup-defs.h | 5 - include/linux/memcontrol.h | 21 ++++ kernel/cgroup/cgroup.c | 13 +-- mm/memcontrol.c | 221 +++++++++++++++++++++--------------- 5 files changed, 204 insertions(+), 156 deletions(-)