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 10909E77188 for ; Fri, 20 Dec 2024 15:26:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 67BA66B007B; Fri, 20 Dec 2024 10:26:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 62B286B0082; Fri, 20 Dec 2024 10:26:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4CB596B0083; Fri, 20 Dec 2024 10:26:17 -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 2FCA06B007B for ; Fri, 20 Dec 2024 10:26:17 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id A8CC0160B1E for ; Fri, 20 Dec 2024 15:26:16 +0000 (UTC) X-FDA: 82915711914.03.DAEDFA3 Received: from fout-b1-smtp.messagingengine.com (fout-b1-smtp.messagingengine.com [202.12.124.144]) by imf22.hostedemail.com (Postfix) with ESMTP id 13E50C001A for ; Fri, 20 Dec 2024 15:25:37 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=fastmail.fm header.s=fm2 header.b=r62Yhda4; dkim=pass header.d=messagingengine.com header.s=fm1 header.b="Y wM2mpP"; spf=pass (imf22.hostedemail.com: domain of bernd.schubert@fastmail.fm designates 202.12.124.144 as permitted sender) smtp.mailfrom=bernd.schubert@fastmail.fm; dmarc=pass (policy=none) header.from=fastmail.fm ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734708342; a=rsa-sha256; cv=none; b=xZHMxs7O2nYU2hzxkw3wO2pF/42aXlb+E0jSQK9tYrVA0Tf1NirVDVfkxKI7U/a4MKpAu+ 7ZvP5BiYMBRw/SN8vY9aOKGbUtF1282r42Qpo/lBglXuaI9VxDfXZCC1oLtRiQNaWkuQcH 8QaIkHy38e97hi8I99vu1l52bWjYlV0= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=fastmail.fm header.s=fm2 header.b=r62Yhda4; dkim=pass header.d=messagingengine.com header.s=fm1 header.b="Y wM2mpP"; spf=pass (imf22.hostedemail.com: domain of bernd.schubert@fastmail.fm designates 202.12.124.144 as permitted sender) smtp.mailfrom=bernd.schubert@fastmail.fm; dmarc=pass (policy=none) header.from=fastmail.fm ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734708342; 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=d/vcyTwwlUfNeJNyTKz54mWlFTaDgsMzYvfaGPggMx8=; b=KcghG2suPNTPU4xvOlpODcxPsSYsOB0s3Xs/g4HyhgwMaQRORSHIynwI2iqSQCLWUGzcmV 1L/4BDq2cbS/mDi4pyOtsFHL3rQUQJvGM1n/D7R/YAFZvtziWeHpSBzy4a4DDy+Pv+CEvk 2N5dycDb9IdDeKXQcpAOJzIQTl6Ceyk= Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfout.stl.internal (Postfix) with ESMTP id DCBE01140186; Fri, 20 Dec 2024 10:26:12 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Fri, 20 Dec 2024 10:26:13 -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=1734708372; x=1734794772; bh=d/vcyTwwlUfNeJNyTKz54mWlFTaDgsMzYvfaGPggMx8=; b= r62Yhda4yKUK2U8Zfk1gX0QIWA2nO6eRfsIv42wyoDctmdoCv6AJ2bWb4oozDguk 89izcpvUBkzb+0ieKXG1auiLQeVrteYLEzv04JZSSQu3PVaq++wjZdmZfzuP5iIF ZhBIsuVlh6bVduO9cXo7kuLVYW6eOqLsGXTkt+boGAt4jOJ5dFiLcy79kCmn7EHr eZAxXdJAJbVu4/TAuPeEiXmw3+6FKm/wwqQNAAmUPX/vYYvNVFzZzUPm8tz9YfE5 p4XiLAv8eoDAPqcj1rF6evZXMbcG15WGKqo5dfT8gyQ5eaPw0TeqXvMAyVNAsjS5 SWZcy3YKIndbIKLx3UjBHg== 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=fm1; t=1734708372; x= 1734794772; bh=d/vcyTwwlUfNeJNyTKz54mWlFTaDgsMzYvfaGPggMx8=; b=Y wM2mpPkXgjg4dTG4t2PKQi8aW4LL6ru9zsDMb7bXmXxll/ZJozWh3xMUmOmqVXor d+B46gJNrJLv+wApkx5LSp9GYOveDKYOtAbU7GAwAinTwICCsCcrIBHWMiFEgx02 GHvojwyvqOJAHLWWRRyR6GoEB+yGzpn76wVUj5dAoSq1X0g5ieKgpcMF9Xcog0yN Cqkktm2+z6N3tNNe8F+ZNcT+8om7oADMWDeQUhWqdgcWICtWOPGhE5G9uGVfsDMv b8yuxzRs53jsBSBEAlc23k8MLyQhU3kBeK6OuM8xPAUFmlHivZeZcrgA8FpcAtkb r11dFiLuPlRDTkQxTua5Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddtvddgjeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdej necuhfhrohhmpeeuvghrnhguucfutghhuhgsvghrthcuoegsvghrnhgurdhstghhuhgsvg hrthesfhgrshhtmhgrihhlrdhfmheqnecuggftrfgrthhtvghrnhepvefhgfdvledtudfg tdfggeelfedvheefieevjeeifeevieetgefggffgueelgfejnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepsggvrhhnugdrshgthhhusggvrhht sehfrghsthhmrghilhdrfhhmpdhnsggprhgtphhtthhopedufedpmhhouggvpehsmhhtph houhhtpdhrtghpthhtohepuggrvhhiugesrhgvughhrghtrdgtohhmpdhrtghpthhtohep shhhrghkvggvlhdrsghuthhtsehlihhnuhigrdguvghvpdhrtghpthhtohepjhhorghnnh gvlhhkohhonhhgsehgmhgrihhlrdgtohhmpdhrtghpthhtohepiihihiesnhhvihguihgr rdgtohhmpdhrtghpthhtohepmhhikhhlohhssehsiigvrhgvughirdhhuhdprhgtphhtth hopehlihhnuhigqdhfshguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghp thhtohepjhgvfhhflhgvgihusehlihhnuhigrdgrlhhisggrsggrrdgtohhmpdhrtghpth htohepjhhoshgvfhesthhogihitghprghnuggrrdgtohhmpdhrtghpthhtoheplhhinhhu gidqmhhmsehkvhgrtghkrdhorhhg X-ME-Proxy: Feedback-ID: id8a24192:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 20 Dec 2024 10:26:09 -0500 (EST) Message-ID: <128e28fd-4b08-4c6a-802d-f3a080f21452@fastmail.fm> Date: Fri, 20 Dec 2024 16:26:08 +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 , Shakeel Butt , Joanne Koong Cc: 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> From: Bernd Schubert Content-Language: en-US, de-DE, fr In-Reply-To: <9404aaa2-4fc2-4b8b-8f95-5604c54c162a@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 13E50C001A X-Stat-Signature: owezh7r9shok6cr4i4wumu5k1w9ejjti X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1734708337-419038 X-HE-Meta: U2FsdGVkX1+l5qcVgrbJMfIP0q2XPipET4eOQMY5K0G0i+m4GLPymZBYi3//nQHukN4Sv0AI+tS6ZpnStUYBmpXo7lyaFyJP+2O9E8FoDYverlpFDfwHFEbmSRzorV6jtZ4ncGdrcRuc3ffBmfjw3wG9ngSLrLiIwK409gRxa9SiGNVEfkZ8cE6IyNsa+9T0rXph8wBhzKtsDqAKftGsLiWvCgo5kz58al8Y6rbfwrV212XqQOyB3WtphTKGseRNAo33bEMlGQZa7qjQpCyaAmUK/U+lmqBp0piqVJGhMkcJ6zaDyqCBGjVJzL3A5l03ejFUg/ePnf8hZ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JH2VNH1DL00Lcv6Olic5NNFL1DEJ32a7Bo 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/20/24 15:49, 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. Yeah, fuse_writepage_end() decreases fi->writectr, which gets checked by fsync. Knowing when somethings has been written back is not the issue, but keeping order, handling splice, possible double write to the same range (it should be mostly idempotent, but is that guaranteed by all servers), etc. > > > 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(). Yeah, that would be a minor improvement to the overall issue ;) Re-queue issue. > > 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? That sends background requests - does not get stuck. Completion happens in fuse_writepage_end(), when the request reply is received. Thanks, Bernd