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 ADC7BC48BF6 for ; Fri, 1 Mar 2024 02:39:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E63AE6B0078; Thu, 29 Feb 2024 21:39:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E140B6B007D; Thu, 29 Feb 2024 21:39:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CDBFD6B007E; Thu, 29 Feb 2024 21:39:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id BB39D6B0078 for ; Thu, 29 Feb 2024 21:39:29 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 60785A17F2 for ; Fri, 1 Mar 2024 02:39:29 +0000 (UTC) X-FDA: 81846914058.09.DFE44F1 Received: from out-174.mta0.migadu.com (out-174.mta0.migadu.com [91.218.175.174]) by imf09.hostedemail.com (Postfix) with ESMTP id 8B401140008 for ; Fri, 1 Mar 2024 02:39:27 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=wbWsA8Bz; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf09.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.174 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709260767; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ZIdqVtaB4EaLn9myWUsTONCxMWnwP/dnVDmb+7RniiM=; b=ZG8o88ISV8k+raNBtHasnfaD2sHmwwc6UEGpmBiaq6rLjxn7dWbDL1e/se6fAiQD2mqYsb 32nYpXgYHSh0519jrbim8w6NjMdQokEJEtPlydOFyXWHYywV4E3sdntDUm4dZ75xiv/HpL V8D6KzSS+8JZ9cb2V2Yz7QgTlb2iato= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=wbWsA8Bz; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf09.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.174 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709260767; a=rsa-sha256; cv=none; b=zM7vPIFRdQvhM0k9fl0f9HC/3ak+vYqSb43SJt9/Sm+04kvmHKhrY6sd918Lsb0+6f9Y4m s1ZHNnrt87uFOTSiMq06WPeLxtwf2OqwlS08+du3xPYmtC1nZ+yjbJisC1DOS0RqJVDr3g r9djPkFUUx8UBvb3riK3oR2+OLX+T/g= Date: Thu, 29 Feb 2024 21:39:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1709260765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZIdqVtaB4EaLn9myWUsTONCxMWnwP/dnVDmb+7RniiM=; b=wbWsA8Bzo/kNI9c7umS0uxXcpyy7MlRRLjD3vAq+rslNvG1bdGlG4jQ+wLV3FAXTNs/i1t O6oHkvMh/GFszhT2luJw0gOfYSff41OPXQoSqFp/RXDkd3Wn8qT7uSm/bY4sNyrj2gW7ON elsACZaxTLWwyLd4QqTyBB97U0hBYNI= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: NeilBrown Cc: Matthew Wilcox , Amir Goldstein , paulmck@kernel.org, lsf-pc@lists.linux-foundation.org, linux-mm@kvack.org, linux-fsdevel , Jan Kara Subject: Re: [Lsf-pc] [LSF/MM/BPF TOPIC] Reclamation interactions with RCU Message-ID: References: <170925937840.24797.2167230750547152404@noble.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <170925937840.24797.2167230750547152404@noble.neil.brown.name> X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: 8B401140008 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: f4mf94ytyd47h9pwf9efqak66iq64cu3 X-HE-Tag: 1709260767-71006 X-HE-Meta: U2FsdGVkX1+8qZ7Rtuf7jA71rbSwt7QdeLYtueytDcNkCapNNKs/EC5Bo0IalsBQOl85qBH/OZO/bPWnSRlo0jyx++AZk+nTDn60U8qgwH1rCVQkj1ySVDB2kEGGXIYp4zQOksvoUuUWGYWEjRNtCfrPK6+Z8PiS5ce1hNIhppIJk4pz1TYUjQbkgl084+OTpr49CZzwf0okMkfA18VCqWZMohvpa5XWCVF9ZAK+BYDp9Y6TQFYx/uCxTlJ+fJ8213phure73iFpydYTPUTp+8DiJrTSl10Tvw2rQZZHOsiVQrvRCKfLQR80JwEoiHt1l0arVc/p0gt+1PTGCV+aEbcNPtDIHa0YYiZvtyoRYuHR9Xo1Sjs25TYzHJqDnj5yxeewZdsl+i4YV0Sab4F2M641QPenaRESZ1lmGclF0mVA3GMW3jVyd8ckkYN3hr80Nx580JFmcVv7STZQrl0uQEnGRcf38J8CqjihX6xKc/6YiuRo1Z5aG41zqbS0sIvw+wWRsXoe+Ormc+famcO1C2/zjm9/NPdJwxSqjIk1QM4U/2Ert2/W8U6z5ULaMiGl46zMM9kIs/599g6elIcTch9kbcf6A1QbuL4xvNW9old5uVUML8NN21YOr7n2LgZ0gvtNIpQcg3u0Y5aXBBhjah+W7hlz4jpTkuLEPDw/RMMbnZZMtI9YhF9fyKU//pl0R5p7IDZ2t85tVqq8R4+ic/Uq80lvrrs5z9t91KadlSInccfDY3F0gFEjz8gS89EpZQ3aWQacd1Q/Z/CTlu3IquMBYUTnhK8Kn69s3hA1H4Q= 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: List-Subscribe: List-Unsubscribe: On Fri, Mar 01, 2024 at 01:16:18PM +1100, NeilBrown wrote: > On Thu, 29 Feb 2024, Matthew Wilcox wrote: > > On Tue, Feb 27, 2024 at 09:19:47PM +0200, Amir Goldstein wrote: > > > On Tue, Feb 27, 2024 at 8:56 PM Paul E. McKenney wrote: > > > > > > > > Hello! > > > > > > > > Recent discussions [1] suggest that greater mutual understanding between > > > > memory reclaim on the one hand and RCU on the other might be in order. > > > > > > > > One possibility would be an open discussion. If it would help, I would > > > > be happy to describe how RCU reacts and responds to heavy load, along with > > > > some ways that RCU's reactions and responses could be enhanced if needed. > > > > > > > > > > Adding fsdevel as this should probably be a cross track session. > > > > Perhaps broaden this slightly. On the THP Cabal call we just had a > > conversation about the requirements on filesystems in the writeback > > path. We currently tell filesystem authors that the entire writeback > > path must avoid allocating memory in order to prevent deadlock (or use > > GFP_MEMALLOC). Is this appropriate? It's a lot of work to assure that > > writing pagecache back will not allocate memory in, eg, the network stack, > > the device driver, and any other layers the write must traverse. > > > > With the removal of ->writepage from vmscan, perhaps we can make > > filesystem authors lives easier by relaxing this requirement as pagecache > > should be cleaned long before we get to reclaiming it. > > > > I don't think there's anything to be done about swapping anon memory. > > We probably don't want to proactively write anon memory to swap, so by > > the time we're in ->swap_rw we really are low on memory. > > > > > > While we are considering revising mm rules, I would really like to > revised the rule that GFP_KERNEL allocations are allowed to fail. > I'm not at all sure that they ever do (except for large allocations - so > maybe we could leave that exception in - or warn if large allocations > are tried without a MAY_FAIL flag). > > Given that GFP_KERNEL can wait, and that the mm can kill off processes > and clear cache to free memory, there should be no case where failure is > needed or when simply waiting will eventually result in success. And if > there is, the machine is a gonner anyway. > > Once upon a time user-space pages could not be ripped out of a process > by the oom killer until the process actually exited, and that meant that > GFP_KERNEL allocations of a process being oom killed should not block > indefinitely in the allocator. I *think* that isn't the case any more. > > Insisting that GFP_KERNEL allocations never returned NULL would allow us > to remove a lot of untested error handling code.... If memcg ever gets enabled for all kernel side allocations we might start seeing failures of GFP_KERNEL allocations. I've got better fault injection code coming, I'll be posting it right after memory allocation profiling gets merged - that'll help with the testing situation. The big blocker on enabling memcg for all kernel allocations is performance overhead, but I hear that's getting worked on as well. We'd probably want to add a gfp flag to annotate which allocations we want to fail because of memcg, though...