Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752514AbdHOM62 (ORCPT ); Tue, 15 Aug 2017 08:58:28 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:46205 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751468AbdHOM6Z (ORCPT ); Tue, 15 Aug 2017 08:58:25 -0400 Date: Tue, 15 Aug 2017 13:57:50 +0100 From: Roman Gushchin To: Aleksa Sarai CC: David Rientjes , , Michal Hocko , Vladimir Davydov , Johannes Weiner , Tetsuo Handa , Tejun Heo , , , , Subject: Re: [v5 2/4] mm, oom: cgroup-aware OOM killer Message-ID: <20170815125750.GB15892@castle.dhcp.TheFacebook.com> References: <20170814183213.12319-1-guro@fb.com> <20170814183213.12319-3-guro@fb.com> <20170815121558.GA15892@castle.dhcp.TheFacebook.com> 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:c092:200::1:8881] X-ClientProxiedBy: VI1PR0701CA0033.eurprd07.prod.outlook.com (2603:10a6:800:90::19) To CO1PR15MB1078.namprd15.prod.outlook.com (2a01:111:e400:7b66::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bc56b8fe-5266-4378-30bc-08d4e3dd4584 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CO1PR15MB1078; X-Microsoft-Exchange-Diagnostics: 1;CO1PR15MB1078;3:1I9wcPO/0et5eVcIrg1AGxVipZo1COi9JtZ+6ryrrH98gIZu7t5IrdIaIpHJbuP0dMbsB+E0fBC7DAMq6UW44ZyyZyyFrJ5nAHC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opBzlR7Zx2DfuAmoUu1I5UONZ+iIAnRmSKU0zofLiHajj5qWPGkK+cMVlvyksSCyXKTSta0y1YlW9Z7jwiCizdGPbRXgM9BZ1OAxrd25V6fI1FKrwXZ5ZTfeytWsTEbgdTQk8ainCIglUWDlSMvQ2vMMFploqsGFzYHJIuHZ//HeWJYx25aBnXRLveAJ+AbEMIFpF2MlIJtqvCnSVS0qlwdJDOHS+CXpL9oL2KGKgQpwMdcx;4:upW5vIoAqXtOrA5bDfAZ5MqTizGjo73gKiqB1OS0IC68XhyWwOR2hzBx17xREowPDhhqHwvTqymViof/nTxbglte41s9Ywd/HrnRNsf+72S7WinwTGoxvfhBKPiiMMwOdx4WqIY87MHEiZc3DEJY9BLM46H3fNjG83D25mWRLOLwPHSGN5LXoSka64SPYv5BQR7PW2DeCCADUr/SyLWxD5gkBFkfeFnlIthNlFPeYdJEM/yzzhN/MRAKRljJ4+cd8nXwSD4TteSoXJqkHwZ4JFFDwrS9gA63WFpqN6TbjzY= X-Exchange-Antispam-Report-Test: UriScan:(17755550239193); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CO1PR15MB1078;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CO1PR15MB1078; X-Forefront-PRVS: 04004D94E2 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(7370300001)(4630300001)(6009001)(24454002)(199003)(189002)(377454003)(68736007)(6116002)(23726003)(1076002)(4326008)(2950100002)(6916009)(86362001)(229853002)(33656002)(6506006)(6666003)(7416002)(4001350100001)(25786009)(5660300001)(7350300001)(105586002)(106356001)(101416001)(6246003)(2906002)(110136004)(7736002)(97736004)(305945005)(189998001)(42186005)(50986999)(76176999)(54356999)(83506001)(55016002)(50466002)(54906002)(8676002)(47776003)(53546010)(9686003)(81156014)(81166006)(53936002)(478600001)(93886004)(18370500001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:CO1PR15MB1078;H:castle.dhcp.TheFacebook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CO1PR15MB1078;23:5m6q7jKYlFsRT073FfObsv0ImB5MovuEE14OlUDT+?= =?us-ascii?Q?MipRJ9ULIBcgGc6WoDWnCGAQyGuY3JfHXWV31HjQkLokEylsoy1AbNfSp+om?= =?us-ascii?Q?eBDVvhCeArEZRUN7y1nhvBFGhA7qokWbbsxuyNuZPZEgwW+Wp4fmVegKoetW?= =?us-ascii?Q?SoOLjGt9Hv11WKEAyBnQbbAlbIrBRKAga7WOZ+FeF7sp0MVmn86BCra4I9rQ?= =?us-ascii?Q?PQQIAqZ+/AKe1dPxD2ABmYTbRfGuq2jIn5uIURIabck6iTZzv8KA+2zHsGk5?= =?us-ascii?Q?zAWkHkMj0Skxf301+91MV5xiKP4wG9K62zv+Hh1lDqRJsBplv60inzjHkPH8?= =?us-ascii?Q?0EojQmuSpim/YnZG7H9jjy8smXVxPDlIXep0RlQ0Fan4ZFjLqNCLYVFCTR5b?= =?us-ascii?Q?eGlIzUh5ymMAqJG7PiTmoHhzM2jHfzBynTZFF5cJ6eIw+IGlh6puHwfVzwza?= =?us-ascii?Q?usDU/ak3WxwWZTQ1eyU8h2gA6rDGfWzVjrSB9rlGxjz/PFMDLGnzLk5QyxY9?= =?us-ascii?Q?Jw7gpfPkRniJIhxRdlZOX0GPErVnZnJ0ovzHP6rHTFHb4VF6s7LACq3u1FVj?= =?us-ascii?Q?61k7fmP0U7NPbaZa0m/DN+X2jMea9wR4nItb43HmNNZzuhQ9RDkW29swZDWi?= =?us-ascii?Q?WyUr1xz41xanixxx3RcOktGtIWW9S/MKh3lWVnyhihuIH2ju1GPdIiTfxP+U?= =?us-ascii?Q?dzL3ZyrGU9x/ZuSA6KxaFgBjfplCeja46kms97Oqat5wcTphIBuLpq4FlG7D?= =?us-ascii?Q?+IEKLkc1x+9b1FOoLLNKZb3F6id6QN0Vr6j/McHDQT/2At3bThCJRs7jGQQQ?= =?us-ascii?Q?03Hhdij2BAHtk7tX2JRIOcHp0MdVKF/LWXKu9pt3djm1KsOANiMYAZmC+jxn?= =?us-ascii?Q?XMEoX+Zy4N6uLq/kfhXU6KBBO4uTlLWIcpwB1od3vww7uLQGL1yIrseS7ZKt?= =?us-ascii?Q?8VxaahMADlnw0c8qmF33cxzov41EcTArJcBdIRT/Mw5NTbqQ/zlPHvMS/n/0?= =?us-ascii?Q?XCUpykIxAQHeSQDWnSEhe65L0/lyirVaDJiB6Raajp4d740p3ojr7ElKMEZp?= =?us-ascii?Q?qvGH7BV4gj6mVDI673/kmwHdfjFF5mWCLql7eWm0Pzj8AwT4nAtoOeaTQODt?= =?us-ascii?Q?0ScE12yA3alGdGWBD7qctdEzlAtVIjUUjIBP876mI5+QeSRMBeqn5hee5+1Q?= =?us-ascii?Q?6Duk539/1Ig79JTVxqI8l+XLGyyNcUHz1xpDqXyW1EcrbxNF8VumkKvns9co?= =?us-ascii?Q?UG6Jn9T6zLqNvyazBY7jkCQPDj6TfrzpiXTB5Xc?= X-Microsoft-Exchange-Diagnostics: 1;CO1PR15MB1078;6:79wV1QhgPctw3cLE1/g1s9SWLNBTCEgxGbN2kNT5qY9imxcjgH/NDeYnAhon8ZzsyKNkUfflQu8R9bNJYFMzeYrX+diuJKzG/+0pw+rtAIm2K//4L34dTNbpz2n8vtatnILYqfG6I7UgY+7JBijCEKnpVCSz6zEyIFrqWSTIhy+dzawLNwJ23E/CeUoyQ+4ZZ0cFPMFLEV2vsAnHQfHDKxDRIZLpqbo+Ji635uPO0Yok4nqHIuSkW29FTx0P+2J3OUra1MT0kq/g41Q4JL0nPHYCHqi7amEiJj6E86DCGGXYcsxtjYEDxcdMsrvy46gefrrqiWygtmg+I8syycTLsQ==;5:9rEL5dNjpyqMyBPVordTgKpynH+iJ1RssTXKl4f8ZNHCFd6FC59IAYngg3ou33oAGLyjf9/+/rNKO9pM/7gxBAIedqEeKEBvBT3vAgIeQTTDlXQCE4aLKMGoB3lkB8E6pKATkP6JNyKRAE19Y+Q4Mw==;24:Pzf5lX9VBlGR7jitbbS5FvgboUjj8DrQvvKrvW1v3uDa5GZCAzNxYXj4o+k0GbUae+kxPZdTjP1nr9T3C/N3S20fFcXaZmgZojZkMA3DSYA=;7:ZcDNxPIS44z1sArz/ZwRl5RCeiA2fh6Fx+JaIGKQKD08nBRqXXj899NyoSpqxmnhjKRh/CCYmP222pqgaHjq8VnIakCFdrGujYtuqBe7GONBrhhp558U6wCidfPjHFsCVXHQotgyNKbRc6OdsJzenkAc/HitL/pDg1k0e70cKXir9CmZQWF3WD+ZFxKw1xaQsAlZqNLwaMT2CGUplRY2u6ct+6Tyfz7wfg1nvCRXc9s= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CO1PR15MB1078;20:WOq8Pm1sF9F5NrV67pDTCQ1jJVfEHpOIxW0jhIEBgjG01Ep9VIhj4+J83mVOGa27qbMzXulVtRXuyEsjQJ8JOLpOSVlSRNwUqN+FxSYNmIcR6teZdG6GFa8mIsfK+Yt21aWq0EI34xXjhJeIuzHMpTjR0tOzUtx7QD4S+96yie4= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2017 12:58:03.0744 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR15MB1078 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-08-15_09:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 940 Lines: 20 On Tue, Aug 15, 2017 at 10:20:18PM +1000, Aleksa Sarai wrote: > On 08/15/2017 10:15 PM, Roman Gushchin wrote: > > Generally, oom_score_adj should have a meaning only on a cgroup level, > > so extending it to the system level doesn't sound as a good idea. > > But wasn't the original purpose of oom_score (and oom_score_adj) to work on > a system level, aka "normal" OOM? Is there some peculiarity about memcg OOM > that I'm missing? I'm sorry, if it wasn't clear from my message, it's not about the system-wide OOM vs the memcg-wide OOM, it's about the isolation. In general, decision is made on memcg level first (based on oom_priority and size), and only then on a task level (based on size and oom_score_adj). Oom_score_adj affects which task inside the cgroup will be killed, but we never compare tasks from different cgroups. This is what I mean, when I'm saying, that oom_score_adj should not have a system-wide meaning. Thanks!