Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751950AbdIEOa4 (ORCPT ); Tue, 5 Sep 2017 10:30:56 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:60016 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751236AbdIEOav (ORCPT ); Tue, 5 Sep 2017 10:30:51 -0400 Date: Tue, 5 Sep 2017 15:30:21 +0100 From: Roman Gushchin To: Michal Hocko CC: , Vladimir Davydov , Johannes Weiner , 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: <20170905143021.GA28599@castle.dhcp.TheFacebook.com> References: <20170904142108.7165-1-guro@fb.com> <20170904142108.7165-6-guro@fb.com> <20170905134412.qdvqcfhvbdzmarna@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20170905134412.qdvqcfhvbdzmarna@dhcp22.suse.cz> User-Agent: Mutt/1.8.3 (2017-05-23) X-Originating-IP: [2620:10d:c092:200::1:9647] X-ClientProxiedBy: AM5PR04CA0011.eurprd04.prod.outlook.com (2603:10a6:206:1::24) To DM3PR15MB1083.namprd15.prod.outlook.com (2603:10b6:0:12::9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3fd164a6-94f9-49c4-3af3-08d4f46aacc2 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:DM3PR15MB1083; X-Microsoft-Exchange-Diagnostics: 1;DM3PR15MB1083;3:DgQWcRVmzUHu6UtcBiuMj18PGmWD5fcti3oAKaUpOOGM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DE+s7wWeYi5Ad7/GUj1qnnV0mbCCHeLPyN4T6euuidVGixJWtHXhF3En03ANNGS88x2ZbTSTG8S3hLoUQyugFqKCRlZ2bppBgs2O0DJWS7IzOr7obREmJr6/Y583cinoVpGf3O9FrH8xbzVFqYPl8qmDXX830zHJJ+rAVLaVWrbCqtM0E8uuvF5CJ5WXCYGMNqgE+JAFeHfecAZaeztb7d9WDAeasqzGDk3Oe5cONEM6wsIdhrYbfgLlQ8d3MOFJYaGqJQf/itjZ1rw/l4wqTqugNijnDY1d+bGPYXaYEVftX4HWQ+faO;4:MbwQu47gcTHPy5Da7VC0mRE8flMjryq/25zZ6mw5HeswA/mTJLPpycyX1l+27J+A9VtwUiLhyAEOuogovzlGJL80RLRzJt3dlksx9vzCYDbP18ML5muR6hlzH5cJoEih490JRUKmbTroNHPvc8WPy7uPxqPxMrHRf6FxAHzPFMT8mFVuAFrwX8TxeRKF59CELucgMd4KFKWK+HtPeCj7T5GZdPawuUz/pmIskOP50ypfucSAdO6LmsWXisoOryQn 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)(5005006)(8121501046)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(6041248)(20161123558100)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DM3PR15MB1083;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DM3PR15MB1083; X-Forefront-PRVS: 0421BF7135 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(24454002)(199003)(377424004)(189002)(7416002)(81156014)(86362001)(81166006)(2906002)(8936002)(229853002)(33656002)(305945005)(6506006)(6666003)(2950100002)(6916009)(478600001)(23726003)(1076002)(6116002)(4001350100001)(8676002)(97736004)(7736002)(68736007)(83506001)(5660300001)(189998001)(39060400002)(4326008)(47776003)(101416001)(53936002)(9686003)(54906002)(25786009)(54356999)(105586002)(106356001)(76176999)(110136004)(50986999)(6246003)(55016002)(42186005)(50466002)(18370500001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM3PR15MB1083;H:castle.dhcp.TheFacebook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM3PR15MB1083;23:O/7H7qEcf9srKz7knan1jzGGG0uYqZgZv1mudoHzz?= =?us-ascii?Q?0h+rlVP4jvpJInIVJeJ4+/mMpTeifDq/XQ3M6dF7veqyE90o3JVRcWf+TcEz?= =?us-ascii?Q?fczQH7RgMQEVnxg40KZxjc2lC+qpaTzjJlYn6x8ubCxSguYuyomIARb2s1e2?= =?us-ascii?Q?s0yvODAQltzuPfmwxPaF19CNFnibRhs8oFCB4EI4Z3quiIyK5pQXprY47cYa?= =?us-ascii?Q?HfbsOVCxinmGuRezRWCfvZPxEoZj9BdAo+KdgQf42+DMVBJ5yBK6PMmSGyHH?= =?us-ascii?Q?MAs4ciXm278IscYCJEC6WinN7bX24gWopFt87DhueSgyyO1nXnDZEClambiL?= =?us-ascii?Q?QBO+PS/xAgCUWOCWdINTRwkNKAwwUugJ7Dxejlx0ciCG3AhHo0h0G8f1cDBI?= =?us-ascii?Q?IjdraTFqMyYwcIUxtFJRonpAXuuS/CcRatuN4fmPsMrNfF+IYhMWA/YnvtcU?= =?us-ascii?Q?CoWTaaAURcuCfsmvl9pcjRQ2ivyN0edHBdtNmBJxzhR25WlSKNd/3pAXfLvL?= =?us-ascii?Q?iAX0tZaM0+kFVgevHr8Xy6vvHe7OksQ2y7VwIQYv0N46JvSgmAP+6xPNPU8P?= =?us-ascii?Q?W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p+pMWwTsPSE0kLFZvEA7DKomaR0K3sUFLGnjlo3DTciidlphfMKqXWAjrOUNwsz5p4rOSS7tDVjUIg==;5:L/caxTyi2FuPgncERLmzvL412cdFVhJWdWxPjezqhuCIzO72fPZOOjAyctwKB5MHNojvIP3JEKkeTjqLoHAUrIE9MMiZNjCZMq96eRuJ4YJPi5ZeWdqiO3c6K26SI6V/26n2v4fjUsnvSr0uwD+NH0wg3TgFPvM5NqgQfXdUXDY=;24:0UGICSLMs0QD0G6QBaRfnmHlAKNynjH1qJTTpO1fD3tnHdgYal8mzPptBJn0/JI5ps1oPwxpF9B6mPNwrN4WYluTOT8OKKZ02loS5qbjgu0=;7:UWREZZk6no7JOhTXTZCQzXG4S4c3K0vFL17OMvIdLesF/Cfr/Ge9ZrGAWLJ2ANYQh6JNmSrRmwJohfWZcs1bFaDTnyD0fQDPHpXI33ZwCnPV86pp/arvH3oV8OgwGtq/m5NqgmHlQNwTiPlpWXjP2/nX3O+xPzSvlnDbIPzVQwR0tJL6RKHuV2/8RZtzgwxOGK7SfxglDSdE3t8YlM5O0UniSvyAFmJBbB5q7SQtYrc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM3PR15MB1083;20:6ePC8x02Rc/d3imQIS5xj3ibaXPYNCxPfcQ3ZO3nV+1HV1dCPSmQvD6RxxN3SwU2duQ/povPG7ndTCnLfxOxFg0+Mwcfo3hb/El5+noNad20xApz9oK3aUEyFKBrxC3z5Nb4zhnkHujLgqPX4k+z5U0SP4lmLezoHS2aKQiN9gU= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2017 14:30:34.8984 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR15MB1083 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-05_07:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2518 Lines: 56 On Tue, Sep 05, 2017 at 03:44:12PM +0200, Michal Hocko wrote: > I will go and check patch 2 more deeply but this is something that I > wanted to sort out first. > > On Mon 04-09-17 15:21:08, Roman Gushchin wrote: > > Introducing of cgroup-aware OOM killer changes the victim selection > > algorithm used by default: instead of picking the largest process, > > it will pick the largest memcg and then the largest process inside. > > > > This affects only cgroup v2 users. > > > > To provide a way to use cgroups v2 if the old OOM victim selection > > algorithm is preferred for some reason, the nogroupoom mount option > > is added. > > > > If set, the OOM selection is performed in a "traditional" per-process > > way. Both oom_priority and oom_group memcg knobs are ignored. > > Why is this an opt out rather than opt-in? IMHO the original oom logic > should be preserved by default and specific workloads should opt in for > the cgroup aware logic. Changing the global behavior depending on > whether cgroup v2 interface is in use is more than unexpected and IMHO > wrong approach to take. I think we should instead go with > oom_strategy=[alloc_task,biggest_task,cgroup] > > we currently have alloc_task (via sysctl_oom_kill_allocating_task) and > biggest_task which is the default. You are adding cgroup and the more I > think about the more I agree that it doesn't really make sense to try to > fit thew new semantic into the existing one (compare tasks to kill-all > memcgs). Just introduce a new strategy and define a new semantic from > scratch. Memcg priority and kill-all are a natural extension of this new > strategy. This will make the life easier and easier to understand by > users. > > Does that make sense to you? Absolutely. The only thing: I'm not sure that we have to preserve the existing logic as default option. For most users (except few very specific usecases), it should be at least as good, as the existing one. Making it opt-in means that corresponding code will be executed only by few users, who cares. Then we should probably hide corresponding cgroup interface (oom_group and oom_priority knobs) by default, and it feels as unnecessary complication and is overall against cgroup v2 interface design. > I think we should instead go with > oom_strategy=[alloc_task,biggest_task,cgroup] It would be a really nice interface; although I've no idea how to implement it: "alloc_task" is an existing sysctl, which we have to preserve; while "cgroup" depends on cgroup v2. Thanks!