From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751880AbdIOVIf (ORCPT ); Fri, 15 Sep 2017 17:08:35 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:57057 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751605AbdIOVIb (ORCPT ); Fri, 15 Sep 2017 17:08:31 -0400 Date: Fri, 15 Sep 2017 14:08:07 -0700 From: Roman Gushchin To: David Rientjes CC: Michal Hocko , , Vladimir Davydov , Johannes Weiner , Tetsuo Handa , Andrew Morton , Tejun Heo , , , , Subject: Re: [v8 0/4] cgroup-aware OOM killer Message-ID: <20170915210807.GA5238@castle> References: <20170911131742.16482-1-guro@fb.com> <20170913122914.5gdksbmkolum7ita@dhcp22.suse.cz> <20170913215607.GA19259@castle> <20170914134014.wqemev2kgychv7m5@dhcp22.suse.cz> <20170914160548.GA30441@castle> <20170915105826.hq5afcu2ij7hevb4@dhcp22.suse.cz> <20170915152301.GA29379@castle> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) X-Originating-IP: [2620:10d:c090:180::1:17e4] X-ClientProxiedBy: DM5PR19CA0039.namprd19.prod.outlook.com (2603:10b6:3:9a::25) To CO1PR15MB1077.namprd15.prod.outlook.com (2a01:111:e400:7b66::7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a5fbb277-1d64-492e-ee65-08d4fc7de1b0 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CO1PR15MB1077; X-Microsoft-Exchange-Diagnostics: 1;CO1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4CVW5ZGPoHa0eeXOxox0c3UTQ9TH2gsKM8cUIDHyVwl/U2aEMMsiZoWCSW+MxfQ3SrcZ7VS9ZC5d8TrQBxXrSjaj+L1UyqJ4pB5TVO4nD6r6ZAfK3fzxIXPlgHRKHqKK/mKvCEJZJw5R7ik4fQNOers2cwge010uiU+hnkAxvsyexq0X+scucGirFxAxEPpsBh255UoIIFAGSuWNpxNFvxgAWAFgQmayGCxkYA7VgmW1uRBG+CksW6T8r4kL0AkJKHCKBiIgxNI5SKmtKNl9VzFa4RHCI+qlYgYILiYo77b3hucQomVlnCNXBvFXtDTHcRBfpLMWqelhwKMLIDiF1sFZ4+Pod0;4:0+SKoj0NVQ/mW7uZMdjvefCQOLDri4GHNcApcUL/6mo55+6WwVw8Q0HxcrCY6OcfvcfRe1zHu1KNnwR9gATYDztpU61Kf+o9T6CrgMEWK3gdIwMLmsAKWwEsGIAHgBt1sar1Hv6l50MIX8ZejUhCZ6/uEucqMG61u9g7lv/0urWnMDkk8X/IWnu7CIg7A9jUqN7gZa7b8276Ne8H2auIK6WZZTsNsfDQvU0HF2FvjL//1Nym7soNA9J8J2OrRXYe X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123562025)(20161123564025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CO1PR15MB1077;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CO1PR15MB1077; X-Forefront-PRVS: 0431F981D8 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(346002)(376002)(24454002)(199003)(189002)(8676002)(189998001)(68736007)(6666003)(2906002)(50466002)(39060400002)(7416002)(81166006)(81156014)(86362001)(6496005)(97736004)(8936002)(305945005)(53936002)(101416001)(110136004)(7736002)(47776003)(25786009)(478600001)(106356001)(229853002)(6246003)(54356999)(54906002)(50986999)(76176999)(9686003)(4326008)(16586007)(93886005)(33656002)(316002)(55016002)(2950100002)(1076002)(6916009)(6116002)(23726003)(33716001)(105586002)(58126008)(83506001)(5660300001)(18370500001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:CO1PR15MB1077;H:castle;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CO1PR15MB1077;23:ocW0jP1fZz2KCvF1pUHwVxd8ykX1d+wBEJWly/PfI?= =?us-ascii?Q?6A7eLoxKZwRjTXh+drZ9IVifxsOLeuz8kkwvbAEdEkGhZioj4qzcSUcL6u5n?= =?us-ascii?Q?daBxhAqIuszQt9S76eUe7eQ4qMOgS/4h8zEoe7xz4UprLeaH77GnP0u/5342?= =?us-ascii?Q?2FqiIrE7BidNi4upf7VhB5lw5TKxxS1PE6hmm9xV0FmV+2VKnGKCU2Pnp6NE?= =?us-ascii?Q?EFVpchrkLzjXbIhhzep9lM0U/Wk4syZuZhBx9O3eXyXFkaPBGxF1RkGyggRT?= =?us-ascii?Q?39T+tdJsOYn3mFqQHRUJ7c1j1w285CIVfgR/3iin31ztvJoP0Yw4wrlEdMrA?= =?us-ascii?Q?D5rbp5ZPyhimeuChL0YDjxg9dMuYfMnMYqYahqesgHkwY9PsRV6mLO5N5enZ?= =?us-ascii?Q?ZQrtddhImP8Tb6/MJkAUWbx9/oGr9JsTlPIjiFKfKysZJRBYgUeOZ//qJAEP?= =?us-ascii?Q?YOBuyr0bl4jwQ0wIJev6ENAPHGV+yoeL4SMYG4c79bpcRwe/NL/gkleMoLFz?= =?us-ascii?Q?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Zm4QGV1DLuxCqEL8bkrlWEtLhn9mMwEXQmAXXtB8m4l5xSPGZSCjxGMKjMalJxKG95sRxWt1nzme7C5irDbPjRG1eXsnnyk1kTX3CQ4+z8UkpAW1RNwWxcObYlhrU/3BtIq6MsmOCNN3IK1nTq9tooX4/r2spsukYzgrhaJkMqdsqr7E25srRXZ4zX4MWJM/YFTr9Cc55uXzkdw==;5:pO0cxqck6WeApMH2mAhtbzGjFc4/awXNSdUU2Cw8mUWlUauu3QGv/8xpHFDPU6au2bBOUtwAF8EuX90RuEjVkVN3IFMxVBx4v10Ekx/m/V0s7xnFTa08/oBdcxdR/GH0n5hQpBsfIotm2dRawjF6Fg==;24:fU3c5SuvFDBr97/k37oCAV+BSyDrsU9CNu8DHItRtWzhhtmlBtdj2bJbXNTog27t1uuKgBGbhDe85Sii0w76vA5m35RkQmOVf0d+VooPIwo=;7:eqzHR8srMcN7fmy2VIyZIw6eJXaUKZ4T2HkxogmI2u+a6C5JFUV8DWvBO04GuOxP2v7NclS9MU/QK3XCDr1aJ/P2k2MHG7v2/hTfQAhhHjXqNnS0uF2QWSH+3vDXu4n595fVx75L5C+CYm516nOlcS1+Y205K4uMlKMEI6PcLEGVMdCi1tXO+bJwc2PHi+7oJReIK2jiZkSyIkuUGeIl3bFD/qNEma8091D+J0G+3CA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CO1PR15MB1077;20:Tdsk1N74+Y9QRVkqgQEshPl+mQYguRJkcrlCADZOzaondsMVerY9+SeNFodgpwjmdAK1soFTHh3PMBBHK5XixEoGxMd5e8KK20TFnqZFG6rhQfGG83AflT5h/1JNXjUq33Nyo9B4KF6degck6vAct1LriloTJuU4DH5op+O2m9o= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2017 21:08:11.8193 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR15MB1077 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-09-15_08:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 15, 2017 at 12:55:55PM -0700, David Rientjes wrote: > On Fri, 15 Sep 2017, Roman Gushchin wrote: > > > > But then you just enforce a structural restriction on your configuration > > > because > > > root > > > / \ > > > A D > > > /\ > > > B C > > > > > > is a different thing than > > > root > > > / | \ > > > B C D > > > > > > > I actually don't have a strong argument against an approach to select > > largest leaf or kill-all-set memcg. I think, in practice there will be > > no much difference. > > > > The only real concern I have is that then we have to do the same with > > oom_priorities (select largest priority tree-wide), and this will limit > > an ability to enforce the priority by parent cgroup. > > > > Yes, oom_priority cannot select the largest priority tree-wide for exactly > that reason. We need the ability to control from which subtree the kill > occurs in ancestor cgroups. If multiple jobs are allocated their own > cgroups and they can own memory.oom_priority for their own subcontainers, > this becomes quite powerful so they can define their own oom priorities. > Otherwise, they can easily override the oom priorities of other cgroups. I believe, it's a solvable problem: we can require CAP_SYS_RESOURCE to set the oom_priority below parent's value, or something like this. But it looks more complex, and I'm not sure there are real examples, when we have to compare memcgs, which are on different levels (or in different subtrees). In any case, oom_priorities and size-based comparison should share the same tree-walking policy. And I still would prefer comparing sizes and priorities independently on each level. Thanks! From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roman Gushchin Subject: Re: [v8 0/4] cgroup-aware OOM killer Date: Fri, 15 Sep 2017 14:08:07 -0700 Message-ID: <20170915210807.GA5238@castle> References: <20170911131742.16482-1-guro@fb.com> <20170913122914.5gdksbmkolum7ita@dhcp22.suse.cz> <20170913215607.GA19259@castle> <20170914134014.wqemev2kgychv7m5@dhcp22.suse.cz> <20170914160548.GA30441@castle> <20170915105826.hq5afcu2ij7hevb4@dhcp22.suse.cz> <20170915152301.GA29379@castle> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-path: 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=DfhnDceX/hhnnWl5cdD8xIprpirhUMhznXU4GF3qVc0=; b=DXAat6VVIqr5up6rzIyxtCyybIbUIgskxl0k+0LWknsmHgpLE3dXoumL/pFJK+vNfwgT +eEebIncJ4RY6sBB7xQ4IGCpBWz51TSfmGGgk+7C6veWv4in53hJYUJnX6SgNHUpsGLL /E6cgY2hinBPHwcTTO/Ra7J8+ksfN3OGzeo= 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=DfhnDceX/hhnnWl5cdD8xIprpirhUMhznXU4GF3qVc0=; b=SG7nOvdtWDW6tATDrsFqBUvXYUTORAAHRHZvnm0mxIM8OWWDNfI8KVxW4wyhO5rmYCvHeFO0u5FE6Swnnl6ngMVtav48YOgYwO1AJ24ezUVI/vztxRXYtvvojpDV5K506BpXg6Dke0iZZq1B78y7MOY5pRi3+vvNp9a2sqVgMQ8= Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: Content-Transfer-Encoding: 7bit To: David Rientjes Cc: Michal Hocko , linux-mm@kvack.org, Vladimir Davydov , Johannes Weiner , Tetsuo Handa , Andrew Morton , Tejun Heo , kernel-team@fb.com, cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org On Fri, Sep 15, 2017 at 12:55:55PM -0700, David Rientjes wrote: > On Fri, 15 Sep 2017, Roman Gushchin wrote: > > > > But then you just enforce a structural restriction on your configuration > > > because > > > root > > > / \ > > > A D > > > /\ > > > B C > > > > > > is a different thing than > > > root > > > / | \ > > > B C D > > > > > > > I actually don't have a strong argument against an approach to select > > largest leaf or kill-all-set memcg. I think, in practice there will be > > no much difference. > > > > The only real concern I have is that then we have to do the same with > > oom_priorities (select largest priority tree-wide), and this will limit > > an ability to enforce the priority by parent cgroup. > > > > Yes, oom_priority cannot select the largest priority tree-wide for exactly > that reason. We need the ability to control from which subtree the kill > occurs in ancestor cgroups. If multiple jobs are allocated their own > cgroups and they can own memory.oom_priority for their own subcontainers, > this becomes quite powerful so they can define their own oom priorities. > Otherwise, they can easily override the oom priorities of other cgroups. I believe, it's a solvable problem: we can require CAP_SYS_RESOURCE to set the oom_priority below parent's value, or something like this. But it looks more complex, and I'm not sure there are real examples, when we have to compare memcgs, which are on different levels (or in different subtrees). In any case, oom_priorities and size-based comparison should share the same tree-walking policy. And I still would prefer comparing sizes and priorities independently on each level. Thanks! -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org