Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752474AbdIFRlT (ORCPT ); Wed, 6 Sep 2017 13:41:19 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:50232 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752471AbdIFRlN (ORCPT ); Wed, 6 Sep 2017 13:41:13 -0400 Date: Wed, 6 Sep 2017 18:40:43 +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: <20170906174043.GA12579@castle.DHCP.thefacebook.com> References: <20170904142108.7165-1-guro@fb.com> <20170904142108.7165-6-guro@fb.com> <20170905134412.qdvqcfhvbdzmarna@dhcp22.suse.cz> <20170905143021.GA28599@castle.dhcp.TheFacebook.com> <20170905151251.luh4wogjd3msfqgf@dhcp22.suse.cz> <20170905191609.GA19687@castle.dhcp.TheFacebook.com> <20170906084242.l4rcx6n3hdzxvil6@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20170906084242.l4rcx6n3hdzxvil6@dhcp22.suse.cz> User-Agent: Mutt/1.8.3 (2017-05-23) X-Originating-IP: [2620:10d:c092:200::1:f2aa] X-ClientProxiedBy: VI1PR09CA0068.eurprd09.prod.outlook.com (2603:10a6:802:29::12) To BL2PR15MB1075.namprd15.prod.outlook.com (2603:10b6:201:17::9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b701934f-dd0e-492d-4085-08d4f54e6d0d 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:BL2PR15MB1075; X-Microsoft-Exchange-Diagnostics: 1;BL2PR15MB1075;3:kjhJgLWILoU/TTGtcBD+firHSPnGPqWv7hO2Jm4PJN0JYczNitZrKhDGkDiR8J4uOAl+uFSlzhctJjcMAeP4R0+0RegITz3Of8FF7OKGxcX7CRtBhkj9KoFFgYkvQ0B6NqWWl69kUKw7mfC84XHnTzRDWc6CCZbhRpYl9HKBq2wVq7azv0mMBd0444HTRnaM7+8hT6yhDYxUvvgo0o59nkPSptb01RswsXZqS/YHIyNG5IfAgb3hiVYgLwCM+aVC;25:FhBLj4siDbsxEw86p+Q3yx7qLP2KQZeNZwlsnD3KzOTGf/Rj11YlCAPLUkFgW7XpNTt4oNz33WaL35Ym2tZApHKaFBY/KWvdQPrEWOGLovBAIx7uB3nueuMu7sGJ9JuoHaTKAFD3C/02E7jeVyp3N0y64Dxu/1PKjVD3BUGWbubuJyMhvDoGMBGYUezuHhWhyibDdZx1sxpkMfq6JR9qekffQUbN6T0Y/D8BQSWdymkqWJrzKm7wvhbgR5tzWSO7w21EFsB2qLGgHjbw+pgQIUEq5gxYMNVefRVXMemNmp3UD4BDuM8+Rycr9431afLt0t0HDf9wuREEab4fMkjM0g==;31:dSNFsWMUvVc5Y5I+8e+M9K6FyI2ietrVkNi9YVECGEs7i43ieSgrGRlvgV3hZ5BBFWPvjeMi+UMNRKHUJG+FQOQcQjgoG0bzawiY+2nXOZ/lYqLArM2bqcFR0xlxxl2wIPoj4ZCcbgQlQXVJSEAi5tzyGin9VPALA7QBGnGg1ahu6fjQEkzPEfXDWhuOYCD9Ttzpi2/EnWgZqlmVDKqB8h63dsvzb3aQVDs/aBMVOho= X-MS-TrafficTypeDiagnostic: BL2PR15MB1075: X-Microsoft-Exchange-Diagnostics: 1;BL2PR15MB1075;20:IU05uoNI2RsnJvalZcejqa+NVjF9YGAB7CJbZsXviBQiTXPBTeBwh9eM7bI9tHazZ5uvGQpZRHrLcSMB4pwmjBS7ri6VLKbfqOuT7OZw5BVPimZzTjodZmdZP5AXIaScMf1trh2BiaIujEowE2NZJQNKapbfFFim+mSoeXXVlcMtdtF6Vaa+iRkscAoAqGPYzFSlUDI13LFG9Vmg12EBg6W+WgB/jVGyqqslWNI4UKpthpJrPbR+U3m0YqSQLdQh5VplqHP5VsdKDqLnEkQGQgtHbvyrih9Sy7/caUxQGhzb+2O762V8SyGnamrcKRR54zp+h9uvkHqaEmhzX2RDPe4NQQx/b+ecH8pvOjgmXD7W0m2QUo7EPhl8NT8r15nF7Xyu40anSkPA1ZuJ9Xvb+0U8pyCbna1A3P/hlXvXRvOPt4l9xf51rryawBuC3b3ANW9MmkVIq48at85Y+zhj7OpPZFYyqSZUCqyF9RgrADMG61zYRwGAyrlh+3bUC0Ue;4:6KMW1nbrnljfZzbajodvMicBH20YMO0+DJwBQRotYdPMv8zFIIF3iokchL85GTJIWLeRdwCJUVlJgDBIskmTtSeWTuZ42KTIDPQEsrlBBJMDbMMOqfgbaSGNPk/uWuQ8jp5MTp7rpWVmhbgG57Sk9FD4dMGdx24sIRLBWca2j9nExUIkOe3qkpfwLO0HCD/0fF6VQ2o2DWZQvwSvuAGNeEI4bukqgNlNrWI1q04fqPkM+oVrdrr4wb8WRfxAlx9kA4U/X3i+u+xn0/BWJPizBe0vPAbtnIi3uQcFklxTu+DCwxJONhvO9oLkCi3O+fV5nkQB1ue+A8GyRaReLPhGLe+NQRGv4ETtJ3tY1z/a4m6xGzhQM42H+dgs2vRUMiee9TGXrI4c7r3BdN/ar8RzEw== X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(67672495146484)(211936372134217)(153496737603132); 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)(10201501046)(100000703101)(100105400095)(3002001)(93006095)(93001095)(920507026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123558100)(20161123560025)(20161123564025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BL2PR15MB1075;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BL2PR15MB1075; X-Forefront-PRVS: 0422860ED4 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(199003)(377424004)(24454002)(57704003)(189002)(105586002)(6246003)(9686003)(106356001)(54906002)(7736002)(39060400002)(54356999)(2906002)(33656002)(6666003)(42186005)(50986999)(76176999)(110136004)(2950100002)(5660300001)(6916009)(53936002)(86362001)(101416001)(83506001)(34040400001)(53546010)(189998001)(478600001)(68736007)(93886005)(305945005)(55016002)(4001350100001)(47776003)(8676002)(7416002)(6506006)(25786009)(81156014)(4326008)(1076002)(6116002)(229853002)(23726003)(8936002)(81166006)(50466002)(97736004)(18370500001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:BL2PR15MB1075;H:castle.DHCP.thefacebook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BL2PR15MB1075;23:HWDkuR1dT/8/4HwbwuDxChX+geNJMqReH6d7tqX7t?= =?us-ascii?Q?k7Z2WZmoo7Yrp38Pf7u/Uzpu8nreJWU4m9rPsydZVL+3/qpkTWGgQLCwT9Um?= =?us-ascii?Q?rvBU1pIZoAE9ZVa+D4Ev4rTKM+wenXbEaplwv7s4sdOAOPNPvUfdqwnIr48z?= =?us-ascii?Q?nCY09y9NrZnmJ39AfuH4c3LDXtdApZvttFkJ57jYZ7/KD7ILm3pq226IPnJg?= =?us-ascii?Q?QynwlVM99zfdGkJUoZbk7wLUzsfNj31SS8I34AhzLgNg15LN8wS44lOYpcaA?= =?us-ascii?Q?e+F6sPP3DIKt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M X-Microsoft-Exchange-Diagnostics: 1;BL2PR15MB1075;20:Soyjyxmnw6aoNpK+L3fGHdXCOwVzGBs+F9xxkg5Tb7ctStafvHIwDZd95BdwOJlnw2C0SGZ+DVQ3hjLKX6SKSnTdaHZjURrMHoG0HIgr2nesSyqTfn3Mp6LKXNTQP2dloJGjwCa8zVDUoBaHUHCyfd6D1UHVyWT1uH+3kLqQn6w= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2017 17:40:53.3014 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR15MB1075 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-06_06:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3628 Lines: 102 sOn Wed, Sep 06, 2017 at 10:42:42AM +0200, Michal Hocko wrote: > On Tue 05-09-17 20:16:09, Roman Gushchin wrote: > > On Tue, Sep 05, 2017 at 05:12:51PM +0200, Michal Hocko wrote: > [...] > > > > 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. > > > > > > Why. If we care enough, we could simply return EINVAL when those knobs > > > are written while the corresponding strategy is not used. > > > > It doesn't look as a nice default interface. > > I do not have a strong opinion on this. A printk_once could explain why > the knob is ignored and instruct the admin how to enable the feature > completely. > > > > > > 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; > > > > > > I would argue that we should simply deprecate and later drop the sysctl. > > > I _strongly_ suspect anybody is using this. If yes it is not that hard > > > to change the kernel command like rather than select the sysctl. > > > > I agree. And if so, why do we need a new interface for an useless feature? > > Well, I won't be opposed just deprecating the sysfs and only add a > "real" kill-allocate strategy if somebody explicitly asks for it. I think we should select this approach. Let's check that nobody actually uses it. Thanks! -- >From f6e2339926a07500834d86548f3f116af7335d71 Mon Sep 17 00:00:00 2001 From: Roman Gushchin Date: Wed, 6 Sep 2017 17:43:44 +0100 Subject: [PATCH] mm, oom: first step towards oom_kill_allocating_task deprecation The oom_kill_allocating_task sysctl which causes the OOM killer to simple kill the allocating task is useless. Killing the random task is not the best idea. Nobody likes it, and hopefully nobody uses it. We want to completely deprecate it at some point. To make a first step towards deprecation, let's warn potential users about deprecation plans. Signed-off-by: Roman Gushchin Cc: Andrew Morton Cc: Michal Hocko Cc: Johannes Weiner Cc: David Rientjes Cc: Vladimir Davydov Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org --- kernel/sysctl.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 655686d546cb..9158f1980584 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -220,6 +220,17 @@ static int sysrq_sysctl_handler(struct ctl_table *table, int write, #endif +static int proc_oom_kill_allocating_tasks(struct ctl_table *table, int write, + void __user *buffer, size_t *lenp, + loff_t *ppos) +{ + pr_warn_once("The oom_kill_allocating_task sysctl will be deprecated.\n" + "If you're using it, please, report to " + "linux-mm@kvack.kernel.org.\n"); + + return proc_dointvec(table, write, buffer, lenp, ppos); +} + static struct ctl_table kern_table[]; static struct ctl_table vm_table[]; static struct ctl_table fs_table[]; @@ -1235,7 +1246,7 @@ static struct ctl_table vm_table[] = { .data = &sysctl_oom_kill_allocating_task, .maxlen = sizeof(sysctl_oom_kill_allocating_task), .mode = 0644, - .proc_handler = proc_dointvec, + .proc_handler = proc_oom_kill_allocating_tasks, }, { .procname = "oom_dump_tasks", -- 2.13.5