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 899A6E7718A for ; Thu, 19 Dec 2024 17:40:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0E66E6B007B; Thu, 19 Dec 2024 12:40:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 06F9B6B0082; Thu, 19 Dec 2024 12:40:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E2AF66B0083; Thu, 19 Dec 2024 12:40:25 -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 C14796B007B for ; Thu, 19 Dec 2024 12:40:25 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 6A8E980125 for ; Thu, 19 Dec 2024 17:40:25 +0000 (UTC) X-FDA: 82912421508.06.D022CD6 Received: from fout-b3-smtp.messagingengine.com (fout-b3-smtp.messagingengine.com [202.12.124.146]) by imf16.hostedemail.com (Postfix) with ESMTP id 59BE0180005 for ; Thu, 19 Dec 2024 17:39:49 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=fastmail.fm header.s=fm2 header.b=h+cllVAO; dkim=pass header.d=messagingengine.com header.s=fm1 header.b="X Fo0tbg"; spf=pass (imf16.hostedemail.com: domain of bernd.schubert@fastmail.fm designates 202.12.124.146 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=1734629986; 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=Y9Y+kKXxjZpSp8HssmlsmHA5dEiDkW3vB5fHli9Q5Ig=; b=5xp+4c+x1JNmmh3Anx9gvZWxeNk64F3gUwbxOkg/0/ZU0tSTwrBWZ+p0feZjzVvGoS3Lo3 asYMUZ2dOGJVfsJ+8jQrIOtMo7veuAwjOrAspATMFgBzKHd6PjzdHyEe/4he0z/yaY8FHr BNh+nfrH8YoedpmT47p2awB6R+ZtsXo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734629986; a=rsa-sha256; cv=none; b=M2eeAYKXwk2Cto+ax/D6G22D6uLzDAFPSTdaPA4OkaVy0Da2HcCj4xJAr4hQnpQ/XSh//U mKOc2QtDtWtBQ+H4twwy9CJZHsCdoTWSwk8lRVwLpAjno9Jr5p0kdlR8/IwiyKnk24lkwE JajgWKd4PSjlPADdUf8QPhImx+/B984= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=fastmail.fm header.s=fm2 header.b=h+cllVAO; dkim=pass header.d=messagingengine.com header.s=fm1 header.b="X Fo0tbg"; spf=pass (imf16.hostedemail.com: domain of bernd.schubert@fastmail.fm designates 202.12.124.146 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.stl.internal (Postfix) with ESMTP id 419DE114013A; Thu, 19 Dec 2024 12:40:22 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Thu, 19 Dec 2024 12:40:22 -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=1734630022; x=1734716422; bh=Y9Y+kKXxjZpSp8HssmlsmHA5dEiDkW3vB5fHli9Q5Ig=; b= h+cllVAOGqTEri6hlKj6YRRwh6MwrC9WVMXJL1fj+IE40nDCL86xDHnY/edNCoJh zDlXU8ORctONnh0wAVEhlop1vFtdmFhTvcMi/vyjDc5T4ZcZK4XCSX1K3UUv2p/M d/1B6ERCuAHzaPtdeq0H/q6tf6NsN1GGdwa91S3kYMpMUVx59hieWTHXVNl1M0oP 7c9hlZFn+0r8qYqib38PLJ0xaT8StEzb6VSLzt5ruLd6vY4clApUy8+mvrjzXqiM d/3MnmD6FcdTUHHqpPqxtWD42v9Y5T+PO3FK0HWpVDCqaWMBEFwRQbwePKMkhrLB qE1+kVxChTq5M0ZtjJtNag== 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=1734630022; x= 1734716422; bh=Y9Y+kKXxjZpSp8HssmlsmHA5dEiDkW3vB5fHli9Q5Ig=; b=X Fo0tbg2ek9xd7c4RFkCF5PNO/zjILzW9Lyf8DciwdMcLTFqK7EBmTSgLxaStmNpS vTip0DceF6OIMaZRyv2LkALi2DlH3oCQP8FVxd10zFydES6v3iRzkUvlp2uPrIyR aEUUC6uNs5sxruvpVVHnvsdmQ9o3XNpC8woxBq679kcQUtZnLz6xjK4Pkih4A22Y Yf5GIb3x+vKXIv5TlJ1+Eq6RK3Vy5eICdPJFFZZBHnDH0k076vf4VIuVldIkfKvM 5tox99XvM0uz25Nc3fFxjDWivAQYQF9hufLMyBQzqcr5w+vlTejeyJiKE8q6AVj3 FrAmO5PHC17PAu95KGUjQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddttddguddtudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthekredttddv jeenucfhrhhomhepuegvrhhnugcuufgthhhusggvrhhtuceosggvrhhnugdrshgthhhusg gvrhhtsehfrghsthhmrghilhdrfhhmqeenucggtffrrghtthgvrhhnpeduleefvdduvedu veelgeelffffkedukeegveelgfekleeuvdehkeehheehkefhfeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsvghrnhgurdhstghhuhgsvghr thesfhgrshhtmhgrihhlrdhfmhdpnhgspghrtghpthhtohepudefpdhmohguvgepshhmth hpohhuthdprhgtphhtthhopehshhgrkhgvvghlrdgsuhhttheslhhinhhugidruggvvhdp rhgtphhtthhopegurghvihgusehrvgguhhgrthdrtghomhdprhgtphhtthhopeiiihihse hnvhhiughirgdrtghomhdprhgtphhtthhopehjohgrnhhnvghlkhhoohhnghesghhmrghi lhdrtghomhdprhgtphhtthhopehmihhklhhoshesshiivghrvgguihdrhhhupdhrtghpth htoheplhhinhhugidqfhhsuggvvhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgt phhtthhopehjvghffhhlvgiguheslhhinhhugidrrghlihgsrggsrgdrtghomhdprhgtph htthhopehjohhsvghfsehtohigihgtphgrnhgurgdrtghomhdprhgtphhtthhopehlihhn uhigqdhmmheskhhvrggtkhdrohhrgh X-ME-Proxy: Feedback-ID: id8a24192:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Dec 2024 12:40:19 -0500 (EST) Message-ID: <299ba044-265b-4056-ac85-c5680273feba@fastmail.fm> Date: Thu, 19 Dec 2024 18:40:18 +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: Shakeel Butt Cc: David Hildenbrand , Zi Yan , Joanne Koong , 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> 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-Queue-Id: 59BE0180005 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: kxxzoi1r11gto58t1usgkox1hq9h1yph X-HE-Tag: 1734629989-964464 X-HE-Meta: U2FsdGVkX18n31mmku8KQSpguC4BOz+yzfgJwpT1Edve8CRUSgeGkZfXUqTJZ1E0VYY3Ur++OYzWMWoZ/I1H8KqfUQJTFmmk8sPnHsS0YNRiZoNzReDtifvt1sX006oU7W+vyCz2KCCPRyP2u07qhVbM2mGcsef35afaZ0pDXNi+NA6JU7RQzeFLfiPlofxXzC9p/O1+cW9LE2rvByMAadsyDZT37NIhDGtPmbANHN1W8HBaaoc706yRrhwY7COdDw5hUZZ5HJkbEJvutc3KSNca5g6a4pY9avCuUJRXL70SwBWrY6x6kNPMZiCwoqwziBx2zoBTYqGTlYMtpnkq9SPMpn61wYeUJTojMdvtKFMTbuingj8Ayj3eLEEXpUmS/qEYqQl0LJ8U4hIcaV86TCE+kT7BHcCT5mrjohPZ0jrAfP5sPs6IHajy2GI2tcVrhsDilfv5aysGsnX/SxYkURDQJyRYXgUxjL3w4aApoOOK7YCBsozJFdJGDEZLr3aqpTIQsBSLu32QPvkuBu4+vzu4DbbSsDa4pV0+PGrRov97awysm7Hs1jayyetuvhHEFk/0vQvt42JWtHO/eqxQ7TwY7R3pU2M97I4oU7BW7h66KmqETAVC9odAw3vktwQJ5tjBIV/BS4kKZCVs5A8XPnj0DespraGbgZpl0q6RDwdJjCnpxqdubVCnwN8sHgpYJYUS2+QoYzJz0E6/oDG1A8RdW6mX2P1OUQUHAyGiuOLFESAb1MlNIhwlXvTBqDfyh1rGvUv7PlrdpTRK6Et70EPWFKrut0MwwEsCerNkJ88JbFcCnkUOC06AKAWdH7HOL65tFleudV9VWGBu021sRtssOPUhdbpJ7KCsyfSoMrclQLapddIwBvtmZn4sTcBhFf4zOfR0UYfoBFtafuwiTx4MJ7d/veQZgQNn9vjCaenlHlBBuIqzUfponmcsmJXiu3Tgr2U4W4ZdUoDzYs8 xCoo/ffK ZnFfBwZQt9z3VYMzx+cFhONZS1V3zykL0U1KO529GbT2NN3SAoJHLJsoVhvEh+ow0lQBRd9W65KQMynmTbY/dRHaD/H6iTmbi7iGJpWrVARK1cMeWUVoiFwXjlahyZaTIf98y1kNHxvY2t4P/9r4iL2OrGFgRzOnjz9wbWQP7aLDzHlce3LppRZHDMXNkeLQz9dFAltDwH3Ph1C7/0LoLVBuHCz82I2Acqcv1U8MH4VxP21PG7B7TuqdZbDLh71MvfX+3fnMMRNfpj8zKJVkGdlAZ0NZdZ7PwMiGqki2yZZ745QCYWQbYNMyH2rz7wk6/x4IpJDtcFq2sFsjofo16WOVQBlPBvl9yFREVZWjjEp2y7mxlpdGL00RPPBaIfiXa5yy2so/kRZbWXRIOsX9WTtwwUezaRrjXehSkABKjffYWURhHYbAam788U3iJ8ZMd8v4cf6odkY4RCH7IdrQW2uWnGQ== 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:37, Shakeel Butt wrote: > On Thu, Dec 19, 2024 at 06:30:34PM +0100, Bernd Schubert wrote: >> >> >> On 12/19/24 18:26, 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? >>> >>> Yes, for example causing harm on a shared host (containers, ...). >>> >>> If it cannot happen, we should make it very clear in documentation and >>> patch descriptions that it can only cause harm with privileged user >>> space, and that this harm can make things like CMA allocations, memory >>> onplug, ... fail, which is rather bad and against concepts like >>> ZONE_MOVABLE/MIGRATE_CMA. >>> >>> Although I wonder what would happen if the privileged user space daemon >>> crashes  (e.g., OOM killer?) and simply no longer replies to any messages. >>> >> >> The request is canceled then - that should clear the page/folio state >> >> >> I start to wonder if we should introduce really short fuse request >> timeouts and just repeat requests when things have cleared up. At least >> for write-back requests (in the sense that fuse-over-network might >> be slow or interrupted for some time). >> >> > > Thanks Bernd for the response. Can you tell a bit more about the request > timeouts? Basically does it impact/clear the page/folio state as well? That is just an idea, needs more discussion first. Just sent an off list message.