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 9DE4BE7718B for ; Sat, 21 Dec 2024 21:59:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8D0576B0082; Sat, 21 Dec 2024 16:59:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 880426B0083; Sat, 21 Dec 2024 16:59:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 721286B0085; Sat, 21 Dec 2024 16:59:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 52B996B0082 for ; Sat, 21 Dec 2024 16:59:32 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id C3AA91401FD for ; Sat, 21 Dec 2024 21:59:31 +0000 (UTC) X-FDA: 82920331956.07.A8298E9 Received: from fhigh-a3-smtp.messagingengine.com (fhigh-a3-smtp.messagingengine.com [103.168.172.154]) by imf26.hostedemail.com (Postfix) with ESMTP id 725D6140002 for ; Sat, 21 Dec 2024 21:59:02 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=fastmail.fm header.s=fm2 header.b="h/l26oJM"; dkim=pass header.d=messagingengine.com header.s=fm2 header.b="B oW6RJN"; dmarc=pass (policy=none) header.from=fastmail.fm; spf=pass (imf26.hostedemail.com: domain of bernd.schubert@fastmail.fm designates 103.168.172.154 as permitted sender) smtp.mailfrom=bernd.schubert@fastmail.fm ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734818336; a=rsa-sha256; cv=none; b=t1QdT/nV1zWPBGXpNpkU2RbSoZzYujxjORjbagujuU+JdjcvYSIHPxvT37qBM6LCTWZHpm MZkpVPlitYCdppRzZZlO/SK+OdqlDP0zvCOezDx2mbLIS9pvA8Wsen38k0Dc53ZOEo8KtH sY++7jJ3pSFkozXwYthYrqaBvilPHZc= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=fastmail.fm header.s=fm2 header.b="h/l26oJM"; dkim=pass header.d=messagingengine.com header.s=fm2 header.b="B oW6RJN"; dmarc=pass (policy=none) header.from=fastmail.fm; spf=pass (imf26.hostedemail.com: domain of bernd.schubert@fastmail.fm designates 103.168.172.154 as permitted sender) smtp.mailfrom=bernd.schubert@fastmail.fm ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734818336; 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=sMGbqJqaLo+swNjh111fv03CGQ/wQb7AIIBGCNupw9o=; b=ERWIwnXUi6zDFH1k+4I8mSGXxAAgt8J870UTSn3x//ho7vWCnOUyoT/qxgO5p0fWPGUBbn xB51sIpmikkxQMyr6y4m+H8erTJ512+jvaAt5MGPv0dP38X1TYzn70+amouEa5I0BGYcF/ LMbhAXWLKsKyN/b3/rNLwG53koZWxIc= Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.phl.internal (Postfix) with ESMTP id 316781140101; Sat, 21 Dec 2024 16:59:29 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Sat, 21 Dec 2024 16:59:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1734818369; x=1734904769; bh=sMGbqJqaLo+swNjh111fv03CGQ/wQb7AIIBGCNupw9o=; b= h/l26oJMT2ZaFKN2+ZqbphzoibEwtsEn0NsE+l+2Bhd62PbJZUM2+928gwAEN9e/ EIqabgFPucqqyVe3KoOyP914HV0h71oBZsdtaKLjrydYPGNejE8JrnRCTm03hG6N dMe54mvONLV8NkulpcBjHV78MGZ6xpwdqtRd8xY0nX9WckbJ2Vwp5dmqKLj8LnLE VOxsZE/UPxqlljjGNYVeSX0BleT6jH3BQHLNEHO7Zz1xTW/1gIWyr/YBcPr1/qPh ORGn0Ar9r1FcfWwJ7czl89nDW3dAuGaVn1XBruIpKUNMccQDF0kJwnaPZPE/Mtxi +4/JuD5tBP4phDT4AFtGJQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1734818369; x= 1734904769; bh=sMGbqJqaLo+swNjh111fv03CGQ/wQb7AIIBGCNupw9o=; b=B oW6RJNc+9nNxY39lNtBT/Do1thudEp1EC1xnSxUq1cFip5nyxbojDJJ8IgYPt422 0eZihszioJVi9rpK4psM/PGBvLZnY5KhaHBZJwOjxqFxBj2D4QgXb0gyxj5i15K/ 1QvHpDIjLMz4uiCMbhpNU2iFhNg3JE6n2czxO0xzx/nTqpbVZNMF7XlRO84Rrs5E zd4P4y//QXgLL9L3DhlzzwcZC7a6sKiuurUCmoQFfOGVOERnRy4FvGa8iGU7+E3X IfEvMX8TP4bXq6YpdjPBOCcWwRv58JQPHTNAD8Kb64984GPEFrhwSPCqwiAOv5Oa eBNIrJ6CLjZ9jfJ+RNM2Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddthedgudefudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthekredttddv jeenucfhrhhomhepuegvrhhnugcuufgthhhusggvrhhtuceosggvrhhnugdrshgthhhusg gvrhhtsehfrghsthhmrghilhdrfhhmqeenucggtffrrghtthgvrhhnpeduleefvdduvedu veelgeelffffkedukeegveelgfekleeuvdehkeehheehkefhfeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsvghrnhgurdhstghhuhgsvghr thesfhgrshhtmhgrihhlrdhfmhdpnhgspghrtghpthhtohepudefpdhmohguvgepshhmth hpohhuthdprhgtphhtthhopegurghvihgusehrvgguhhgrthdrtghomhdprhgtphhtthho pehjohgrnhhnvghlkhhoohhnghesghhmrghilhdrtghomhdprhgtphhtthhopehshhgrkh gvvghlrdgsuhhttheslhhinhhugidruggvvhdprhgtphhtthhopeiiihihsehnvhhiughi rgdrtghomhdprhgtphhtthhopehmihhklhhoshesshiivghrvgguihdrhhhupdhrtghpth htoheplhhinhhugidqfhhsuggvvhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgt phhtthhopehjvghffhhlvgiguheslhhinhhugidrrghlihgsrggsrgdrtghomhdprhgtph htthhopehjohhsvghfsehtohigihgtphgrnhgurgdrtghomhdprhgtphhtthhopehlihhn uhigqdhmmheskhhvrggtkhdrohhrgh X-ME-Proxy: Feedback-ID: id8a24192:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 21 Dec 2024 16:59:25 -0500 (EST) Message-ID: <166a147e-fdd7-4ea6-b545-dd8fb7ef7c2f@fastmail.fm> Date: Sat, 21 Dec 2024 22:59:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 4/5] mm/migrate: skip migrating folios under writeback with AS_WRITEBACK_INDETERMINATE mappings To: David Hildenbrand , Joanne Koong Cc: Shakeel Butt , Zi Yan , miklos@szeredi.hu, linux-fsdevel@vger.kernel.org, jefflexu@linux.alibaba.com, josef@toxicpanda.com, linux-mm@kvack.org, kernel-team@meta.com, Matthew Wilcox , Oscar Salvador , Michal Hocko References: <43e13556-18a4-4250-b4fe-7ab736ceba7d@redhat.com> <968d3543-d8ac-4b5a-af8e-e6921311d5cf@redhat.com> <7b6b8143-d7a4-439f-ae35-a91055f9d62a@redhat.com> <2e13a67a-0bad-4795-9ac8-ee800b704cb6@fastmail.fm> <2bph7jx4hvhxpgp77shq2j7mo4xssobhqndw5v7hdvbn43jo2w@scqly5zby7bm> <71d7ac34-a5e5-4e59-802b-33d8a4256040@redhat.com> <9404aaa2-4fc2-4b8b-8f95-5604c54c162a@redhat.com> <61a4bcb1-8043-42b1-bf68-1792ee854f33@redhat.com> From: Bernd Schubert Content-Language: en-US, de-DE, fr In-Reply-To: <61a4bcb1-8043-42b1-bf68-1792ee854f33@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Stat-Signature: ynw5ag5eyriq4ycbi6hjp5316dyhdimi X-Rspam-User: X-Rspamd-Queue-Id: 725D6140002 X-Rspamd-Server: rspam08 X-HE-Tag: 1734818342-619746 X-HE-Meta: U2FsdGVkX18zYuzRj6GqGy4hOjpPRHsk2GwWJOczf05cSG1rBmNl+N0h70VcqAfcBxybu8cla+YM+xCwnvakRzH/NnzDIUPV3fAU7gEGVg4pfnQCqVW0wEKzeiNm34R7jJGOQtssvK+Byu8SrbDe4ENTn4Vzeg83/sTXim+G1iKRCf3wbyIreJNgTLETn4sk5e1Qo3j22Au2kzu9yvoGmrVYEKD36Mz4kaVtFbj+gsBpUCZp8flDqZ6WujlgGqQwkFPh5JsBbpo9az6CldTOhK6GyCRHPuptlIYYh1CvwBZtzfOlf3IiFmZ/R4Q0GsYnRfFzIzbV1jiSW3sL2FMKu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YO 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 12/21/24 17:25, David Hildenbrand wrote: > On 20.12.24 22:01, Joanne Koong wrote: >> On Fri, Dec 20, 2024 at 6:49 AM David Hildenbrand >> wrote: >>> >>>>> I'm wondering if there would be a way to just "cancel" the >>>>> writeback and >>>>> mark the folio dirty again. That way it could be migrated, but not >>>>> reclaimed. At least we could avoid the whole >>>>> AS_WRITEBACK_INDETERMINATE >>>>> thing. >>>>> >>>> >>>> That is what I basically meant with short timeouts. Obviously it is not >>>> that simple to cancel the request and to retry - it would add in quite >>>> some complexity, if all the issues that arise can be solved at all. >>> >>> At least it would keep that out of core-mm. >>> >>> AS_WRITEBACK_INDETERMINATE really has weird smell to it ... we should >>> try to improve such scenarios, not acknowledge and integrate them, then >>> work around using timeouts that must be manually configured, and ca >>> likely no be default enabled because it could hurt reasonable use >>> cases :( >>> >>> Right now we clear the writeback flag immediately, indicating that data >>> was written back, when in fact it was not written back at all. I suspect >>> fsync() currently handles that manually already, to wait for any of the >>> allocated pages to actually get written back by user space, so we have >>> control over when something was *actually* written back. >>> >>> >>> Similar to your proposal, I wonder if there could be a way to request >>> fuse to "abort" a writeback request (instead of using fixed timeouts per >>> request). Meaning, when we stumble over a folio that is under writeback >>> on some paths, we would tell fuse to "end writeback now", or "end >>> writeback now if it takes longer than X". Essentially hidden inside >>> folio_wait_writeback(). >>> >>> When aborting a request, as I said, we would essentially "end writeback" >>> and mark the folio as dirty again. The interesting thing is likely how >>> to handle user space that wants to process this request right now (stuck >>> in fuse_send_writepage() I assume?), correct? >> >> This would be fine if the writeback request hasn't been sent yet to >> userspace but if it has and the pages are spliced > > Can you point me at the code where that splicing happens? fuse_dev_splice_read() fuse_dev_do_read() fuse_copy_args() fuse_copy_page Btw, for the non splice case, disabling migration should be only needed while it is copying to the userspace buffer? Thanks, Bernd