Received: by 10.213.65.68 with SMTP id h4csp1080601imn; Thu, 22 Mar 2018 14:56:26 -0700 (PDT) X-Google-Smtp-Source: AG47ELt5qAS9F9cvEjfcl7kLdn1Vbm4PJbNWcQptn4ia2Zb6GtsLBrRHIygjheJ2u8xzGbcv46G0 X-Received: by 10.99.122.22 with SMTP id v22mr1209943pgc.300.1521755786812; Thu, 22 Mar 2018 14:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521755786; cv=none; d=google.com; s=arc-20160816; b=LH5WFvUvfHArc+IYP19c+MXEyDe1AvVyQNXdmjo9T94rFGZ+E7KaHsx4I8EQh1HXRH I3ulKDVXmF1d3Tb56reXBNl5Fg9XFK2NS/rv8QBDDw9j0X5R4Q7LFY8QNPFMT7uSznz2 fWtfs4FsOsw/amwRvP8EZaYVdAuMhzXVudfRabpma8w4Zd2HibeLZ4qwbTCvMbmlYt9q LpBrucgQEM3uc5F2RmZUmBlTANF4ZEIBUKd9bXhFXb5S/h8HG3Ogo1tmnRlu+XM/Ej4M pEfKUCuK43D2235QeqwanamvCkgKPSa54I/jVmMBWw/gdLNfwmt8ZGzPcSIH+m5dxdq3 O5cg== 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=KFxYgSN8pX0Nv49sy0p2lYZ5iovBzG9fzDNhwW9xwH4=; b=mcCoiojq0a5uc9AIaFzd0YL297KOrXp33ChItjREQwctnZQHsh4uWJsvE+SaJG/zRe IWbXOJS92L4iKwzMWcAsMY1yzFkr+0xRTgAoqQFkLOYAu5DI+gejuvob5YiYkR8Mj6Nx U0qX1bkS19MkJ603wUH+8HKwJOJyKBBPzkrUBlP52An11hxuyO5sLmOAh32YFQbm/6T8 E9A9c6MDsNJc8vKlMGTs/z+BSS9MfOityJwjDFroczGudr7yUym0FcwideeFg7S2Calg 54jFjtG/OyD6IJ3zdsgVav7O7nIFrDP9lxF0aQLGYTFBCHdCfwPzpUs5mWKV1dZwjAJB YsDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=NaQ93I1x; 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 x10-v6si6910496plm.487.2018.03.22.14.56.12; Thu, 22 Mar 2018 14:56:26 -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=NaQ93I1x; 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 S1751761AbeCVVxv (ORCPT + 99 others); Thu, 22 Mar 2018 17:53:51 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:36877 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751541AbeCVVxs (ORCPT ); Thu, 22 Mar 2018 17:53:48 -0400 Received: by mail-pf0-f193.google.com with SMTP id h11so3911982pfn.4 for ; Thu, 22 Mar 2018 14:53: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=KFxYgSN8pX0Nv49sy0p2lYZ5iovBzG9fzDNhwW9xwH4=; b=NaQ93I1xNbJZiTfzMJ+J4k/UThgoyfQUfa6T/TlYo5sMrX6mWdyPSZ6LH+lU3EHPya JiWAohDCYJ2xZOxzeOM7/ekiacJ0k5TnKGsIfNS/hp9fySKQFtI4mH5rVOKMILmv2mGq AmfVxbcV6FKaJlJr8IrF9i533ZqsW/EbG+oWwgT8VX/5jcYYSxDz75mWWmIbAAoB/AnM V2IepIfmDe9Mse+P1sjQVGsA21S00DLKSM9WJwL9DojOxsVAuk4zSOHbdJc7T4ncHEIr ISIAWaP2HvW5kNfr9SePgEcSijFy0acMAjnUpYoSCEpsyiNeSw3U+fzvI8VNOfns49gz KoNA== 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=KFxYgSN8pX0Nv49sy0p2lYZ5iovBzG9fzDNhwW9xwH4=; b=Gl4Up/Go7JMSto3R4X6VdzF7v9/1eT4FyC5RCVaGsntiS5NcAAGRYYqRCVmsAkU/ey 0FmDTOoq+OKW67bz9CqW81n9Jtx7y7myR+0/X/EgtDgOTwbdAvNs67wvRMDLRU4rsKh4 tSvbnVUjCWSruVHNEJQYzApoPo70gQMMXKxITn5xwImU807Aqe8+/mMDnIwYvqLcxe+F nCMmVVxGEaM0mcfY4D4zXPrZnhjq+1PSapYZai1vBv5hHkk8j/j0jZUSddA3rr/RIElN 3rzlaGKem54nvUccLagTv0leH9nPoEUvCAZvoXW8PaHoiDMKuZsQIT0uii3DSnrb0K+n j2BA== X-Gm-Message-State: AElRT7FtCtUla5bcYBnnG9nYPIgq3hNI75l1GZIAjj+vkbdezdWtOBIv D1ukbCZW+yoKJd650vxPawETlA== X-Received: by 10.98.95.70 with SMTP id t67mr15831542pfb.200.1521755627934; Thu, 22 Mar 2018 14:53: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 z15sm13704941pfh.11.2018.03.22.14.53.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Mar 2018 14:53:47 -0700 (PDT) Date: Thu, 22 Mar 2018 14:53:46 -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 v2 -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 rewrite cgroup aware oom killer for general use 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-20180322 - Fixed get_nr_swap_pages() build bug found by kbuild test robot 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(-)