Received: by 10.192.165.148 with SMTP id m20csp3265244imm; Mon, 23 Apr 2018 03:40:35 -0700 (PDT) X-Google-Smtp-Source: AIpwx48uLNJ2HkDppPu/TDzo4ILpBeTkwyTX2XdK0At6YdlPB4ctBFo/5BqDN7r4kmXwcngUD4dm X-Received: by 10.99.105.195 with SMTP id e186mr6869794pgc.353.1524480035226; Mon, 23 Apr 2018 03:40:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524480035; cv=none; d=google.com; s=arc-20160816; b=palkWvYfxvrBb0pkIyMInxs72cuXgV/zDl0cC1jOeunP7aEdKO88SpTfU0ANhlDSF1 lnwrUOFS5ns/52Xp7pOV1WmKoowbwuIqMsQ9xs1mC9LLZOkLf1h4UYCu+6GqU/6JPWc3 aRtrJeYd8VoPcz4p9i8rLyc045JezFqDmCFonjrGBy7SeLwF0DXWN+C+0WdgDXf7g2Lv qFhty7n1x6LynpNM/kzvebCYGaH+v5+XhmK+XK5Eny2kA4I4K80dyvkapDtmmj9pTzNm 6itUpcxBZQQvxRevmwlMz5g7EWoSaWs12D13rZNjoIbb5CldwtSeGtkNB/ZgwFzrbARm DkWQ== 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=uo/T7MGC6UOejKfnT6X/Yk2QNZg/2HstxKjwdUvVyxA=; b=xjr22J6s9vkn3be0f6AfU4inmCfNV6kUQ9y/xCw4yUTTL5PE0sISTCD4Prc60JWdIt ZAFXNNAO+epVKnjv3iW+lc173XrTdDULExCI9XAoqOiOdKpZUmrKDxMJEMTf04rF8EV5 BS1PixFBYju5EP7L+MzxVFQM70G6OQIbvEPqw/qRV+9jQG8/snUzsURT36j8K5KF4/Z2 dwPbgLN9WGVYvJYaZFQWtadaD+FE11jkdkHRW8MHfUrfvIpZGAqJSi3DTOdxKIOtqHxP p9+Z1x1lBByH54RcIwSDPm6Zo69SLxvVXioofH/fTKGkWe/BX7P3U70OmR+PjDnL7MaD zdvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=UtWjBaj9; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=ItLJG2uR; 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 p26-v6si11483044pli.35.2018.04.23.03.40.21; Mon, 23 Apr 2018 03:40:35 -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=UtWjBaj9; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=ItLJG2uR; 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 S1754763AbeDWKix (ORCPT + 99 others); Mon, 23 Apr 2018 06:38:53 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:55876 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754597AbeDWKiu (ORCPT ); Mon, 23 Apr 2018 06:38:50 -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 w3NAcbii012236; Mon, 23 Apr 2018 03:38:37 -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=uo/T7MGC6UOejKfnT6X/Yk2QNZg/2HstxKjwdUvVyxA=; b=UtWjBaj9SJbkufYCPPjGKUt/NYmbfFpHKwX4FFu+78lD1/EO5xnzdN0FaIihuKdc7ZIp E41kiIgmVVXomUM3ZvLCBTAbHK80Yj3Yt5zK4NWBMrha/OmPiukmaQlmDLlxhJ2OqGpm BGANOUTYxrKf0PiZ6T+9W7U51byVRZ2TBdw= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2hhc5qg6h2-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 23 Apr 2018 03:38:37 -0700 Received: from NAM01-BN3-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.11) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 23 Apr 2018 03:38:29 -0700 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=uo/T7MGC6UOejKfnT6X/Yk2QNZg/2HstxKjwdUvVyxA=; b=ItLJG2uR7LHC1PY2mnrHNJermMPLbEf1wXaO1Ph7tzRsU6Zw0i+OMSypDDmjUvhwjqWnvsKhcpnnb25CIN+3PZ7C7+e9673pRwbqHoWnjTsNbnwLOFw+MkSBTk9NJOkAJi8vKsvNG6tk1QaK8s5TqYzcGdP5hfKEJGlTsudNdpo= Received: from castle.DHCP.thefacebook.com (2620:10d:c092:200::1:4fc2) 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; Mon, 23 Apr 2018 10:38:21 +0000 Date: Mon, 23 Apr 2018 11:38:10 +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: <20180423103804.GA12648@castle.DHCP.thefacebook.com> References: <20180320223353.5673-1-guro@fb.com> <20180422202612.127760-1-gthelen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20180422202612.127760-1-gthelen@google.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-Originating-IP: [2620:10d:c092:200::1:4fc2] X-ClientProxiedBy: DB6PR07CA0093.eurprd07.prod.outlook.com (2603:10a6:6:2b::31) 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:Hfy1x50zNkV74OmUi0JgN8Ct65tyhlOD/WQyAqDftWK2wiPFpu2skw7BD5xbtJx+3R0JnwkeZdmEBfGlqwI4eti93eF6yA2TT+vYitECtrsIe9KFaCKTIZVmUobzGLhzVT2nXNprCMowLmHUCTyr7WId1musHAW8v2BvQ22vfGTJxurOP/kWqv8OCsSwLaLfZzrqNJfzDs3JIszAJqvvcdzz4Kf9zDGJMVMjUnM5BfWedjCZHbV3LgMsGq4LIAr6;25:AYI+8jHfqX4QQ6fzI++plhDLfXeFEKSl3I9YHMwOQDgETxCI2JSWTuaiLyreFD9QFAf7lAzuethZx3AbeXteZPbKJbT3/66A48MbSLnpu1bDcC3JISP4KjGgTkn55EW6Ov7y4J4SvKHqnc5won7299AUpKyTrXEFMDmhul6gJjeZ1BLgVnT1u6GpnR6WcDrTi2C62FZwB0vy7T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XA89XF6fO3nujQRJc6AlwvI1zfLCgVKYUPUxfevBgK4aa8Z5SzCVRnRdusphrQIVfPFGu8MuJF4xc06FdxZtQZP19/okOnAp/yVgLLtGztFMD/snrZqjxSd0hdahJSQkylLkCOAsHDqMza1vxe95to9Pke9bQXt1enKy7Zk9jLgYCYTIhxLlXA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231232)(11241501184)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123562045)(6072148)(201708071742011);SRVR:BL2PR15MB1073;BCL:0;PCL:0;RULEID:;SRVR:BL2PR15MB1073; X-Forefront-PRVS: 06515DA04B X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(366004)(376002)(39380400002)(39860400002)(346002)(396003)(386003)(6506007)(6916009)(39060400002)(6666003)(59450400001)(86362001)(76176011)(52396003)(25786009)(2906002)(53936002)(50466002)(52116002)(229853002)(7696005)(478600001)(55016002)(33656002)(47776003)(9686003)(6246003)(8676002)(81166006)(8936002)(11346002)(446003)(476003)(54906003)(6116002)(316002)(58126008)(16586007)(46003)(1076002)(186003)(16526019)(23726003)(305945005)(4326008)(7736002)(5660300001)(18370500001)(142933001)(217873001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:BL2PR15MB1073;H:castle.DHCP.thefacebook.com;FPR:;SPF:None;LANG:en;MLV:ovrnspm;PTR:InfoNoRecords; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BL2PR15MB1073;23:2HwovyU8VnEjbV7a5c7meEdvHEulewdD1DuNIsmd/?= =?us-ascii?Q?C1g0Y9h9LCq4FLYEaSBHinsEQqLXAqXItgcctZ55eK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ri5cDPbV8Cp+GVcXV9TRx4B1ZnHdtkWhoAZhKYgSq+EIouTdaeF4l1oE4QDVdjbsBufzT0RXZTwYu0PHYWYd4XS1becuSbJCB+VOGi8MPwql1Oy+cD8waUFOdoa5DHMshFvHWcahw=;24:IPfjraDj9//hWtC0HPKf+UxcQ/4H7g6/TiHxnLxnnsK4cUajZgbJzyzATu+rW9I1jLsTYqx0a7UEL+O11Leo4Z4HkANqLqm03CrKtfGZFaA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BL2PR15MB1073;7:/9hIQZyDkcFPQGZW8BQ74qot/ClOSDEe5ffNziVqkKR0GHqCOqV2EGUC2dMkMpi1MmXRjIsJfjCCR5gqm36534zHXc0r2PMi3RBMDPu3WT0unZxr+ilos4iUjA4KVu+d+DJfXJ3V83FkIPk6T4PrkamO86FUIA7iZls8q4WNsQoA1fm1RuIsh7Mhz5QXqUq9sZdAHJyIfmpxBNsnXT9s9t+GAkeHg47F2Jcvaiw2YXaka1FoVYKCp4ZmzDwEWZF/;20:oyebSyDs4HkjML3yI6W+idvMLo2PHcTXws7wt2EIxnO4/LvLVKn9Y6uXQr9JNscOgf8tguKYPQBX7gjrkcuDExvJrDNkx8BSy0d+L6yT84BpogsdYt8mGKDq2FUq8BYlrx8bF8pT9uUrIwJB6R751UXzKi+Ki+JwsQoPu1pZb8M= X-MS-Office365-Filtering-Correlation-Id: 4dfe8246-7a0b-47a4-2531-08d5a906564c X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2018 10:38:21.0789 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4dfe8246-7a0b-47a4-2531-08d5a906564c 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-23_05:,, 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 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. 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. Thanks!