Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1494092imm; Wed, 1 Aug 2018 17:33:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd1JSwBlNe2iw6BG14iV07+FlXwntCWTTizDnkd9lGC65uJfnzPrYTWMOB2+gAkXtsXpY3+ X-Received: by 2002:aa7:850b:: with SMTP id v11-v6mr534931pfn.165.1533170030908; Wed, 01 Aug 2018 17:33:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533170030; cv=none; d=google.com; s=arc-20160816; b=Z/jj4OY1uOcl3Mda+n6B0KjJjCrXgnlJJW5WOQBcgzR8gqU/NhIfel2LEE99zkTqeM 1FBPLJfvq7q+epOq8tyLL+dJ4yMfvRwetAOVlzwhBH+zC8LW4dZbZnolTCQ8NDeDBivQ wV2jRAfa8u9eJa8RoPCgpc3fR61TIjYTyFtUcl1uxebnfKI3flvpnSSztwEfeuNml9ao d9IoLqjVeTcZEJ7+YmL9ubc7VKeqa7UKGL+ee6AsvwuGK+19g3qxLPZM4IV8Hexdal+p 11DuFLiEOmgRNh2UKGVEJlGqneLuvGsnI2FIwyIHi6kr3puES3jrAXPqCkA6oSQErkAZ CuYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature:arc-authentication-results; bh=fNVyiAIBIt6KSpSIK4JC/LqIQo+P2P87Wx7Z0FrDux0=; b=iPX47wm/ye3VXEI7+HKmyKf246juH1BQ6EsoNc0MZEOVHA5hIJG5w2FoWo8oP+Zb71 d9y90kWUuhL6FYToD/nPAS89fYHTcNrdz6AMwmJMjf5KsKditC+iePkYcvjaKB13rr3F G7c6gcKXKYQYIJEeIbnxmMQ1PJG0ngts0E0kTNXrGJPfRPb6euhGVmonEMO7xDrG/Jft ctVzuqYUQlMjNktkj0qcuWX1X7iw53PtnZh7ttMzU1q9Tu7UtuyyApgdqdNf94wjsKOX URWaqc68tFWVfVoZ5kV+AzsMBIp1Hdi7q0W/Zq3g1e0pUm/REqrUcQq9dUH7MkPUNyfz cD0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=aJbVtiKd; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=MURVPopI; 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=NONE sp=NONE dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c32-v6si296815plj.277.2018.08.01.17.33.36; Wed, 01 Aug 2018 17:33:50 -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=@fb.com header.s=facebook header.b=aJbVtiKd; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=MURVPopI; 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=NONE sp=NONE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731682AbeHBCVH (ORCPT + 99 others); Wed, 1 Aug 2018 22:21:07 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:49230 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726192AbeHBCVG (ORCPT ); Wed, 1 Aug 2018 22:21:06 -0400 Received: from pps.filterd (m0148460.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w720TE4S011174; Wed, 1 Aug 2018 17:32:27 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=facebook; bh=fNVyiAIBIt6KSpSIK4JC/LqIQo+P2P87Wx7Z0FrDux0=; b=aJbVtiKd2jq5d+v1V7GRFw+4oP7tVVEnyAhJY1UuTyAiW/AfC/D/Mx96DCkI6Zf3o7Gk nMa5WbIO2mQfUZpNh2dyILMYiIsRGnE/mdx26HpcZfpg12HXVkIOmZQ2qH4Iwi+hvojM KXdLKwuLaMMcOJxSrxFHL1Sz5f0UE0eXIqE= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 2kknf1g97p-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 01 Aug 2018 17:32:27 -0700 Received: from NAM05-BY2-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.31) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 1 Aug 2018 20:32:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fNVyiAIBIt6KSpSIK4JC/LqIQo+P2P87Wx7Z0FrDux0=; b=MURVPopIFNsgtWco/55m/T7zVhKLD7IJlCCyPUi4fmz4xEL0oUy7aZVnAzi8WSTNcmh10672ea3kV6Apgh4Fo5f/wjFj3w+mqmBG+FkdAV/zkvi9tyYpS8WLTe1a295hAzamvIxytNYiL2pwTNjfT1OUqRulTMJvCvLR9EMrxW4= Received: from castle.thefacebook.com (2620:10d:c090:200::5:2fa7) by BY2PR15MB0167.namprd15.prod.outlook.com (2a01:111:e400:58e0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.19; Thu, 2 Aug 2018 00:32:18 +0000 From: Roman Gushchin To: CC: Michal Hocko , Johannes Weiner , David Rientjes , Tetsuo Handa , Tejun Heo , , , Roman Gushchin Subject: [PATCH v2 0/3] introduce memory.oom.group Date: Wed, 1 Aug 2018 17:31:58 -0700 Message-ID: <20180802003201.817-1-guro@fb.com> X-Mailer: git-send-email 2.14.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [2620:10d:c090:200::5:2fa7] X-ClientProxiedBy: MWHPR13CA0006.namprd13.prod.outlook.com (2603:10b6:300:16::16) To BY2PR15MB0167.namprd15.prod.outlook.com (2a01:111:e400:58e0::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7f8b8e69-11b6-49fd-b8dc-08d5f80f67a0 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:BY2PR15MB0167; X-Microsoft-Exchange-Diagnostics: 1;BY2PR15MB0167;3:Mw24likUB9mSSUoAUBe3QBZYSy4BuCkif1yHMo74mdZaghOvb6V+AlcQNnaFq/ZZq2iGV7cWJLl3oreAC/cujHuifldn61SiLUNKdQQ87aC0gZ7HpjI+3BArQXk47bRpmAlCv4eT5IgxwuVGOhzLiv6F2x2UU7Xfpwv0nD3HA0KMVWcUs//4JN8NpAHgeD+UTZemTn/RBsl43shotjhTUcAq0Kv04D0A610NMk8S5LOxMEFHoCmdfPD+CYcQ71fi;25:Bj0bS5geeKS93BAVONBau6cBLlWPs0F6m/PQJ0xbAQabwns02wB/z+lHnVOyJ75EJ/vJEImfFOZI8Ex6BJUzKfiJczBcf3VQssv4dTiD7b+Ui2Hq7famr5+RnkSdGRLfSL1asHZgqd97yFKUz2XhZdf5YSpsgPOCEr+ypBL52Phm06qLFWi3j8o5kd7az/y5nIZG1kFfzT+4uSQielNiFXDbhSB0zB5KMKWtoq7T7luhHqczy/2nUQAIR332uZnmnNiTKi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feQZYn1XWFICh4GG2CTj2fMv3SCiJoH2TiJMZ3hKDpI3+d8KW7fEI+SEGLzJ/TRv+kL2Ga907gL4MZSr2HffI0oHbavQYSiUgHANSpY+rWBx+SZnbJOSZeln/WWCrzBMUWQinXMCi8oka6I0qS X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231311)(11241501184)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(149027)(150027)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:BY2PR15MB0167;BCL:0;PCL:0;RULEID:;SRVR:BY2PR15MB0167; X-Forefront-PRVS: 07521929C1 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(39860400002)(366004)(376002)(346002)(136003)(396003)(189003)(199004)(25786009)(52116002)(54906003)(36756003)(68736007)(16586007)(50226002)(316002)(53936002)(51416003)(6486002)(6512007)(50466002)(52396003)(5660300001)(6506007)(386003)(4326008)(16526019)(478600001)(2361001)(186003)(6916009)(1076002)(305945005)(8676002)(476003)(6116002)(486006)(2351001)(6666003)(7736002)(97736004)(8936002)(48376002)(2906002)(53416004)(86362001)(46003)(47776003)(69596002)(106356001)(81156014)(81166006)(2616005)(105586002)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR15MB0167;H:castle.thefacebook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR15MB0167;23:EE0ZzODyRVrCVaLhjv+9asc+SRyl0utFTnojYgEdQ?= =?us-ascii?Q?BeViiwYN+JQAN4Gjb4k1JjHg5Fv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ZxRGb60cKYVctSJiFwieNPsHrdIU8bVVkkH3JeTd3MDoosy7CVDeys0jllHgqoR2G+5Fx1rjPLRPXXiYZRtI7ITpDCBV7KUmZT8ugt6PTXQDazqsbB5mCrPUsl/MWBTKt+6Vx1fI3P6K0q1UOiaGt/O1HbfdXbrt5PesId0/Wrxd5cC+Jw==;5:pmpUDxlelan0y2XmoPtJ+flAjYqLyxuT8LxssWRAri0UFDfa5G7UWZYCTkfbAjq+NCMVe4Uh8B8+1k7PRfnlcyOn3tEJ17/QTBnfKVHJk899Do/rDmyI8H++DyUlec87qDeQM8M0hNkiuSFML3Ft/B7sFqR5knEUBszINqvJhOQ=;7:yObhr96te3MEE1BJhHLdZ1rAn+BPYbvWqsZzGHOla5tDzeKtyCTW8uTC0SQqOnDh42lsylHdXdS6UquZy36e4QiZz38FyQbW/kST/bmmZuNxMZZNSwmyi8AE4Xc5gjsGbFCqZ24VBibZ+YW6O/es5no3bnC7h18jxJtprxMTb+DpwPHn7A7K1Rwi3xj4HZUjZl4yZVGXoQ13o6XfH3QWfQpP/kBtu3VCLBZXL4mqjBzKfF5kGJIKjCNi6dSjKMeu SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BY2PR15MB0167;20:v819ghRwJay3TZsC9Y4aGw8hSKmT+L+6fg7244LAcZX4JEAL5Vn0YCRKCmB5PepfpXPN2vf2eXXHmCpZXg+ZHwa0iiXuVhKQSscXlP2HGPyOSdWwyR8/FTzRXzUpDkOgi82MTM4qYkD7Pm9BI1/QDqzhFW3dFCt3xF0G/YqhfZo= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 00:32:18.0628 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7f8b8e69-11b6-49fd-b8dc-08d5f80f67a0 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR15MB0167 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-01_09:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a tiny implementation of cgroup-aware OOM killer, which adds an ability to kill a cgroup as a single unit and so guarantee the integrity of the workload. Although it has only a limited functionality in comparison to what now resides in the mm tree (it doesn't change the victim task selection algorithm, doesn't look at memory stas on cgroup level, etc), it's also much simpler and more straightforward. So, hopefully, we can avoid having long debates here, as we had with the full implementation. As it doesn't prevent any futher development, and implements an useful and complete feature, it looks as a sane way forward. v2->v1: - added dmesg message about killing all tasks in cgroup - removed an unnecessary check for memcg being NULL pointer - adjusted docs and commit message - rebased to linus/master -- This patchset is against Linus's tree to avoid conflicts with the cgroup-aware OOM killer patchset in the mm tree. It's intended to replace it. Two first patches are already in the mm tree. The first one ("mm: introduce mem_cgroup_put() helper") is totally fine. Commit message of the second one has to be changed to reflect that it's not a part of the old patchset anymore. Roman Gushchin (3): mm: introduce mem_cgroup_put() helper mm, oom: refactor oom_kill_process() mm, oom: introduce memory.oom.group Documentation/admin-guide/cgroup-v2.rst | 18 ++++ include/linux/memcontrol.h | 27 ++++++ mm/memcontrol.c | 93 +++++++++++++++++++ mm/oom_kill.c | 153 ++++++++++++++++++++------------ 4 files changed, 233 insertions(+), 58 deletions(-) -- 2.14.4