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 23BE5E7718A for ; Thu, 19 Dec 2024 17:15:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A41B46B0083; Thu, 19 Dec 2024 12:15:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9F22C6B0085; Thu, 19 Dec 2024 12:15:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8BA3B6B0088; Thu, 19 Dec 2024 12:15:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 6DCE56B0083 for ; Thu, 19 Dec 2024 12:15:03 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 19D7D141307 for ; Thu, 19 Dec 2024 17:15:03 +0000 (UTC) X-FDA: 82912357836.10.F9AC508 Received: from out-179.mta0.migadu.com (out-179.mta0.migadu.com [91.218.175.179]) by imf05.hostedemail.com (Postfix) with ESMTP id 7ECFA100017 for ; Thu, 19 Dec 2024 17:13:57 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=mFAxqs9r; spf=pass (imf05.hostedemail.com: domain of shakeel.butt@linux.dev designates 91.218.175.179 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=1734628485; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=EeFJTG6jg/QfGCeD5x2h9WUaphItSLBzS2trrpbjGwA=; b=ersKFoYAtyAhb/NA0ISI8KLfgxU35eDzdHrd53ryW2cP6N6eVYdF7oa8SUVwqQCHIqaDQN bGPVyhXUvnwnzuciP8zVpW/A0Gvlna13GwzQ2r8y0YFAEc/MqWAcmUygg84i+OSc4ZcUu5 6S6Q5jR7uCUPyYK9zB8z3967nzfMBEw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734628485; a=rsa-sha256; cv=none; b=iF+D9ZLOkWl/nMi5dc/mJ5q+0tKq2AUXIQZoNov1uyrH+BEiLD9NVBG1gU5Hc0/IdeH5g9 TV1K83Rv2pcOknmyTxH0PPYvq0Yo1+B9jkFGfL/oXPSoXmLFWjmO4doWmhYYH73OAIH2vi TIKP4B6GROAakf8q1nUz8FVWTjvePM0= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=mFAxqs9r; spf=pass (imf05.hostedemail.com: domain of shakeel.butt@linux.dev designates 91.218.175.179 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev; dmarc=pass (policy=none) header.from=linux.dev Date: Thu, 19 Dec 2024 09:14:51 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1734628499; 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: in-reply-to:in-reply-to:references:references; bh=EeFJTG6jg/QfGCeD5x2h9WUaphItSLBzS2trrpbjGwA=; b=mFAxqs9r4fwNaYbTrftZXM71IkL/Y+eDsf28w5XiitYUr7TloMku1eHK2DzCPg+Pl9bv/P D6hGZA2YTNb7EqlP3x9moAN2gc1+r+Ui+4qCBn7SMewNyIRV8BLH8ubks2NqrDSTvUZzJ4 PUw3Xepne2lJDgk29j5ZI9B16yILsb4= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: David Hildenbrand Cc: Zi Yan , Joanne Koong , miklos@szeredi.hu, linux-fsdevel@vger.kernel.org, jefflexu@linux.alibaba.com, josef@toxicpanda.com, bernd.schubert@fastmail.fm, linux-mm@kvack.org, kernel-team@meta.com, Matthew Wilcox , Oscar Salvador , Michal Hocko Subject: Re: [PATCH v6 4/5] mm/migrate: skip migrating folios under writeback with AS_WRITEBACK_INDETERMINATE mappings Message-ID: References: <20241122232359.429647-5-joannelkoong@gmail.com> <43e13556-18a4-4250-b4fe-7ab736ceba7d@redhat.com> <968d3543-d8ac-4b5a-af8e-e6921311d5cf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <968d3543-d8ac-4b5a-af8e-e6921311d5cf@redhat.com> X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 7ECFA100017 X-Stat-Signature: amx8r6mcejynj3qwgtfu1bjxczptqzaq X-Rspam-User: X-HE-Tag: 1734628437-126528 X-HE-Meta: U2FsdGVkX1/ss0zJI+503tJ/ZqyljfJOsm1dLHV4pwEnYaICqiNxkTVJ4rZyV4LUd6HC0JsOWql7MjdeNO0EMBj+jCObRCNgOsZcdwz30fo6pZfnDj7S7vKjDG7uBseDBxAmaVyFzLV/81b0bRA161D+PWALwHK5MGNcKwt86BsX0K8fzg5FAuYhQ3zDSyF4y0VvUWxPKjoVJFKJVEIxfIPdY9eaThVbDP07zdwAsR6z7bbn1BxvSu5607t4z5LOFyhVTHgEzA6j8JJTaAyNjatjswaJ5QoPo9lld1ka2amAWBwrtkIKE6HBiZBrxywrXNuQVODjiTrbXqLTGVLhkMgLHS6F/IjpetR26e1l13WMUGRVXpAe3WnxWL5AQ4YODi7rs2PBzpcRM34QMHXqfdE8FLOEYUYlOoMAvYKyh5drCsHiGPzvj/Y6i33O5jAu6jFuI+FLx3D9zhuUYFQS0rnl5O6Xej5JLvCCd/x0hbItiqobSR21qo3fhhX3Ic2A/XZ5K8P/g4dXm2zsqK1xsSD3FAJoyfyFUcxzLL3asDwe9DE3fJ8AS71rUrr9NqsLm6cc4H5FQIHsdAp5OvWYIiIfQPIhBQ3urDIpnj69RE4SL/yLPcBAELjOD011UEdPPL0grWl3+NTVj4k2+ANydiFfY2KHNzrB2PYvriI702Ysv+tGE8JvsKgKDUcyojNPwvkCUApk1oWmdJ27XCBnjZUy13Mz10QExh6N6r0ocXSxVcXW5nYQIbFdNfyVC47piCdbCrvA2u+5fk8G0r+17ukOKN379XVqfDxvg/MA+FWC3HU8GyK9UEVNzhqu2CIpod/hqRWKK+QNngiy+WIw9OPQFkpvqTsG7xtSegor9oJfBczmQbx/tXiXTzjjqipKAicyvyCxScy5jsXG1DnFnQp3ISVgLlOVpQgYm/cAruFfk1sV6G3aGK22+qPQwn3ogwi0PfuoCq0jJRURP7c uI1Sh0Jy bpxvqePPGhZ1kCQbbdRer5px/t1eUbvd1TIEMxP9PZJNYSiCBM/F8Rnn7FbJPAOKbhIWFhVT7s9xLUgSIDBU2Is+ZKK4qeICQjZhWAPiESl7OYZSul8brjGgSSM19a8Iy1+E0MjfRlbD3gb3EF+uT9bmZnce1QJTfJViLQL7mdhPPyw/2B6MJifqVlFXRx3MtXChY X-Bogosity: Ham, tests=bogofilter, spamicity=0.000016, 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 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?