Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751965AbdIKMuu (ORCPT ); Mon, 11 Sep 2017 08:50:50 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:40964 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751668AbdIKMur (ORCPT ); Mon, 11 Sep 2017 08:50:47 -0400 Date: Mon, 11 Sep 2017 13:50:08 +0100 From: Roman Gushchin To: Michal Hocko CC: Johannes Weiner , , Vladimir Davydov , Tetsuo Handa , David Rientjes , Andrew Morton , Tejun Heo , , , , Subject: Re: [v7 5/5] mm, oom: cgroup v2 mount option to disable cgroup-aware OOM killer Message-ID: <20170911125008.GA4340@castle> References: <20170904142108.7165-1-guro@fb.com> <20170904142108.7165-6-guro@fb.com> <20170905134412.qdvqcfhvbdzmarna@dhcp22.suse.cz> <20170905215344.GA27427@cmpxchg.org> <20170906082859.qlqenftxuib64j35@dhcp22.suse.cz> <20170907161457.GA1728@cmpxchg.org> <20170911090559.aknbuyqumsc2gm5j@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20170911090559.aknbuyqumsc2gm5j@dhcp22.suse.cz> User-Agent: Mutt/1.8.3 (2017-05-23) X-Originating-IP: [2620:10d:c092:180::1:1d2d] X-ClientProxiedBy: VI1PR07CA0141.eurprd07.prod.outlook.com (2603:10a6:802:16::28) To DM3PR15MB1081.namprd15.prod.outlook.com (2603:10b6:0:12::7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4683836b-ba2e-4f13-ae97-08d4f913acd2 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);SR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YP5Uuqm47yz0E9rHEUWYiWMdofjLC7dKUitaJ05c+ceKe4fjXcFJZYVMbiNLCj8XMgnwsQEBFn2VRhFYIFkPsPvcys1TTFOV6tGvSGaAh7blzv7uo/GIjd/4zs5pLIQD6F3xBGbCu+0x88jE90uOG453+eM8Nl6ZSvzZJVP6RLQkCT25pgd2tAHCDm6sw8YVpYCTPpbAlR59YJlo9YxjUxmpMsYJJHVmY6WB9lvwSKSfbrAAmSMsM9+EWz4zxSVMRsnWEANPmzEHz13lWnJI4RCopCq4eFYzXcKyiYKc3rfJiBRt1xNJKUiQGRBOPVNpn0kChLBEhrQBQ1pNJ1pcq78FbKuZVZQ0MnwnVeQP+wAHc4LUQeq+DCtpUEfEpkUZ7hNBF0R0cASnGFAih;4:ba2HUJSzj+c2PqUwAFYoMEPH+PfwNE92RO7LcRn/OxsFhHXYtP4sT2N0l4/YU8rgXDP5Xe7faOaaESvCnWnAie8dY7aR2t4qL80NNKZ7YRIBlW653fobD9CCzZ2EayctKjYMK7Y87pZHmDqTr4IvWP4fXaUKq3zZYpkWZxt/Kv/P2wh7F93h63/2VZD3cN4eoHQ7kmVCNJcjikm79WLAze0+wlSdoj0JMCK2cr+ugjB0+bqN7YmRS3J4SB24uYXh 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)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6041248)(20161123562025)(20161123564025)(20161123555025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DM3PR15MB1081;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DM3PR15MB1081; X-Forefront-PRVS: 04270EF89C X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(199003)(377424004)(189002)(24454002)(478600001)(110136004)(86362001)(33716001)(8936002)(5660300001)(6246003)(229853002)(39060400002)(4326008)(8676002)(25786009)(6496005)(47776003)(53936002)(305945005)(7736002)(83506001)(9686003)(54356999)(23726003)(54906002)(50986999)(76176999)(93886005)(4001350100001)(101416001)(55016002)(6116002)(1076002)(33656002)(2950100002)(42186005)(189998001)(68736007)(6916009)(7416002)(97736004)(81166006)(105586002)(50466002)(2906002)(6666003)(106356001)(81156014)(18370500001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM3PR15MB1081;H:castle;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM3PR15MB1081;23:/BBd9bf0BOxLanqqvtUdFmt13vtXGZq56B02x7sLG?= =?us-ascii?Q?T3OyzLXy+ooRQBu62GDRg1r53vLKvuwTkVEfh7xDV9uJvSQbn2gRezoCwipG?= =?us-ascii?Q?eHxphHw0vES3af0Ts7LAoj7/VwmLTIM+/BYNvje930Sj4rzp7V6hXQvvn193?= =?us-ascii?Q?/iM3qJ1d+SLduCnRxwFtXDVNp/7xAbs4ZeQQ88soO5vMjXr6Hih2EDUc1mGN?= =?us-ascii?Q?UsP1k9WuyF+twgLWSRlzhCXS2B7bEM7HhRX4MmP6xlC1lx44D8MGcqKdq9Rv?= =?us-ascii?Q?tmQaQ+I046gFAN4jT3gWeW6yELujaPi/Is9Q3CDcj19bIqDu2ZX45qaSbnct?= =?us-ascii?Q?K+4wF/aDft6WH+Md8RhfAWS7lRyjfZoGfFZYYL2eSNlS4a8BZ+PSzO8UDDac?= =?us-ascii?Q?bI79ImyuP8ctZfNVb9clW0G7XyDabDoR+abDJns9UCzARJR92Wtb9QWhGuZa?= =?us-ascii?Q?6HqjUdWAVsM/jTUdfzFA4xrMWziUNltdxu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SKZCNg2II5fFip56irMeyHX94s/BB+0LsldSAJXj0Zxr66l/WSQRbsnq25ZVzCYPi1RsUYNLOYNzSEabw76/OXvGwmmWA0zBBuznHa6t5vVJ0PLTxa+OjraZ9o4bUCFpBUp+RJfSgENoZiYBgYYzk0KsZL4f1jm99O867rQWdPxgbd64M6tgY0r0bYgpgCEgl+O3oSSGFj9SPXB2z9Pqj8+KKYHcZ5PProvlAef9oNRs4f/x0VvTJVJWmNBRaw==;5:DDYLJyPcUjM5x/65iclYMBm1mmJei9DjFJ/1uFbFuFgTLa2zZErFDNqwFvd6yF0dQ+eNITmt1sVvrwsqGm5hx6m1VY/VeBkgUUCP1CZpYkWU4DtwQWtpF5Pa8NXTd+L5D+mqey7gQa1XW5ptcLBRLg==;24:KdmwwX83q8U24ZKqQMg7seecLezu2Wzw8mS3fVQk0axNF8RF0+dJ03Dh96/8nRd2udJcxApsqYGeV6SRsTj5v01Na/Iq5TA0fIgjgWCSBK4=;7:gZnrZeexq/3kAgL/wrpPU+0SbX5OyfeLIEwfBrcvGhc/YBfDQ4kMarJnNeDd/b9ouPMsaF2Nn7tJjNNErNXtffalj1ytt7HafV6acEC+YhpWxysLJT3cy2+OFs8wYD3FfasOoTRuvifKGvRyG0GtPfKXm/Smk69lzu4DB7WR2mrZUtjXWg4rT9e0lFOMD4t01g4U8fUpj1sX2jNyTtklzHv8eYicmS/DDGuerbvzdHw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM3PR15MB1081;20:cb9nPE3xAarAFexA+vz9fgstB3R0Fc2RCSjntI+SC5LzHyvNh8fX11jKTGGnuhl/8i8gqjfUJgkmXMNY0zdSFkqiZ3FEOwLlkAQl8nL1gkLAEOTxhzpi5yxUUFauHowX1BYXlT7RSSd4SELezBWJ40/d9KY9+PU3QsdGPLrb5qI= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2017 12:50:23.6670 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR15MB1081 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-11_04:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2595 Lines: 49 On Mon, Sep 11, 2017 at 11:05:59AM +0200, Michal Hocko wrote: > On Thu 07-09-17 12:14:57, Johannes Weiner wrote: > > On Wed, Sep 06, 2017 at 10:28:59AM +0200, Michal Hocko wrote: > > > On Tue 05-09-17 17:53:44, Johannes Weiner wrote: > > > > The cgroup-awareness in the OOM killer is exactly the same thing. It > > > > should have been the default from the beginning, because the user > > > > configures a group of tasks to be an interdependent, terminal unit of > > > > memory consumption, and it's undesirable for the OOM killer to ignore > > > > this intention and compare members across these boundaries. > > > > > > I would agree if that was true in general. I can completely see how the > > > cgroup awareness is useful in e.g. containerized environments (especially > > > with kill-all enabled) but memcgs are used in a large variety of > > > usecases and I cannot really say all of them really demand the new > > > semantic. Say I have a workload which doesn't want to see reclaim > > > interference from others on the same machine. Why should I kill a > > > process from that particular memcg just because it is the largest one > > > when there is a memory hog/leak outside of this memcg? > > > > Sure, it's always possible to come up with a config for which this > > isn't the optimal behavior. But this is about picking a default that > > makes sense to most users, and that type of cgroup usage just isn't > > the common case. > > How can you tell, really? Even if cgroup2 is a new interface we still > want as many legacy (v1) users to be migrated to the new hierarchy. > I have seen quite different usecases over time and I have hard time to > tell which of them to call common enough. > > > > From my point of view the safest (in a sense of the least surprise) > > > way to go with opt-in for the new heuristic. I am pretty sure all who > > > would benefit from the new behavior will enable it while others will not > > > regress in unexpected way. > > > > This thinking simply needs to be balanced against the need to make an > > unsurprising and consistent final interface. > > Sure. And I _think_ we can come up with a clear interface to configure > the oom behavior - e.g. a kernel command line parameter with a default > based on a config option. I would say cgroup v2 mount option is better, because it allows to change the behavior dynamically (without rebooting) and clearly reflects cgroup v2 dependency. Also, it makes systemd (or who is mounting cgroupfs) responsible for the default behavior. And makes more or less not important what the default is. Thanks!