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 1CFC8E77188 for ; Mon, 30 Dec 2024 20:11:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 809E76B00A8; Mon, 30 Dec 2024 15:11:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B9F56B00AA; Mon, 30 Dec 2024 15:11:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 681926B00AB; Mon, 30 Dec 2024 15:11:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 476406B00A8 for ; Mon, 30 Dec 2024 15:11:13 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id BF5681C6B59 for ; Mon, 30 Dec 2024 20:11:12 +0000 (UTC) X-FDA: 82952718198.26.3F28487 Received: from out-179.mta0.migadu.com (out-179.mta0.migadu.com [91.218.175.179]) by imf21.hostedemail.com (Postfix) with ESMTP id BEABC1C0014 for ; Mon, 30 Dec 2024 20:09:40 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=gs81fd6Z; spf=pass (imf21.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=1735589422; 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=FsvS6b4VeGJacIpC2JSzYns9sLMAO1pS2QTr6Qurca8=; b=14N+oV9nqvjqdGQCs0NKQLGIlOG41khvDNnoBDM/BQUdVG5oo08HDkvmgEYfiufOFf2ueW hQHOFSJYeyi67A1hgVxGefnvqf6N5C/ncTOPuMgitfOSCNxlacaBShA/sO98c2v7Pr9LCq Id7KhPzhCJCbPJYF2PaO7JQ1HsT4xak= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=gs81fd6Z; spf=pass (imf21.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1735589422; a=rsa-sha256; cv=none; b=G4TQrnpE9aYODtQ+IB9fpB8EN5rSRphJYVugCslNGyc2tmV1YXQwQPbDCMnPUWjMQq/zzd iRXPeZPVryFXWd27N1TK4OXDeG6vr81t+QllZnDEzf5xutIk+4dbjDmAuQiUlNiQIKvzuD DpQBIRfKeLySfemaK++AYLzO5i4O3SE= Date: Mon, 30 Dec 2024 12:11:01 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1735589467; 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=FsvS6b4VeGJacIpC2JSzYns9sLMAO1pS2QTr6Qurca8=; b=gs81fd6ZAfZ6B8OjLx6ilkCNZB40c31cEOJE1Isp2WqwSc9e7d7T2yR3yQuTE8qTCGrEEF O2SXbN/bhq9W6OjpPWityywPDF4+G/xhxC1FvpPfrnON7UCFw9xFyBLCUwFczbclqwa3rI 3gq3D6gci01IO5G4O+TluwZ3WOsARXY= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: David Hildenbrand Cc: Joanne Koong , 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 Subject: Re: [PATCH v6 4/5] mm/migrate: skip migrating folios under writeback with AS_WRITEBACK_INDETERMINATE mappings Message-ID: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <446704ab-434e-45ac-a062-45fef78815e4@redhat.com> X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: BEABC1C0014 X-Rspam-User: X-Stat-Signature: wmn49wz8wz8d9efeymzdsbp9xir6uhi1 X-HE-Tag: 1735589380-820911 X-HE-Meta: U2FsdGVkX19gxtGYZs+nWq3NiDS8nvTPL86NC7MpqUjeTStmK9OWsQtqzhM9X6SUQVgPiC6uUJ5oCsbS5IY8GQPWMxSJ518xjLRJ6dfOcMRgUN0h6BW93wyJ7J6LrDVChXqSBoNZ0ZX6l+35/eVIQ7N0NLWRfTTevNGzPoaMIHeR68PvUiCB/MZj6J6alIdt/KTtay6/aFUeLiOfHVBPTVzFABjInoElPKSmMDfANa1gmqdoK7lyg+FszCVqpEmeFGt5Sj9ZNyfiRZIDzIWA4Xmrw2lFQwNLroqiaDutqbv/f4M3B0baEwWFdY/X/urKw1FA9X0aucS0RfkjljHKFFRRxbQ2tv3zkhW5P7LVFZzMMmaty0mjANWADfLNiV8eUlzl5wFphg3q1HmM9n1vbtyYWKVHHiVFJDSPUE9EtkpQt3JQYzVSY+ZYZPlr1yK2xultClCBd3l9qL+z2Sc/qS0+effpQuGSSFBAYTAyomLPdFxpRzjwu8dqcSRNAblfBUv8M3IyBBfX2jriZwu/DDYsu8ov3qNsYKgh+3DaPF2azsniweMjzf/fLvlKwmyGlrLT4LKXeb1YBYYo3rWXKtmYk9ud8D23JDRYYwKBN/dJUkdUysVRYVSdVerSLP/aVD1nhDVFYcIApfxL5RimkPEZ0OeF2pHn53CabO3KlPulHKpf03Tn57oDRqES9bWZ33jxLNzpjje+yTyfCLVp1a9s2UTMrIf6QoK+fHhDICeqH6aMlG9lKvna/ysGfQJYJwSi8ZnoAhbh6L+NQvb4Pvp5Uw4Opg2/Qa+CEKm5f6y7FCj1uRstA13ThpK4b8LEyxji1FKleZ9m9bHoEouiS9gSdcImXoUwCaBa0mBzjWX/29eu42K2FsBih36IGeq9Shk0ggvnsbGs19WZ4WMc+yDAYXRzgieTVyBL/O9u8vA8cftpxbywXmjPEQQdgnF2LBCkpwFbXj0NjKdmiZ4 +RkoSRov d8vHg/aCkjZpLX4JLNJ7ul7fj3g89PET5LK+zlsu3J4fFB1pXnLrRSFbtKrLFIRB8U954w25lCAUVWCVtpCLs0nE7dOqxlLHWpsgigETO887A/cC8zmn7rgcWxbm2p6cjN2nHEh2KbRRPdIW4/Y6Pe3UANSZ1yjh5J5EV8MxHwaN8qeyPNYBGgiRaWdXXTJqNE8uT 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 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 with > > 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). [...] > > 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 to > just wait for writeback so we can migrate these folios. > > B) We allow turning movable pages to be unmovable, possibly forever/long > 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. > 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.