Received: by 10.192.165.148 with SMTP id m20csp4531765imm; Tue, 24 Apr 2018 04:30:04 -0700 (PDT) X-Google-Smtp-Source: AIpwx48WplRP/d4PnAokPPxJOplg6GsScDyl+0XYoOTPITTEALhtawtwHLQ6gVK13bc3C0JS6hHn X-Received: by 10.101.98.90 with SMTP id q26mr20247573pgv.113.1524569403993; Tue, 24 Apr 2018 04:30:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524569403; cv=none; d=google.com; s=arc-20160816; b=bJfgfPhpcAujzwsDaOgnnYBsshYXm5b6ZbIaOQEgTnpLSoCL33PvqEH1gJb8Lo2cT9 JLhBZATlww5ubFwZ3CSr/KoYvvH3THzIO6QPYuukcjBP8CGC92GF20SqTO0A+7epyLVO OM/whcktwK/lpSSp4a1Pp5EOoSRAygvp8z0MP/r/3wK3l/6LMXynYM3UGCdgB7PYvmwU cQDxeRL16HpXBO3KzDgEYM8UBcyo6OGmKPyeTuRINO8XEBf/8Iz7pBui0VPbLd2dMlYR BzTKoCVCadEV4tCm2kk1cBE/BekLQbNi7DRAbIC9z1M5Esk6QluNaWC58yMNQD2kmyDY GtBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature:arc-authentication-results; bh=QRR3Hnig8dqLi+uyZZa9YutLhVa45kyzjElxvmcGyE0=; b=QF4C6HRZ1YUJpjU1ywEn1qimvnwQeJKr8qN+7s4Z2/UuBFf67HORewt+uJ+fYGNaNF FOWhCWsFI4o7BrAZ0clvEwvZi/uLQU0e0YJ+Ah6dxZXKtJaaboE0+5+PG5oo3N9v3kWa q5ltbdN7JqgvAZqlQ7afPWTjYHSA/S66/mLhhoa2P5/H0U0hezMphZPM03Oo8LuGKt0t nug5SApbhkcX+gjJnGyShR96CwLXolo5HkCZcXXpQGjRjJIRwVN46b6Omj9xCvU5qspN xEcscNMfiOQ4XLrToc8IR9N5Oic1spusUnHzWY7TisAYMuB6Cs+rWylEx8dFmZ7rF4GH aqYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=SZYyx3wy; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=Fy85oVZc; 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 j12si12015525pgf.222.2018.04.24.04.29.49; Tue, 24 Apr 2018 04:30:03 -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=SZYyx3wy; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=Fy85oVZc; 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 S932330AbeDXKKJ (ORCPT + 99 others); Tue, 24 Apr 2018 06:10:09 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:55462 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756384AbeDXKKG (ORCPT ); Tue, 24 Apr 2018 06:10:06 -0400 Received: from pps.filterd (m0148461.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3OA3GjJ027090; Tue, 24 Apr 2018 03:09:53 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=facebook; bh=QRR3Hnig8dqLi+uyZZa9YutLhVa45kyzjElxvmcGyE0=; b=SZYyx3wyXfHbwD8hzkqLmbxfIv8Usswb0g/scRvbYsPUEoLMRIfBtycl1kyxiqBSg4Fr smRrCQP7Hfawscad1m8QmhsbZ8nBDv/VNuCugyeFP4XKZoZLW6tt1P4Q/UPp3YzUQ5YS q3c0RtR0qtW4GgbbOIXy95qVsNvkcQd3jLs= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 2hhvnf0kn1-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 24 Apr 2018 03:09:53 -0700 Received: from NAM01-SN1-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; Tue, 24 Apr 2018 06:09:50 -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; bh=QRR3Hnig8dqLi+uyZZa9YutLhVa45kyzjElxvmcGyE0=; b=Fy85oVZcRvQofWSypZIXheRXHMd4eqvrygIzComYGnxK6nH8wLd3hBwsrNZJF3gZlL74EYQ1wSIH776ff3RFtw9oQPfPY35R75kN2iE50wYSDjCzyBhfG+w/Hi3Wd4YGDFeeGgfOZeTFmbifcaNfHJdTT3tGauHDl64cuVEHj7s= Received: from castle.DHCP.thefacebook.com (2620:10d:c092:200::1:d5ba) by BL2PR15MB1073.namprd15.prod.outlook.com (2603:10b6:201:17::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.12; Tue, 24 Apr 2018 10:09:46 +0000 Date: Tue, 24 Apr 2018 11:09:33 +0100 From: Roman Gushchin To: Greg Thelen CC: Johannes Weiner , Andrew Morton , Michal Hocko , Vladimir Davydov , Tejun Heo , Cgroups , , Linux MM , LKML Subject: Re: [RFC PATCH 0/2] memory.low,min reclaim Message-ID: <20180424100926.GA23745@castle.DHCP.thefacebook.com> References: <20180320223353.5673-1-guro@fb.com> <20180422202612.127760-1-gthelen@google.com> <20180423103804.GA12648@castle.DHCP.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-Originating-IP: [2620:10d:c092:200::1:d5ba] X-ClientProxiedBy: HE1PR0701CA0088.eurprd07.prod.outlook.com (2603:10a6:3:64::32) To BL2PR15MB1073.namprd15.prod.outlook.com (2603:10b6:201:17::7) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:BL2PR15MB1073; X-Microsoft-Exchange-Diagnostics: 1;BL2PR15MB1073;3:oTyq95LNQiW74J7qJV97q+9WAR+QeFNVSFnmbHJZ/Tr4vg3EpOgBHVmGw9KK43cYv7tg2NWmH1PFM3cM4IOFLSarilFpM5c/+jJ1qE8FtxiXXpqRjiW5atjvEZzHGVZGbuIU5UJqU0L/16qIfKdQts8emFxnxfN1exd/ijsLVu57zHyRJc9m2A1mnr7vMvBFIbBtSv7P6r8wuGewFS8Voxl5trtB5GBO40vP9LSpMe2fsiyPH/XdTbb9gNItpnKF;25:ZHDglJmZC3ZBGuau6AEpth96LcKOYUsl3Vg5intSMyc/1xZNcogrQXmhhk1csiF8BPENb0n0UgQQ7IycnHI0+ID4dMG5x9X9eatc4wXe0VaySP5XjCnXG5XM47WeYlwR+C3nhia9zJ4QAEdSI+XQh3OG0pEsBAYH/s2DvdjY/ByJ/jZ/iE2U+fDRF5kZ9xB/lFZwBVcisl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F+/7D6L1LIZgWjJCyOtgjXb9hWvWxg9bdR2ANJV/YpUQM1uR3ORgxe7GiABUBeXy8EHn9gclC8RsNKuwE6NHHiZdfZMLWNac/SOCoOpzb1AVVihG6Atuw+G0cW9tESY2FP5dV8G4ePyRPPCsTnOgsv17YKRGVNxu/rKJ3sbQIy+U2ddhWrFR7AUcgksoe2JXGxA93TrwS5f X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231232)(11241501184)(944501410)(52105095)(3002001)(93006095)(93001095)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(6072148)(201708071742011);SRVR:BL2PR15MB1073;BCL:0;PCL:0;RULEID:;SRVR:BL2PR15MB1073; X-Forefront-PRVS: 0652EA5565 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(376002)(346002)(39860400002)(366004)(39380400002)(396003)(199004)(189003)(51444003)(76176011)(53546011)(6916009)(6666003)(105586002)(53936002)(59450400001)(229853002)(6246003)(6506007)(386003)(33656002)(68736007)(476003)(58126008)(54906003)(316002)(16586007)(486006)(11346002)(446003)(2906002)(47776003)(5660300001)(9686003)(106356001)(55016002)(46003)(93886005)(1076002)(23726003)(186003)(16526019)(6116002)(8936002)(4326008)(50466002)(25786009)(52116002)(7696005)(52396003)(8676002)(81156014)(81166006)(97736004)(478600001)(86362001)(39060400002)(7736002)(305945005)(18370500001)(142933001)(42262002)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:BL2PR15MB1073;H:castle.DHCP.thefacebook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BL2PR15MB1073;23:wg5s5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GthYEWNbgQ3vaZFylMvnXzuJWW5WY9cVeZHMg+93B8w9RsbscH3p/k9VE?= =?us-ascii?Q?/ccnn0nMskRhY6Y7BCEL9H5qyHou7WjdwCMeBT+goH1vb4QtS/Qr/sgrESao?= =?us-ascii?Q?d1+9Kfi1Wo0q8zzNp4GrhpDgw+wDYUEFMA3Cl9Ipzlcrk/5QSPNRXNjveX02?= =?us-ascii?Q?piKyWYd87ajXaJ4Neza2yjqDzLxDB7jh4tUYGShTCzNWOTORb5OwJ/023xe5?= =?us-ascii?Q?rh6G/HdGdz5HvKYrX54IHrvpFyxXlpjRG5CmmrYstWUTGc4YY92LqSDDJ5Kg?= =?us-ascii?Q?jdG40+8NbmylmJFpNuU43PS3OBWfHQ5tzNeEJd5WrFpnB5SINDYZvSIxpZrO?= =?us-ascii?Q?HQafABEdhTCScvJZ12ioo4mMP5sZAKwhCEysccGVxLEeNXsljXHlvPElYX3q?= =?us-ascii?Q?yhBGXQdlarsjZLbb+LT3l6eGHXGAW+5Aki+8eZzgF1XstNf18f0XOTMbtTat?= =?us-ascii?Q?9y06gROgQtR43tZxeGfgABZgwZkwsBHBsNsa9cmYbdXlg9pkCoeBnwfseceT?= =?us-ascii?Q?tSDkhHJXw=3D=3D?= X-Microsoft-Antispam-Message-Info: DJTFpSHrnnsU9X5boRldnSPwIU8COw7MH/AttrsF4hBaHkBr57P7lKZobQfIUPr9/FQm/9AEU5vwOn6VlFcu+b/rP/RJO3Ia6dp5pCe/tl5Tnpcg5U4FeHZiG3j7oMwyG331VeiCA/sMcsfS0GhdiM0JonwLGJ94ZHfQlOOsdFbYVQppO7TNUUS9/j1xoNGP X-Microsoft-Exchange-Diagnostics: 1;BL2PR15MB1073;6:RTrz2Vlp3fNLkanI9fjNUq0DYLtRVK3OhxQUS8Syb8GOSRe281uWuRILcmNWFp8j8KfQ/Ww05ErNRKGLxrXk+48LiVqolUXGSlH+tSw9+Uz0T0vyvQXTWRUo2RJcKGRCAv767upMGecY8TksJZyzBeJ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kZyZ4LCvb/YEDh97IMxAoGgSuB+dNPn8kM9tirEUkdE0afXig= X-MS-Office365-Filtering-Correlation-Id: 3f1ef408-582c-46c5-33cd-08d5a9cb8304 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2018 10:09:46.4783 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3f1ef408-582c-46c5-33cd-08d5a9cb8304 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR15MB1073 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-24_02:,, 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 On Tue, Apr 24, 2018 at 12:56:09AM +0000, Greg Thelen wrote: > On Mon, Apr 23, 2018 at 3:38 AM Roman Gushchin wrote: > > > Hi, Greg! > > > On Sun, Apr 22, 2018 at 01:26:10PM -0700, Greg Thelen wrote: > > > Roman's previously posted memory.low,min patches add per memcg effective > > > low limit to detect overcommitment of parental limits. But if we flip > > > low,min reclaim to bail if usage<{low,min} at any level, then we don't > > > need an effective low limit, which makes the code simpler. When parent > > > limits are overcommited memory.min will oom kill, which is more drastic but > > > makes the memory.low a simpler concept. If memcg a/b wants oom kill before > > > reclaim, then give it to them. It seems a bit strange for a/b/memory.low's > > > behaviour to depend on a/c/memory.low (i.e. a/b.low is strong unless > > > a/b.low+a/c.low exceed a.low). > > > It's actually not strange: a/b and a/c are sharing a common resource: > > a/memory.low. > > > Exactly as a/b/memory.max and a/c/memory.max are sharing a/memory.max. > > If there are sibling cgroups which are consuming memory, a cgroup can't > > exceed parent's memory.max, even if its memory.max is grater. > > > > > > > I think there might be a simpler way (ableit it doesn't yet include > > > Documentation): > > > - memcg: fix memory.low > > > - memcg: add memory.min > > > 3 files changed, 75 insertions(+), 6 deletions(-) > > > > > > The idea of this alternate approach is for memory.low,min to avoid > reclaim > > > if any portion of under-consideration memcg ancestry is under respective > > > limit. > > > This approach has a significant downside: it breaks hierarchical > constraints > > for memory.low/min. There are two important outcomes: > > > 1) Any leaf's memory.low/min value is respected, even if parent's value > > is lower or even 0. It's not possible anymore to limit the amount > of > > protected memory for a sub-tree. > > This is especially bad in case of delegation. > > As someone who has been using something like memory.min for a while, I have > cases where it needs to be a strong protection. Such jobs prefer oom kill > to reclaim. These jobs know they need X MB of memory. But I guess it's on > me to avoid configuring machines which overcommit memory.min at such cgroup > levels all the way to the root. Absolutely. > > > 2) If a cgroup has an ancestor with the usage under its memory.low/min, > > it becomes protection, even if its memory.low/min is 0. So it > becomes > > impossible to have unprotected cgroups in protected sub-tree. > > Fair point. > > One use case is where a non trivial job which has several memory accounting > subcontainers. Is there a way to only set memory.low at the top and have > the offer protection to the job? > The case I'm thinking of is: > % cd /cgroup > % echo +memory > cgroup.subtree_control > % mkdir top > % echo +memory > top/cgroup.subtree_control > % mkdir top/part1 top/part2 > % echo 1GB > top/memory.min > % (echo $BASHPID > top/part1/cgroup.procs && part1) > % (echo $BASHPID > top/part2/cgroup.procs && part2) > > Empirically it's been measured that the entire workload (/top) needs 1GB to > perform well. But we don't care how the memory is distributed between > part1,part2. Is the strategy for that to set /top, /top/part1.min, and > /top/part2.min to 1GB? The problem is that right now we don't have an "undefined" value for memory.min/low. The default value is 0, which means "no protection". So there is no way how a user can express "whatever parent cgroup wants". It might be useful to introduce such value, as other controllers may benefit too. But it's a separate theme to discuss. In your example, it's possible to achieve the requested behavior by setting top.min into 1G and part1.min and part2.min into "max". > > What do you think about exposing emin and elow to user space? I think that > would reduce admin/user confusion in situations where memory.min is > internally discounted. They might be useful in some cases (e.g. a cgroup want's to know how much actual protection it can get), but at the same time these values are intentionally racy and don't have a clear semantics. So, maybe we can show them in memory.stat, but I doubt that they deserve a separate interface file. > > (tangent) Delegation in v2 isn't something I've been able to fully > internalize yet. > The "no interior processes" rule challenges my notion of subdelegation. > My current model is where a system controller creates a container C with > C.min and then starts client manager process M in C. Then M can choose > to further divide C's resources (e.g. C/S). This doesn't seem possible > because v2 doesn't allow for interior processes. So the system manager > would need to create C, set C.low, create C/sub_manager, create > C/sub_resources, set C/sub_manager.low, set C/sub_resources.low, then start > M in C/sub_manager. Then sub_manager can create and manage > C/sub_resources/S. And this is a good example of a case, when some cgroups in the tree should be protected to work properly (for example, C/sub_manager/memory.low = 128M), while an actual workload might be not (C/sub_resources/memory.low = 0). Thanks!