From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 591BDC43603 for ; Fri, 20 Dec 2019 04:06:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0ABC124676 for ; Fri, 20 Dec 2019 04:06:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=fb.com header.i=@fb.com header.b="GPmOI/HW"; dkim=pass (1024-bit key) header.d=fb.onmicrosoft.com header.i=@fb.onmicrosoft.com header.b="ZABfVH0t" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0ABC124676 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=fb.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 847FF8E018A; Thu, 19 Dec 2019 23:06:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7F7378E0184; Thu, 19 Dec 2019 23:06:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6BF8E8E018A; Thu, 19 Dec 2019 23:06:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0110.hostedemail.com [216.40.44.110]) by kanga.kvack.org (Postfix) with ESMTP id 5214B8E0184 for ; Thu, 19 Dec 2019 23:06:31 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id E5DA58249980 for ; Fri, 20 Dec 2019 04:06:30 +0000 (UTC) X-FDA: 76284182940.22.grade72_72f6cb8d56b51 X-HE-Tag: grade72_72f6cb8d56b51 X-Filterd-Recvd-Size: 9955 Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Fri, 20 Dec 2019 04:06:29 +0000 (UTC) Received: from pps.filterd (m0044012.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xBK41xgY014204; Thu, 19 Dec 2019 20:06:27 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=facebook; bh=Sn8mdDEZbmlAseTcnBwC4N9LFeeFcWpfGwn1PGVmyY8=; b=GPmOI/HWcKnxg7HnTO1FwOjg0Q7Cy8Zm+Q5z1xLXncu66dTMEVGL1LwUJkfg60PWdYam tJOL+C7zdoAIjA8vRDBQI07uIRL5/Hj+G7K6vb83qp4cyZKuxOfR0lCtcOSi/Vp/M/KI YfXmpNSua/RGYvodwUd+ifVPcdAE5d5zQ0g= Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com with ESMTP id 2x01dfwrya-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 19 Dec 2019 20:06:26 -0800 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (100.104.98.9) by o365-in.thefacebook.com (100.104.94.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1779.2; Thu, 19 Dec 2019 20:06:26 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n5qTSKMZTbSJsqzJxPnGwyVjCvUVXrJtYSp/+MVRoZzSdegCFvBwMw+BO4BIjsh6Iod5u7Qg8naFjlL6lxvtU1Ld88+BAmARopwn2lgeFEIrLYV/b/3YIK7/DdBt7DBoCKAvbEjt1kyIlYdscsW6a96MGFZcCXkysLJ1kzFSb05VFRmX5jPHrUIrPD8VnOoHc3ihNNv78xSCv19+sSpUGGQOMwYhnHyriX+ICNQvf13/lIBVLgqrOnBjqHkRtfoYEBalVMH3luo7kxlIVuzfVWz4vKBvn3Xv8Rdn6AlK9FtC/rr0CMyXWcSVLxpvr0rCRdjzl/fRuEfFjMnUate7fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Sn8mdDEZbmlAseTcnBwC4N9LFeeFcWpfGwn1PGVmyY8=; b=AtcFvnmxiqmIAQhKoW+Y6603RyMGSP0cux8w4ysapvV/YbuYX3hZHSvWw3J9kR0y9RX+MVJJFngSNG00g6MH5+CZpYLf0//CSW1dDlgr/vAFfcGDXZzJKD13ltvBTfDiWGbhZ6FU5qW363R2QGo4d6XURBTjBCMoAcnuvqHALRMRkKodd+X35i1dO6gR6Hl3yCjrenaIXPBhuMQUhExbLoaHcyTuidWgCAM823f3ULodw8Yj8vjCN6yV4BmJB1SqUWzfD+8AACHauF5ZZkD/UJfQG8w1bvRYySI7U88ZBsoEZZgl/rpQDWrl2CrFUZtXv+bWbRdpV146rAQHI5VdzQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=fb.com; dmarc=pass action=none header.from=fb.com; dkim=pass header.d=fb.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector2-fb-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Sn8mdDEZbmlAseTcnBwC4N9LFeeFcWpfGwn1PGVmyY8=; b=ZABfVH0t5DzZpNrVRqKHif4o/rRO+S4OE71/DkDPLJ5+TcVeIdwpe9jDAH//9HKT9oqlBk2xW951mjogBqimcQ8Xor6JJcurRn21Kgryoy32yuYHZocL6GjYiq2oqi4FN7C5tPWLBTTR+g/hBSlwl8UvmhG1FpU27gBfanBzzsY= Received: from BYAPR15MB2631.namprd15.prod.outlook.com (20.179.155.147) by BYAPR15MB2807.namprd15.prod.outlook.com (20.179.158.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.15; Fri, 20 Dec 2019 04:06:23 +0000 Received: from BYAPR15MB2631.namprd15.prod.outlook.com ([fe80::8cc8:bdb1:a9c7:7f60]) by BYAPR15MB2631.namprd15.prod.outlook.com ([fe80::8cc8:bdb1:a9c7:7f60%3]) with mapi id 15.20.2559.012; Fri, 20 Dec 2019 04:06:23 +0000 Received: from localhost.localdomain (2620:10d:c090:180::c7de) by MW2PR2101CA0012.namprd21.prod.outlook.com (2603:10b6:302:1::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2581.2 via Frontend Transport; Fri, 20 Dec 2019 04:06:21 +0000 From: Roman Gushchin To: Johannes Weiner CC: Andrew Morton , Michal Hocko , Tejun Heo , "linux-mm@kvack.org" , "cgroups@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Kernel Team Subject: Re: [PATCH v2 0/3] mm: memcontrol: recursive memory protection Thread-Topic: [PATCH v2 0/3] mm: memcontrol: recursive memory protection Thread-Index: AQHVtqfzhe/2CaI+GUqL7UNG9lFOkafCaFgA Date: Fri, 20 Dec 2019 04:06:22 +0000 Message-ID: <20191220040618.GA8069@localhost.localdomain> References: <20191219200718.15696-1-hannes@cmpxchg.org> In-Reply-To: <20191219200718.15696-1-hannes@cmpxchg.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MW2PR2101CA0012.namprd21.prod.outlook.com (2603:10b6:302:1::25) To BYAPR15MB2631.namprd15.prod.outlook.com (2603:10b6:a03:150::19) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2620:10d:c090:180::c7de] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0ae1820e-4494-4638-9511-08d78501f9ae x-ms-traffictypediagnostic: BYAPR15MB2807: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 025796F161 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(136003)(39860400002)(346002)(396003)(366004)(54534003)(189003)(199004)(1076003)(316002)(6506007)(4326008)(69590400006)(86362001)(33656002)(8936002)(5660300002)(186003)(6916009)(52116002)(16526019)(81166006)(81156014)(71200400001)(9686003)(8676002)(7696005)(66556008)(54906003)(66476007)(55016002)(66946007)(478600001)(66446008)(2906002)(64756008);DIR:OUT;SFP:1102;SCL:1;SRVR:BYAPR15MB2807;H:BYAPR15MB2631.namprd15.prod.outlook.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-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 525pGNGKqI28trkpoZDwyqhlaKSvDfSQDMziNBvuwQkzYTCXjOoNHvOtnbo/ZpTe7L80gJVD2w8lMzG0fYetKIRyt7zCZjKE3dWGTPt7YBEWHCy7bDwRgHnPeM2ojg50+6vja31Zb9iTd34hPCtJFGZ0ePsmwbfSKC3OvkbGql5K3eGTb4RxWDgHmdtnyUauFxof01xv15xnQOpO91QcsTuW7kp5OMBrSdp/lRj50jQRL9nGH7bINQU8eBvBbGQzpNs6+dE3FPLNPUGWQgMWnQmawlzU/zdTDhUFFQC2niEot4dFxfAVBi4k21WpqLyxW++5witEro7YSiCOzxOeXLOxzaTg9ZVc6hAjkx7PY0ITItyPvpoWBEJW3iWZr84RlTLYNIv9bm0BsgI+eNFWOWjWyULThJmK21MszFZ/0T62hbCTzbufnk+CzqStRz5aHTwSCcjQCCUhTde8B1JvWYqJ1PXu0ZenKTApGC4BhP3ifWIgk1sFXFw9DG4DSMFF3q7BYnY4keCyIPsrkt6DnQ== Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 0ae1820e-4494-4638-9511-08d78501f9ae X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Dec 2019 04:06:23.3240 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: IJeVPCWan4t5c1mIg8EftgS/tNEzc8frxNCito/fLPAhmc/RTKkkXezBo2CEtn85 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR15MB2807 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-12-19_08:2019-12-17,2019-12-19 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 mlxscore=0 phishscore=0 spamscore=0 adultscore=0 impostorscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 clxscore=1011 bulkscore=0 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1912200028 X-FB-Internal: deliver X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Dec 19, 2019 at 03:07:15PM -0500, Johannes Weiner wrote: > Changes since v1: > - improved Changelogs based on the discussion with Roman. Thanks! > - fix div0 when recursive & fixed protection is combined > - fix an unused compiler warning >=20 > The current memory.low (and memory.min) semantics require protection > to be assigned to a cgroup in an untinterrupted chain from the > top-level cgroup all the way to the leaf. >=20 > In practice, we want to protect entire cgroup subtrees from each other > (system management software vs. workload), but we would like the VM to > balance memory optimally *within* each subtree, without having to make > explicit weight allocations among individual components. The current > semantics make that impossible. >=20 > This patch series extends memory.low/min such that the knobs apply > recursively to the entire subtree. Users can still assign explicit > protection to subgroups, but if they don't, the protection set by the > parent cgroup will be distributed dynamically such that children > compete freely - as if no memory control were enabled inside the > subtree - but enjoy protection from neighboring trees. >=20 > Patch #1 fixes an existing bug that can give a cgroup tree more > protection than it should receive as per ancestor configuration. >=20 > Patch #2 simplifies and documents the existing code to make it easier > to reason about the changes in the next patch. >=20 > Patch #3 finally implements recursive memory protection semantics. >=20 > Because of a risk of regressing legacy setups, the new semantics are > hidden behind a cgroup2 mount option, 'memory_recursiveprot'. I really like the new semantics: it looks nice and doesn't require any new magic values aka "bypass", which have been discussed previously. The ability to disable the protection for a particular cgroup inside the protected sub-tree looks overvalued: I don't have any practical example when it makes any sense. So it's totally worth it to sacrifice it. Thank you for adding comments to the changelog! Acked-by: Roman Gushchin for the series. Thanks!