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 42063E77188 for ; Thu, 2 Jan 2025 18:54:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9C8EF6B00DF; Thu, 2 Jan 2025 13:54:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 979146B00EB; Thu, 2 Jan 2025 13:54:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 840A06B00EC; Thu, 2 Jan 2025 13:54:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 662136B00DF for ; Thu, 2 Jan 2025 13:54:18 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id B9576AE8B0 for ; Thu, 2 Jan 2025 18:54:17 +0000 (UTC) X-FDA: 82963410684.22.ED577F9 Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) by imf28.hostedemail.com (Postfix) with ESMTP id 9A6ABC000B for ; Thu, 2 Jan 2025 18:53:21 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=aePZAU1e; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf28.hostedemail.com: domain of joannelkoong@gmail.com designates 209.85.160.171 as permitted sender) smtp.mailfrom=joannelkoong@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1735844032; 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=+Qs6xMGr55p17XkDku0NKUz2RFSdFUS3pnWF6VgBGyc=; b=6KqES8o9b+OeerOC8L5Eew4RM+uXJ9LezCkrkyCGVy6/N+oNuXDYKR5VPckZF95wWirYjM pAOjl1l6qgxwi/cf2bmGrUfb9GqOYz02S1VVHQ02Vj4WoT3RKlzxXhwTh+bPpd0Kf8Bi8f t8RSVYDEbPj2HPsoPokJJnQgA6RENKw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1735844032; a=rsa-sha256; cv=none; b=lZs19cCxOszGFeLYeNCloJc14Q75pKEN8c+btyI03QM2p6xcOnU78oYLzQaq5v6QXmtTlU 9gVaF6UJxt+Ja1O7fEstYwbYC+A9G7jo02q4BiV6V0bi1cddJQLdkMti3KxTj306J0GQVz THDrU8h+dLw7u1niTVBiBxkude6Tu4E= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=aePZAU1e; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf28.hostedemail.com: domain of joannelkoong@gmail.com designates 209.85.160.171 as permitted sender) smtp.mailfrom=joannelkoong@gmail.com Received: by mail-qt1-f171.google.com with SMTP id d75a77b69052e-467725245a2so77269621cf.3 for ; Thu, 02 Jan 2025 10:54:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735844055; x=1736448855; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=+Qs6xMGr55p17XkDku0NKUz2RFSdFUS3pnWF6VgBGyc=; b=aePZAU1efXsz/Ar3ZV5KAxcHC1bZLvxVQ9KNCcKhUzshxBou4OXe+d2ksM2LvEQpMQ YRJXy4orStKc0bK+P+trYdn3Qd3H08CAaFAR6Q1cqGUqlZVmnvtLPVhALRDgB1SZau15 vudcRaxpDCgwfuZ7A5QBSL9aTiQZcypaEPo5z5HImOFmipetVMRf62wpCXkbROtR+bAj xcmMVEDkoW/LCBpsgjDGlb1LK1UEv3lxZ4g4/HAuA+DuQ0nQDkyQ25Y79b2hYt1lzn/9 eqkThALlsWZ59p420fnmzoC/4PDA2d9rTYmnqu9WjUWV3YUNWMeG08YSO4mX5qxbZp1U h2UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735844055; x=1736448855; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+Qs6xMGr55p17XkDku0NKUz2RFSdFUS3pnWF6VgBGyc=; b=YOWTbXChf/tovDfmNlOvDEr4Ln4zvABr/ANxwrJIqVpH6A9BvHKiN3LP22gIWfvkWm OvzbutMFBiYwqJuTzlrYY/XbyKrGxL+jKFlt8Ar3J+pGUPnaabK/yzWXe9fcdRvNaUqE ej7Zgdz39SLUc4VaQqB/YXV6Z5hbj+WaodpRSEL4m8tNICild0mN45tYp1+gn9hGqvwL T5lMKoJi41XxBhZYo5K1lnrFZX9mAyXp+eRN4MeK1XqqGgG1oxcdufDUPBxKyPgyz/fq K54P3mCFSyzDWp0hIWtXRsAXALRnDusPefn7M5FBQt4mfb0txX4X1+/i05LVwufik6zs mzcQ== X-Forwarded-Encrypted: i=1; AJvYcCVQ6O5P8RhfvXRG0jy6a5LwhHTn9n1kt6tqnGx4YZ5h2+MSC2rJR8Ho2E74uDM1yp80ZHl7NGMMoA==@kvack.org X-Gm-Message-State: AOJu0Yw5tZN1UZOJV53bX53acXAsHUWPy/taLOKm6yBbsqQI6ZMWF1HO CGEUoB/ZbrLpvb3jcM1kQVnaa4q16Txe2w0+8DDHGKDA6uJ67Uadx/CrBorFqHsdYr496x+sc9o 6eFH+zcxBi6CHtUS0xbNkaHBYNHU= X-Gm-Gg: ASbGnctECTijoYgtGe7Bj18irbloexhaFPhpoK7zOJqxTUdiwjYqalKLsb3nXYisZCY eNrtDoSB09lsnx0y3gINB9eCrehEkdl6CPTD+UmM= X-Google-Smtp-Source: AGHT+IH0NZ+gCvxNDFQIWosoMmhOwNrAe8SZr2ALLTzinSxgkzv6mxbZ9MEZ9zk1QkDFGzCc1gK1ZLVCuEYWCkQUXMg= X-Received: by 2002:a05:622a:1651:b0:466:9507:624d with SMTP id d75a77b69052e-46a4a8fbb8dmr750549081cf.27.1735844053474; Thu, 02 Jan 2025 10:54:13 -0800 (PST) MIME-Version: 1.0 References: <9404aaa2-4fc2-4b8b-8f95-5604c54c162a@redhat.com> <3f3c7254-7171-4987-bb1b-24c323e22a0f@redhat.com> <0ed5241e-10af-43ee-baaf-87a5b4dc9694@redhat.com> <446704ab-434e-45ac-a062-45fef78815e4@redhat.com> In-Reply-To: From: Joanne Koong Date: Thu, 2 Jan 2025 10:54:02 -0800 Message-ID: Subject: Re: [PATCH v6 4/5] mm/migrate: skip migrating folios under writeback with AS_WRITEBACK_INDETERMINATE mappings To: Shakeel Butt Cc: David Hildenbrand , Bernd Schubert , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Stat-Signature: ezur5awrnmoyoufhdibb8zpe9agzys1j X-Rspamd-Queue-Id: 9A6ABC000B X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1735844001-386572 X-HE-Meta: U2FsdGVkX1/TBKmCV9utAdsHQ4PYJmrWV7db9JmSZlA8KZr/pVTErW+9d+pUIdUTlhblrilgGh7P8l9LdJt2PDafqE0DIpRxNDk2/85auhZegsi43w3kMUiv4W9gM25mefR+DHTLIe2QilGLBYPYT5vB0a3NDweucromHfmp3bv6fEkSPEEUhXT/zgn+Sxo2NTMyZF2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LyhgTUR9xe3tMDKoOWgXkEyHQJ2R7ug1061fm+fUUhVii0WoLQTwEgX86amDWx9gAE1PtFcwQ1K7m1vEZJd8pQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000025, 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 Mon, Dec 30, 2024 at 12:11=E2=80=AFPM Shakeel Butt wrote: > > On Mon, Dec 30, 2024 at 08:52:04PM +0100, David Hildenbrand wrote: > > > [...] > > > I'm looking back at some of the discussions in v2 [1] and I'm still > > > not clear on how memory fragmentation for non-movable pages differs > > > from memory fragmentation from movable pages and whether one is worse > > > than the other. Currently fuse uses movable temp pages (allocated wit= h > > > gfp flags GFP_NOFS | __GFP_HIGHMEM), and these can run into the same > > > > Why are they movable? Do you also specify __GFP_MOVABLE? > > > > If not, they are unmovable and are never allocated from > > ZONE_MOVABLE/MIGRATE_CMA -- and usually only from MIGRATE_UNMOVBALE, to > > group these unmovable pages. > > > > Yes, these temp pages are non-movable. (Must be a typo in Joanne's > email). Sorry for the confusion, that should have been "non-movable temp pages". > > [...] > > > > I assume not regarding fragmentation. > > > > > > In general, I see two main issues: > > > > A) We are no longer waiting on writeback, even though we expect in sane > > environments that writeback will happen and we it might be worthwhile t= o > > just wait for writeback so we can migrate these folios. > > > > B) We allow turning movable pages to be unmovable, possibly forever/lon= g > > time, and there is no way to make them movable again (e.g., cancel > > writeback). > > > > > > I'm wondering if A) is actually a new issue introduced by this change. = Can > > folios with busy temp pages (writeback cleared on folio, but temp pages= are > > still around) be migrated? I will look into some details once I'm back = from > > vacation. > > Folios with busy temp pages can be migrated since fuse will clear writeback on the folio immediately once it's copied to the temp page. To me, these two issues seem like one and the same. No longer waiting on writeback renders it unmovable, which prevents compaction/migration. > > My suggestion is to just drop the patch related to A as it is not > required for deadlock avoidance. For B, I think we need a long term > solution which is usable by other filesystems as well. Sounds good. With that, we need to take this patchset out of mm-unstable or this could lead to migration infinitely waiting on folio writeback without the migrate patch there. Thanks, Joanne