From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D705C433F5 for ; Sat, 20 Nov 2021 05:07:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 20CFB6B0071; Sat, 20 Nov 2021 00:07:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1BD1C6B0072; Sat, 20 Nov 2021 00:07:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 085016B0073; Sat, 20 Nov 2021 00:07:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0129.hostedemail.com [216.40.44.129]) by kanga.kvack.org (Postfix) with ESMTP id E98BE6B0071 for ; Sat, 20 Nov 2021 00:07:37 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A3E3418522C61 for ; Sat, 20 Nov 2021 05:07:27 +0000 (UTC) X-FDA: 78828125334.16.F617CBC Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf21.hostedemail.com (Postfix) with ESMTP id DD9F6D0369D0 for ; Sat, 20 Nov 2021 05:07:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=wEdJcEBDOS+GDmIXrr71fbDgTyZK1MYWQaHlEXJLZ+U=; b=RoCqii8SlnkIZCDsu35QUFgqso PITjNmL1dwlGuPu8CjvRwOJcy2m/hYeBGQfdpPfwnOqBiM2CswkijqY7kAw/lXx66QDDMKiFTAA88 rdsZLxB0mnvU12IFq8dBzAZORSXWHwrgiIjX51ttJCkU9CfVxobWCFpWhqWUsfY4KredcvAvSnoBF tyQpEFdr/VabIfumYydXb3HHwsX1YzZRrGI36hvu8UjsOfEJ5Qhux0kZt22bAigzQUCZffDPTr2gl jryvet5ScyXeiNvk5C/OI4Xd1Jctu42+rwS4xxvuDYwTw6iQD02X1Utxx/E2/FSFl5aTisiwnSBT0 Oj7d9Sug==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1moIao-00AF7t-6g; Sat, 20 Nov 2021 05:07:14 +0000 Date: Sat, 20 Nov 2021 05:07:14 +0000 From: Matthew Wilcox To: Mina Almasry Cc: Johannes Weiner , Michal Hocko , Vladimir Davydov , Andrew Morton , Jonathan Corbet , Alexander Viro , Hugh Dickins , Shuah Khan , Shakeel Butt , Greg Thelen , Dave Chinner , Roman Gushchin , Theodore Ts'o , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org Subject: Re: [PATCH v4 2/4] mm/oom: handle remote ooms Message-ID: References: <20211120045011.3074840-1-almasrymina@google.com> <20211120045011.3074840-3-almasrymina@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211120045011.3074840-3-almasrymina@google.com> X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: DD9F6D0369D0 X-Stat-Signature: 3qyc1ac1t16fe4czint3qbgqw1ie5izt Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=RoCqii8S; spf=none (imf21.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-HE-Tag: 1637384845-770457 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Nov 19, 2021 at 08:50:08PM -0800, Mina Almasry wrote: > On remote ooms (OOMs due to remote charging), the oom-killer will attempt > to find a task to kill in the memcg under oom. The oom-killer may be > unable to find a process to kill if there are no killable processes in > the remote memcg. In this case, the oom-killer (out_of_memory()) will return > false, and depending on the gfp, that will generally get bubbled up to > mem_cgroup_charge_mapping() as an ENOMEM. Why doesn't it try to run the shrinkers to get back some page cache / slab cache memory from this memcg? I understand it might not be able to (eg if the memory is mlocked), but surely that's rare.