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 A3036E77188 for ; Fri, 10 Jan 2025 23:11:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DA4C48D0001; Fri, 10 Jan 2025 18:11:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D2D4D6B00AE; Fri, 10 Jan 2025 18:11:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BA63F8D0001; Fri, 10 Jan 2025 18:11:53 -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 96EB36B00AC for ; Fri, 10 Jan 2025 18:11:53 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 3498E80B1E for ; Fri, 10 Jan 2025 23:11:53 +0000 (UTC) X-FDA: 82993091706.28.1381B85 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf07.hostedemail.com (Postfix) with ESMTP id 63FEC40011 for ; Fri, 10 Jan 2025 23:11:51 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=CSdk5MgV; spf=pass (imf07.hostedemail.com: domain of jlayton@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jlayton@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736550711; 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=czbVdy3WxiecBL8fCBx9iB8CVcUJhmmmUixn0HXvDQg=; b=oFfOm4FDQAFuLx0wIlIDqQfpeqreVMq2JrWuKGYrD+pI/xe0Hkx5tbl+gC5MeBxoX9YMju F2we84PkOzQpNslQL1/2tu1ioA53iQDJciBmAy5IOqAE5XmVTwOu0joEiOy/bu91B1oai0 r6NjStpNo3w0/SX8w2zkX5pWekSFLP0= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=CSdk5MgV; spf=pass (imf07.hostedemail.com: domain of jlayton@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jlayton@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736550711; a=rsa-sha256; cv=none; b=sqIhK3bhmX+RX8nxDdBOxOm7bc2GPuDyyyO9J/+XIo4tK+khsXSyIciuMuIZHkNe/4A+6M YNr0TsQ5GUOZGMl5uGbU0hNptfZcBEHz8DaY1ZNxS20M3qlBzHVKcW51x8+JK//EJV4UgA IsljsFspzQ0EwEzqei8E3o2Uo39AqeI= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 51D975C3BF6; Fri, 10 Jan 2025 23:11:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4683C4CED6; Fri, 10 Jan 2025 23:11:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736550710; bh=MQyUwpBJPgaTQVq7yCIp/tSzPGmKaoXfYB6PZMvpcMA=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=CSdk5MgVXppg3HSynZkeraGsqlyN/jHQhksKvPaWxj8c6pzs1CkDjiZ4wPNSA5vqO 5npHop99qTYvV6M2xmsAjmUOOrIFkx2yym68FOG43TLB6T6deU/JB6pBe9XH4wCsRM /Tq6LgaTVKlAU1YE4B4QS1XL5LQBM/ttHt7x+f7UYLw76zRoEyIqdBEn61T+ZGmPCG xNEZaKxt4xi1xyMiILfDnzVgqNE9uR0eGyBTGDq6xHSFX5ISMSl5YDfcn1xSYS1Fr7 LLNazhCYo92gYOWVRDNo1qjl0fIMTiP/eghGMKIJHHlRTOJ24wWmwzY/HGCAp/U60v pwGGWMoA3DG8w== Message-ID: Subject: Re: [PATCH v6 4/5] mm/migrate: skip migrating folios under writeback with AS_WRITEBACK_INDETERMINATE mappings From: Jeff Layton To: David Hildenbrand , Shakeel Butt Cc: Miklos Szeredi , Joanne Koong , Bernd Schubert , Zi Yan , 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 Date: Fri, 10 Jan 2025 18:11:47 -0500 In-Reply-To: References: <0ed5241e-10af-43ee-baaf-87a5b4dc9694@redhat.com> <446704ab-434e-45ac-a062-45fef78815e4@redhat.com> <791d4056-cac1-4477-a8e3-3a2392ed34db@redhat.com> <1fdc9d50-584c-45f4-9acd-3041d0b4b804@redhat.com> <54ebdef4205781d3351e4a38e5551046482dbba0.camel@kernel.org> Autocrypt: addr=jlayton@kernel.org; prefer-encrypt=mutual; keydata=mQINBE6V0TwBEADXhJg7s8wFDwBMEvn0qyhAnzFLTOCHooMZyx7XO7dAiIhDSi7G1NPxw n8jdFUQMCR/GlpozMFlSFiZXiObE7sef9rTtM68ukUyZM4pJ9l0KjQNgDJ6Fr342Htkjxu/kFV1Wv egyjnSsFt7EGoDjdKqr1TS9syJYFjagYtvWk/UfHlW09X+jOh4vYtfX7iYSx/NfqV3W1D7EDi0PqV T2h6v8i8YqsATFPwO4nuiTmL6I40ZofxVd+9wdRI4Db8yUNA4ZSP2nqLcLtFjClYRBoJvRWvsv4lm 0OX6MYPtv76hka8lW4mn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BhZ/Ab4sph3EaiZfdXKhiQqSGdK4La3OTJOJYZphPdGgnkvDV9Pl1QZ0ijXQrVIy3zd6VCNaKYq7B AKidn5g/2Q8oio9Tf4XfdZ9dtwcB+bwDJFgvvDYaZ5bI3ln4V3EyW5i2NfXazz/GA/I/ZtbsigCFc 8ftCBKZWZmIExheXRvbiA8amxheXRvbkBrZXJuZWwub3JnPokCOAQTAQIAIgUCWe8u6AIbAwYLCQg HAwIGFQgCCQoLBBYCAwECHgECF4AACgkQAA5oQRlWghUuCg/+Lb/xGxZD2Q1oJVAE37uW308UpVSD 2tAMJUvFTdDbfe3zKlPDTuVsyNsALBGclPLagJ5ZTP+Vp2irAN9uwBuacBOTtmOdz4ZN2tdvNgozz uxp4CHBDVzAslUi2idy+xpsp47DWPxYFIRP3M8QG/aNW052LaPc0cedYxp8+9eiVUNpxF4SiU4i9J DfX/sn9XcfoVZIxMpCRE750zvJvcCUz9HojsrMQ1NFc7MFT1z3MOW2/RlzPcog7xvR5ENPH19ojRD CHqumUHRry+RF0lH00clzX/W8OrQJZtoBPXv9ahka/Vp7kEulcBJr1cH5Wz/WprhsIM7U9pse1f1g Yy9YbXtWctUz8uvDR7shsQxAhX3qO7DilMtuGo1v97I/Kx4gXQ52syh/w6EBny71CZrOgD6kJwPVV AaM1LRC28muq91WCFhs/nzHozpbzcheyGtMUI2Ao4K6mnY+3zIuXPygZMFr9KXE6fF7HzKxKuZMJO aEZCiDOq0anx6FmOzs5E6Jqdpo/mtI8beK+BE7Va6ni7YrQlnT0i3vaTVMTiCThbqsB20VrbMjlhp f8lfK1XVNbRq/R7GZ9zHESlsa35ha60yd/j3pu5hT2xyy8krV8vGhHvnJ1XRMJBAB/UYb6FyC7S+m QZIQXVeAA+smfTT0tDrisj1U5x6ZB9b3nBg65kc= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.2 (3.54.2-1.fc41) MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Stat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x+God DH7LKuP1 i1ybMya6VJ78zpijdPAR9sfvC1TKf7tblNVaHvonhN2rPGxSRqB6HzchpB7j0J2rS2C5bajmUXGLBFae4W07gdxZ2xAqxLjDevelCrC0vXfQqx8mRQSg/m+e1pn6CSgKZHMg994MDD1zscrDcgQVw70CCi4CZFl9zJcsyEfwkHKMSqUe2NyVrnaK/EIOl535F7a1XpRpeSQDgzLaKGZPNx6K0TsT5rhXkqQEhn5D6v8xOrQPh3evwMyKlrKmd/zQ6LTBrO2QwAvzIcyOM427/TEAsNYLWOVkdoR3T8+BwG82t9xt9XEmNVrfQrSyd0RPqI5gb 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 Fri, 2025-01-10 at 22:13 +0100, David Hildenbrand wrote: > On 10.01.25 21:28, Jeff Layton wrote: > > On Thu, 2025-01-09 at 12:22 +0100, David Hildenbrand wrote: > > > On 07.01.25 19:07, Shakeel Butt wrote: > > > > On Tue, Jan 07, 2025 at 09:34:49AM +0100, David Hildenbrand wrote: > > > > > On 06.01.25 19:17, Shakeel Butt wrote: > > > > > > On Mon, Jan 06, 2025 at 11:19:42AM +0100, Miklos Szeredi wrote: > > > > > > > On Fri, 3 Jan 2025 at 21:31, David Hildenbrand wrote: > > > > > > > > In any case, having movable pages be turned unmovable due t= o persistent > > > > > > > > writaback is something that must be fixed, not worked aroun= d. Likely a > > > > > > > > good topic for LSF/MM. > > > > > > >=20 > > > > > > > Yes, this seems a good cross fs-mm topic. > > > > > > >=20 > > > > > > > So the issue discussed here is that movable pages used for fu= se > > > > > > > page-cache cause a problems when memory needs to be compacted= . The > > > > > > > problem is either that > > > > > > >=20 > > > > > > > - the page is skipped, leaving the physical memory block = unmovable > > > > > > >=20 > > > > > > > - the compaction is blocked for an unbounded time > > > > > > >=20 > > > > > > > While the new AS_WRITEBACK_INDETERMINATE could potentially ma= ke things > > > > > > > worse, the same thing happens on readahead, since the new pag= e can be > > > > > > > locked for an indeterminate amount of time, which can also bl= ock > > > > > > > compaction, right? > > > > >=20 > > > > > Yes, as memory hotplug + virtio-mem maintainer my bigger concern = is these > > > > > pages residing in ZONE_MOVABLE / MIGRATE_CMA areas where there *m= ust not be > > > > > unmovable pages ever*. Not triggered by an untrusted source, not = triggered > > > > > by an trusted source. > > > > >=20 > > > > > It's a violation of core-mm principles. > > > >=20 > > > > The "must not be unmovable pages ever" is a very strong statement a= nd we > > > > are violating it today and will keep violating it in future. Any > > > > page/folio under lock or writeback or have reference taken or have = been > > > > isolated from their LRU is unmovable (most of the time for small pe= riod > > > > of time). > > >=20 > > > ^ this: "small period of time" is what I meant. > > >=20 > > > Most of these things are known to not be problematic: retrying a coup= le > > > of times makes it work, that's why migration keeps retrying. > > >=20 > > > Again, as an example, we allow short-term O_DIRECT but disallow > > > long-term page pinning. I think there were concerns at some point if > > > O_DIRECT might also be problematic (I/O might take a while), but so f= ar > > > it was not a problem in practice that would make CMA allocations easi= ly > > > fail. > > >=20 > > > vmsplice() is a known problem, because it behaves like O_DIRECT but > > > actually triggers long-term pinning; IIRC David Howells has this on h= is > > > todo list to fix. [I recall that seccomp disallows vmsplice by defaul= t > > > right now] > > >=20 > > > These operations are being done all over the place in kernel. > > > > Miklos gave an example of readahead. > > >=20 > > > I assume you mean "unmovable for a short time", correct, or can you > > > point me at that specific example; I think I missed that. > > >=20 > > > > The per-CPU LRU caches are another > > > > case where folios can get stuck for long period of time. > > >=20 > > > Which is why memory offlining disables the lru cache. See > > > lru_cache_disable(). Other users that care about that drain the LRU o= n > > > all cpus. > > >=20 > > > > Reclaim and > > > > compaction can isolate a lot of folios that they need to have > > > > too_many_isolated() checks. So, "must not be unmovable pages ever" = is > > > > impractical. > > >=20 > > > "must only be short-term unmovable", better? > > >=20 > >=20 > > Still a little ambiguous. > >=20 > > How short is "short-term"? Are we talking milliseconds or minutes? >=20 > Usually a couple of seconds, max. For memory offlining, slightly longer= =20 > times are acceptable; other things (in particular compaction or CMA=20 > allocations) will give up much faster. >=20 > >=20 > > Imposing a hard timeout on writeback requests to unprivileged FUSE > > servers might give us a better guarantee of forward-progress, but it > > would probably have to be on the order of at least a minute or so to be > > workable. >=20 > Yes, and that might already be a bit too much, especially if stuck on=20 > waiting for folio writeback ... so ideally we could find a way to=20 > migrate these folios that are under writeback and it's not your ordinary= =20 > disk driver that responds rather quickly. >=20 That would be ideal I think. One thought: In practice, a lot of these writeback handers use the folio up front and then don't need to touch it again afterward until the reply comes in and they clear the writeback bit. Maybe we could add a mechanism where the writeback handers could mark the folio as being moveable after the first phase was done? When the reply comes in, they would clear that mark and check whether it's been moved in the interim, and fix up the appropriate pointers if so? Implementing that sounds a bit complex though since it's effectively a new locking scheme. > Right now we do it via these temp pages, and I can see how that's=20 > undesirable. >=20 > For NFS etc. we probably never ran into this, because it's all used in= =20 > fairly well managed environments and, well, I assume NFS easily outdates= =20 > CMA and ZONE_MOVABLE :) > > > >>> > > > > The point is that, yes we should aim to improve things but in itera= tions > > > > and "must not be unmovable pages ever" is not something we can achi= eve > > > > in one step. > > >=20 > > > I agree with the "improve things in iterations", but as > > > AS_WRITEBACK_INDETERMINATE has the FOLL_LONGTERM smell to it, I think= we > > > are making things worse. > > >=20 > > > And as this discussion has been going on for too long, to summarize m= y > > > point: there exist conditions where pages are short-term unmovable, a= nd > > > possibly some to be fixed that turn pages long-term unmovable (e.g., > > > vmsplice); that does not mean that we can freely add new conditions t= hat > > > turn movable pages unmovable long-term or even forever. > > >=20 > > > Again, this might be a good LSF/MM topic. If I would have the capacit= y I > > > would suggest a topic around which things are know to cause pages to = be > > > short-term or long-term unmovable/unsplittable, and which can be > > > handled, which not. Maybe I'll find the time to propose that as a top= ic. > > >=20 > >=20 > >=20 > > This does sound like great LSF/MM fodder! I predict that this session > > will run long! ;) >=20 > Heh, fully agreed! :) >=20 --=20 Jeff Layton