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 04468E77184 for ; Thu, 19 Dec 2024 18:04:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8E4F46B0083; Thu, 19 Dec 2024 13:04:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 895266B0085; Thu, 19 Dec 2024 13:04:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 70ED56B0088; Thu, 19 Dec 2024 13:04:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 4DBC66B0083 for ; Thu, 19 Dec 2024 13:04:49 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 700201C5CD3 for ; Thu, 19 Dec 2024 18:04:48 +0000 (UTC) X-FDA: 82912482702.19.2957247 Received: from fout-a8-smtp.messagingengine.com (fout-a8-smtp.messagingengine.com [103.168.172.151]) by imf12.hostedemail.com (Postfix) with ESMTP id 9F4634001A for ; Thu, 19 Dec 2024 18:04:30 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=fastmail.fm header.s=fm2 header.b=d9CIaDWJ; dkim=pass header.d=messagingengine.com header.s=fm1 header.b="C Ap5VtB"; spf=pass (imf12.hostedemail.com: domain of bernd.schubert@fastmail.fm designates 103.168.172.151 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=1734631463; 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=sWjATxaJ8q3eyt4L+jK5qOE2YdkkkJ/AyEsTG/OuyMk=; b=6/DKAWd5uu6BWCjnBo75pI5IXjl8jqHLpa6id7A65HdWLRErQLMDnVuORG2Z/dbpmc3xiB 3PxISxY7mtZOWR6dnHQ6kIi5zJ5SDsUOkC8lgLUT3DflmzA/3ypO5ZWI+1Ew5dMVlU92mT awIgiWBKc9Xt1+bzWDtFB1CuNxoP/yQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734631463; a=rsa-sha256; cv=none; b=KA1xKekRwIhVHFiQicEErB1z0HTPUh1Y+Sn4IB09lVC3b5ja7Ldml6Ku65GQmS64EB9Ng0 iXY8rF/l74u37P04kogrEnFgsMZepdlPEAQnbsxhH622uqIJaKEEKGE4r+KLYpR0qMVUuy /bSVMqYCD3wMSzZZOJwpFUbWnSqdi2E= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=fastmail.fm header.s=fm2 header.b=d9CIaDWJ; dkim=pass header.d=messagingengine.com header.s=fm1 header.b="C Ap5VtB"; spf=pass (imf12.hostedemail.com: domain of bernd.schubert@fastmail.fm designates 103.168.172.151 as permitted sender) smtp.mailfrom=bernd.schubert@fastmail.fm; dmarc=pass (policy=none) header.from=fastmail.fm Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfout.phl.internal (Postfix) with ESMTP id 7498413800CF; Thu, 19 Dec 2024 13:04:44 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Thu, 19 Dec 2024 13:04:44 -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=1734631484; x=1734717884; bh=sWjATxaJ8q3eyt4L+jK5qOE2YdkkkJ/AyEsTG/OuyMk=; b= d9CIaDWJEyigZUwnTrzSJR7+7U9cRXDVUwVXFzWcpt3cXiJse8agNeG0NHsxIE0l 5U1bnRAafnk4qNCzscpfVe+0ZB523ZVRlsHbkO02GhtUhef7yUrcW8xt+ZTxje7d 502xiH+0RIVc65ycD6cplbd0wYCpFFsFcgEvme9NK3y6Kzq5KkmpQPSWi61hFew9 XEcrzhCmEMcwrLW0H5VX4ANz2EpYWKCjce5ewVCKaOKDaBRJ41nC08rN5Ayjq/9p T32+lx+YcpcZE4qYdQItYBh/ZhTMG/VMhwhQseHDG1A3tmpuS8Jz0G8Xb1EnzWB+ 9avZgwiPakmfr07MIUc3Kw== 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=1734631484; x= 1734717884; bh=sWjATxaJ8q3eyt4L+jK5qOE2YdkkkJ/AyEsTG/OuyMk=; b=C Ap5VtBHYLpzaqQDrx8VHvMJFFhzzNrFkl5myiJPZzyHllcC82Xm8PF8m0K/EtM66 h26YjQVOW+fb/VFoaYzxsdkrKWK61FDif6C9nMGGzGFOU073TA1MW/lEDagFtxKV RQIEe+XmYXjr+efs/dh4MkgEwwWHaCdI3U+DCMkSmUzysZG0e+0A9zTYkwSft2sb eEx9cqTNoBAKn/e51aamwJ4QzsdWKEiai1rYANxxvuiC7oNTOkw5YLC+6OYiijyJ bIfmsJ6uYevlCNU6OgQHoSsCraoI8CN5jARMKcUDNjV2Ps49GJFLQPUfIzJ7BBEO ac+qR7ipo+DNKeiPCB2sQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddttddguddtiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthekredttddv jeenucfhrhhomhepuegvrhhnugcuufgthhhusggvrhhtuceosggvrhhnugdrshgthhhusg gvrhhtsehfrghsthhmrghilhdrfhhmqeenucggtffrrghtthgvrhhnpeduleefvdduvedu veelgeelffffkedukeegveelgfekleeuvdehkeehheehkefhfeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsvghrnhgurdhstghhuhgsvghr thesfhgrshhtmhgrihhlrdhfmhdpnhgspghrtghpthhtohepudefpdhmohguvgepshhmth hpohhuthdprhgtphhtthhopehjohgrnhhnvghlkhhoohhnghesghhmrghilhdrtghomhdp rhgtphhtthhopegurghvihgusehrvgguhhgrthdrtghomhdprhgtphhtthhopehshhgrkh gvvghlrdgsuhhttheslhhinhhugidruggvvhdprhgtphhtthhopeiiihihsehnvhhiughi rgdrtghomhdprhgtphhtthhopehmihhklhhoshesshiivghrvgguihdrhhhupdhrtghpth htoheplhhinhhugidqfhhsuggvvhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgt phhtthhopehjvghffhhlvgiguheslhhinhhugidrrghlihgsrggsrgdrtghomhdprhgtph htthhopehjohhsvghfsehtohigihgtphgrnhgurgdrtghomhdprhgtphhtthhopehlihhn uhigqdhmmheskhhvrggtkhdrohhrgh X-ME-Proxy: Feedback-ID: id8a24192:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Dec 2024 13:04:41 -0500 (EST) Message-ID: <7810ab2c-1f80-4c78-9b75-db20a78af5e3@fastmail.fm> Date: Thu, 19 Dec 2024 19:04:40 +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: Joanne Koong , David Hildenbrand 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: <20241122232359.429647-5-joannelkoong@gmail.com> <43e13556-18a4-4250-b4fe-7ab736ceba7d@redhat.com> <968d3543-d8ac-4b5a-af8e-e6921311d5cf@redhat.com> <7b6b8143-d7a4-439f-ae35-a91055f9d62a@redhat.com> From: Bernd Schubert Content-Language: en-US, de-DE, fr In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 9F4634001A X-Stat-Signature: b9ixtzz9tr5q9wodac9co5efg3j1xqn9 X-Rspam-User: X-HE-Tag: 1734631470-594446 X-HE-Meta: U2FsdGVkX19Za15SGRUZL8rZqq7xiSKR+Z958nZAaYsk4GAEU9n7y1oFkpmxTuAleLO9pODGADNHtOcMovCiKEu9nLPhTplsUBMBX+DFoTRixBNMctsFrFWV1Vc8hVSIIesu6A5kLIlfSGiKB9+7fag2pbAyrk/OMJHInOFfArLwzYO/OU2T80urMc/HINC5ovfLi/vY14Jk3X5lonK/VFWeNoCNndO2u4RDkGSdjHbxb47QlxL0hO6Ky4VMZ/3f4VnePSzq3RueFnqf/Qe0ox0/jaZszVw2sDGrLElonefPI6tLT+g5I6a3ksVyCCynL8SmZz9nyYgtpwPgACLRB8EHjVlhR94xx0Q5ACqGjRzqRezznqliQvdVqQ8Zc8x2omOvF0noAmV53hSPOIvdc8wD3pZ9/nCSmtDnTGvPLau9av2OZCxVN5WvTfAbbx2OyH5lS7fN03jJmpIVeZ3XjfYsh8rWDu32H4g0atRAyxjyHt3gIbnB6I9CxXl2WbKzrJsQ8H2CJlw7jE/2L6Ea90awJvaHwCpLxasYnKatgNRQvCQaaiAALi7cqE2rtPcU93TO2UaD/9OQNYhRfidk0Is4mtXcpntpp1urKNrwat2Rz6A8E9DJ5sSLZ3daRnheCRYaF2G0Vwdq6uSBppeJblvQOKjMXl+gksxiZej9fpynLiB9usKMf21hKxGsDVGNlcswU1olfAl4krTioeOadD0SvH5GguMdLtWmaXoRPUovdLnhBDsBy1qZv0GDtawhVZwx29VEt/t1fa+WRRYR9yHTfesC8rEq5jqhK1eIWusl7jEcvSESNTNbXs6FINgzdUpyTc3r9LdwMiHH2iPHYLckjaKVXAb+e2ueIqSSB59ApO1HO0tIYRPrOoah8+lLrcE0QUVhwMxAjiLrnMn5+ZLdq5KehJqmE7pYDRmvdcr6F8sU/5dEHdl98J4YSokb9uinpe1i2m48oO9ThMr Ozp6iTq9 iLdGd3ZCfEF9PUo08ZbcX6fhDDbsnn6QlFKR7H1e69Iqn15fWmDs72m1PnAUC9+ooiJreZjdytHANyM/KBWyU3Q4RZIZjzOPAKOFYAMZU4M+fsfubQXYRYx1NvIizwNoTsYjKqxALMLoRR66fQXqv8URI/5blu1UlXCUILSvpagK3M4xW7ukiF6lVDjfkSpqnhrWt0dL9HRom5TrHB2JE7XxQ2Z2UdhcUDugqK666XugcsGPGtrGiUzTv//HF/7ftcpcQLlIU1A5Tp42BWg9fRGxEOZkrMDsD0/7stxoecEeI5Q3Pi4cS07r7Ng95UqzFKALsR0QeE+VQJ+TyeW9BSpCcAaolKJAvPr4SJpjQ7iaPXGwboIwCylfmdoIJukzgK1psyJYYkrPU8zzczvgE8Soo6E86VppiJcAx+pIsaGXEMyNCmqJ8b+Mdl9dL5OfGreTRyEZWY/O6X6k= 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/19/24 18:55, Joanne Koong wrote: > On Thu, Dec 19, 2024 at 9:26 AM David Hildenbrand wrote: >> >> On 19.12.24 18:14, Shakeel Butt wrote: >>> On Thu, Dec 19, 2024 at 05:41:36PM +0100, David Hildenbrand wrote: >>>> On 19.12.24 17:40, Shakeel Butt wrote: >>>>> On Thu, Dec 19, 2024 at 05:29:08PM +0100, David Hildenbrand wrote: >>>>> [...] >>>>>>> >>>>>>> If you check the code just above this patch, this >>>>>>> mapping_writeback_indeterminate() check only happen for pages under >>>>>>> writeback which is a temp state. Anyways, fuse folios should not be >>>>>>> unmovable for their lifetime but only while under writeback which is >>>>>>> same for all fs. >>>>>> >>>>>> But there, writeback is expected to be a temporary thing, not possibly: >>>>>> "AS_WRITEBACK_INDETERMINATE", that is a BIG difference. >>>>>> >>>>>> I'll have to NACK anything that violates ZONE_MOVABLE / ALLOC_CMA >>>>>> guarantees, and unfortunately, it sounds like this is the case here, unless >>>>>> I am missing something important. >>>>>> >>>>> >>>>> It might just be the name "AS_WRITEBACK_INDETERMINATE" is causing >>>>> the confusion. The writeback state is not indefinite. A proper fuse fs, >>>>> like anyother fs, should handle writeback pages appropriately. These >>>>> additional checks and skips are for (I think) untrusted fuse servers. >>>> >>>> Can unprivileged user space provoke this case? >>> >>> Let's ask Joanne and other fuse folks about the above question. >>> >>> Let's say unprivileged user space can start a untrusted fuse server, >>> mount fuse, allocate and dirty a lot of fuse folios (within its dirty >>> and memcg limits) and trigger the writeback. To cause pain (through >>> fragmentation), it is not clearing the writeback state. Is this the >>> scenario you are envisioning? >> > > This scenario can already happen with temp pages. An untrusted > malicious fuse server may allocate and dirty a lot of fuse folios > within its dirty/memcg limits and never clear writeback on any of them > and tie up system resources. This certainly isn't the common case, but > it is a possibility. However, request timeouts can be set by the > system admin [1] to protect against malicious/buggy fuse servers that > try to do this. If the request isn't replied to by a certain amount of > time, then the connection will be aborted and writeback state and > other resources will be cleared/freed. > I think what Zi points out that that is a current implementation issue and these temp pages should be in a continues range. Obviously better to avoid a tmp copy at all. Thanks, Bernd