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 EE56FD1F9C2 for ; Tue, 15 Oct 2024 19:17:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 520576B007B; Tue, 15 Oct 2024 15:17:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4D0A16B0082; Tue, 15 Oct 2024 15:17:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 398446B0083; Tue, 15 Oct 2024 15:17:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 1BC3C6B007B for ; Tue, 15 Oct 2024 15:17:31 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 7198A1A183E for ; Tue, 15 Oct 2024 19:17:14 +0000 (UTC) X-FDA: 82676795250.21.4AAAA42 Received: from out-177.mta1.migadu.com (out-177.mta1.migadu.com [95.215.58.177]) by imf11.hostedemail.com (Postfix) with ESMTP id BFE1840023 for ; Tue, 15 Oct 2024 19:17:19 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=heRGDCJA; spf=pass (imf11.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.177 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729019705; 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=xMk7NYWnpFsmIrjE2x+tJklQeOWwKwQSoxh5vfQIXC8=; b=h9JSua8k8lC4cqLXgs/Pr4SJslmzvvkqSo5rdmoQZLfbisoARxHQCg8xv8eG0KpTIEhZd4 LP97+NLCldhlOr1acAtu4NjCdIILW+VKcF/sUQQJaLPS9dR/9Ve55mAME2fnrMvHyqvL73 hzRltPCXWalCq50BxvRJE5ViFvzYMxk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729019705; a=rsa-sha256; cv=none; b=sWgSBpgwiSKO7u49Yo/N9X0ph/Nj53LDRY3m3VyrOTA0pioBZhLWvKPWdI/+6mcekMqR2i BlH5wthOFp1es8AD+prbFr6uYlpIMUTVV/j85SWNc25OclLCfewbqq6nXseiwn2oNhROH8 Ndc7J9U0VKzb/mIpxv8uPhNcl/HGsAM= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=heRGDCJA; spf=pass (imf11.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.177 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev; dmarc=pass (policy=none) header.from=linux.dev Date: Tue, 15 Oct 2024 12:17:11 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1729019846; 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=xMk7NYWnpFsmIrjE2x+tJklQeOWwKwQSoxh5vfQIXC8=; b=heRGDCJAruY94iowmaFXuDd8xlyZiFBCY228BaF4OWzjHfLsVrenr9Qbx09qL/f47NgJaY 2oMDoAuch5zt39oON/DGkaGdVJ86aOT2bj67BaHQcmBJMmoFoJEp4Mc77zH4PPxkIhSbPJ LoFzp91AIil1NCF4wGgyFdT5q2NjMnk= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: Joanne Koong Cc: Miklos Szeredi , linux-fsdevel@vger.kernel.org, josef@toxicpanda.com, bernd.schubert@fastmail.fm, jefflexu@linux.alibaba.com, hannes@cmpxchg.org, linux-mm@kvack.org, kernel-team@meta.com Subject: Re: [PATCH v2 2/2] fuse: remove tmp folio for writebacks and internal rb tree Message-ID: References: <20241014182228.1941246-1-joannelkoong@gmail.com> <20241014182228.1941246-3-joannelkoong@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: BFE1840023 X-Stat-Signature: aeawtpbxdbtie4ygcq63cedhhp7a7igg X-HE-Tag: 1729019839-482886 X-HE-Meta: U2FsdGVkX1/+cgFbCIAwKf1UTTTNOM5MOb/P+qvLnh6vr9POoP8jPulZC6antVlqOmaIGaGBiYsuxN/CJ1TwBrgk/osJuazMyP+65Sii59Aj9jtPF2aOtXTu1bgo/iJF/9jPyBcFC4i64LVsA/CWbR9IIZlCuLjzwVKMTmF6+9p54o+JUiOcQwYDTKUiVIdRdm/STswCDio3M5Ee5JquZFOKRl4uktpIsT7dXoNDOMc0A4o0j1+4jKWMciapapDn8ush8N8VKxL/ESpOilXEugtodRWk7MvKBQ5b7UGxzKAcnXMkDJpDaTi0/UyUqr3w15P9J8ot6Spx2q7+qrq0UfHF2rQmz5kyWO7p1WXEm1mhW9fAjBWvbpS3JRmqiWTxfd3K14b7BJKTRPlbfhwsjgkshnVGVeYxN99qefqi4Wrgb5umgXzT7OfRLYjjSDV4GstysvK8O9KuWK3B6CGfORPsikWDQitce21GZllrB1bUAoacxzNef4oGrnSXEklnUjYuc2bYCngS3vcSCrEeoEmzmXl1neW85+e+fxlql14FD/tT53uSPWGWsNnEIUBcvSVFhS7xnmZfFAGA1vb2XhD7Il/N0PMnFFFSjpKW/Oi4c7XmbXx+9UJYEh2PCqReT02CZrFj80GOFAH+uzyr2ZPuRuDM4oYBfa1DlxNQamkjL7pz/i059r7x9klMJHxF/ZpKn2L9vb2iZfp9OGaqkZ1ZS8OAweHRYxtVEM5AMwD5VHqbe6j9a9FUYWde7vj4M6v4RUT4KSAYU3xGMhdVWaRJ+CXzwUlnK/1drJ3stdD2LaLaISP3sIoSP05BE/1BxIMJHDFEEEVN3e0F6agXO1kzhasSF7XJqbkuZQwrliUDSeIRYuWestqGttOLoCDqdgAbvbtEiIL6JW3gQOINvJTEcoMS6pMpGSi75Tx0vsLKDqBA/LELsbJZ5wZa0jmPzXlsLlb7vAANIDqTPMK Ldue77Ii nExvWW+KhyBYolduOsIuhMnxXlWawdZat+fzwQsViqtefc5oVdQTN9QbDGk0DMOTkn/HfG13x7TqNrLSDdTmbeM2Xz6GvdQgwtxB3Bjaq+usXd+pqGXbN3RY1NzdWQqwTV2S36nnpVHPREstqLLPmKtu2AMdzJBOI9Di6Yuv/tBkg/8Pe17fMOaq73lIkN60uU9HA 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 Tue, Oct 15, 2024 at 10:06:52AM GMT, Joanne Koong wrote: > On Tue, Oct 15, 2024 at 3:01 AM Miklos Szeredi wrote: > > > > On Mon, 14 Oct 2024 at 20:23, Joanne Koong wrote: > > > > > This change sets AS_NO_WRITEBACK_RECLAIM on the inode mapping so that > > > FUSE folios are not reclaimed and waited on while in writeback, and > > > removes the temporary folio + extra copying and the internal rb tree. > > > > What about sync(2)? And page migration? > > > > Hopefully there are no other cases, but I think a careful review of > > places where generic code waits for writeback is needed before we can > > say for sure. > > Sounds good, that's a great point. I'll audit the other places in the > mm code where we might call folio_wait_writeback() and report back > what I find. > > So, any operation that the fuse server can do which can cause wait on writeback on the folios backed by the fuse is problematic. We know about one scenario i.e. memory allocation causing reclaim which may do the wait on unrelated folios which may be backed by the fuse server. Now there are ways fuse server can shoot itself on the foot. Like sync() syscall or accessing the folios backed by itself. The quesion is should we really need to protect fuse from such cases?