Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752010AbdFHQBC (ORCPT ); Thu, 8 Jun 2017 12:01:02 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:60852 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751614AbdFHQA6 (ORCPT ); Thu, 8 Jun 2017 12:00:58 -0400 Authentication-Results: google.com; dkim=none (message not signed) header.d=none;google.com; dmarc=none action=none header.from=fb.com; Date: Thu, 8 Jun 2017 16:59:57 +0100 From: Roman Gushchin To: David Rientjes CC: , Tejun Heo , Johannes Weiner , Li Zefan , Michal Hocko , Vladimir Davydov , Tetsuo Handa , , , , Subject: Re: [RFC PATCH v2 1/7] mm, oom: refactor select_bad_process() to take memcg as an argument Message-ID: <20170608155957.GA13161@castle> References: <1496342115-3974-1-git-send-email-guro@fb.com> <1496342115-3974-2-git-send-email-guro@fb.com> <20170606162007.GB752@castle> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [2620:10d:c092:200::1:e70f] X-ClientProxiedBy: AM3PR07CA0132.eurprd07.prod.outlook.com (10.165.223.18) To SN2PR15MB1085.namprd15.prod.outlook.com (10.169.192.135) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN2PR15MB1085: X-MS-Office365-Filtering-Correlation-Id: 50c4fbcf-0f67-440e-df19-08d4ae87736d X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:SN2PR15MB1085; X-Microsoft-Exchange-Diagnostics: 1;SN2PR15MB1085;3:iGpDzjCyrM823B7PF5UkZSEbDZGVu31eEiCdSO3Xoc17lBV5IcToA/oUiVZUeveN3albNSpgf7r3JZ2FAuQDtYL6YaKNFTxUoOxZBFJ79RQxiYcCMyc9rVYkSPwVmYF+zWRCqcn0kt7Ioh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AgueNmAItw4NqsG6bFOBeFNagzP1iHlEIY48KvohyMmIJlAi+bCdrrXqvdiT1KMr4a45G7EmI9PwPJCX0sBDfYmq4FfqpZmJYx5yULwTVl/ElcapTJo4YGUE81v4ueN1CNFx9tRxHpwe0J/zqsn1Xqqzah+2aNRqBTi3Qldn5oV2E/YY+Ds5xTsHFZWllfZZvROv9fsvJxoYsQ7/ja5MMUn25T9jVyfdsBlFqFbKU1lvpu2H2A8P3h7sTkPd68mgV54ViuYqT/cl/qnZtenDI+5Frx+GrC+0S5WGHcY2NI0s0zBfw+u74QSofj6jPjlnqZTL9oJnZdVKV2BWtr6UDc7MSOHTOs/RIkfWvuT2h3ibBwYQfahgx0/RVALz2ED+cXQFa6HpuLVt2i+xU/aDf5kbnyNRg2DU X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(100000703101)(100105400095)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123564025)(20161123560025)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:SN2PR15MB1085;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:SN2PR15MB1085; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN2PR15MB1085;4:oBwRJelbe34ptHUvVOQN1+qNpQhaiQzdU1XJcO+uEF?= =?us-ascii?Q?dNJY0NfTF07hx7GoPHM9RSgwKFpJ5vQXy3TlhzJzllGg9yITSYQg3CwILFcr?= =?us-ascii?Q?1LFVnPc8VUe2HZWGUV1j2/I0vdsdhBsmC4fHF1rj3jKLoyBE6Defzskax9lf?= =?us-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Z5yviHMrQJ02XoF+vvYNEPCyk2zpzlW?= =?us-ascii?Q?vlHTFavUtu0bCz4/i28mKW58rP9JZOnaMVogxvwPXDhhSXw8tkntgjfoFg77?= =?us-ascii?Q?XuU+b1er2LSwRbHkRgZjH9+aiiLUxa?= X-Forefront-PRVS: 0332AACBC3 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(39850400002)(39400400002)(39410400002)(39450400003)(39840400002)(24454002)(76104003)(86362001)(5660300001)(81166006)(93886004)(8676002)(189998001)(50986999)(47776003)(54906002)(54356999)(76176999)(7736002)(305945005)(55016002)(4326008)(33656002)(1076002)(25786009)(6246003)(7416002)(23726003)(53936002)(9686003)(42186005)(229853002)(6496005)(6916009)(2906002)(38730400002)(478600001)(110136004)(6666003)(2950100002)(345774005)(33716001)(18370500001)(217873001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:SN2PR15MB1085;H:castle;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN2PR15MB1085;23:P9fyaabLLnV3F+cwTUAWPGH7J/aDoL5zAo9YhZeLJ?= =?us-ascii?Q?UamQPbycoEe9CwYVF8yLPl6pFFOdPHAkKWV6gp4PJOgPRi5dGUJVbUGplqRS?= =?us-ascii?Q?O+XfAnBTCOrMsYDGr9Z7IQlOf0YO3B9U4dOEYKCW7nmIZ5ljZLzyblxRhZnZ?= =?us-ascii?Q?Q1b3ZbkBu+p/QD7OV4rtl75nXw8RLQPTsye6lKgiVDgQpeu+ygpJCy35Yczt?= =?us-ascii?Q?m2oGvzOSynfC7uPrOKb1KNOjQ87lhxPbKEqmdjXQyyX1lGW+/jekDo9E9i8j?= =?us-ascii?Q?6M4v9Fdu8uco6kUEwcmk8ZqTtbJorAIXHTMy1YRrlDWZr27fWY6NCPdY9D7m?= =?us-ascii?Q?APSa6EiJfoHMaol7V3wKfhNvn1zkBLMKXvJfUI77lz0NC3kcqWEZEPk3aE0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DwZCT9DEjrbUQfTFUWWYijhuaXJSS36eubEzGFkfz2gG0hHFFt1WM/+fbglqm2DzZ8p6QS8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;SN2PR15MB1085;7:IgTWkVGE30Vl3rMe6SI7J/piVbpY/rwf02sBDcthPPPJagjG7gfCBE2UhtsKZEzJ38FHEbMbTxmdUPUbQ3ceNGnvS7GxSNxJOQUPOdcOakSm7sUszhTLQ4055a/CRaUnHIdYfAaeEW/wAx5q0mQev3t7QK45GJojJl/7G7OTeBrc4hdiSxtE2OFqSvkWNqhYSwajzIKAjyDUl4YsbDAGXsg6cYEyUOUuxAk3m/O1MdsTIJ7CBnMKbyGtz47Ee76QSTetXoiZkGTwQxSsr8w1E69Pe6iMvLOaDltDSjEUH0rcYUHPYohq3/ECb1HQgFAIryEjdL47XKImLFQ7LsJO3A==;20:W6LZFZ872oB5WgNcDD58J92gRl4895X8tzj2YiHriP9CUlcMEBmkIpd7CcHisEMxdiUffVYvA0KFf/GIDTtfS0H4DfzlqV8Blo6fuoh6d0++wb3KtlfOYnCp/usPV24RZqX/c++EMKQBHPVehOU+eW9+FQGRImR5T6eoIOYG7pE= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2017 16:00:09.1165 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR15MB1085 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-06-08_05:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1642 Lines: 42 On Tue, Jun 06, 2017 at 01:42:29PM -0700, David Rientjes wrote: > On Tue, 6 Jun 2017, Roman Gushchin wrote: > > > Hi David! > > > > Thank you for sharing this! > > > > It's very interesting, and it looks like, > > it's not that far from what I've suggested. > > > > So we definitily need to come up with some common solution. > > > Hi David, > Yes, definitely. I could post a series of patches to do everything that > was listed in my email sans the fully inclusive kmem accounting, which may > be pursued at a later date, if it would be helpful to see where there is > common ground? > > Another question is what you think about userspace oom handling? We > implement our own oom kill policies in userspace for both the system and > for user-controlled memcg hierarchies because it often does not match the > kernel implementation and there is some action that can be taken other > than killing a process. Have you tried to implement functionality to do > userspace oom handling, or are you considering it? This is the main > motivation behind allowing an oom delay to be configured. cgroup v2 memory controller is built on the idea of preventing OOMs by using the memory.high limit. This allows an userspace app to get notified before OOM happens (by looking at memory.events control), so there is (hopefully) no need in things like oom delay. Actually, I'm trying to implement some minimal functionality in the kernel, which will simplify and make more consistent the userspace part of the job. But, of course, the main goal of the patchset is to fix the unfairness of the current victim selection. Thanks! Roman