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 DD8E2E77184 for ; Thu, 19 Dec 2024 17:30:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7451B6B007B; Thu, 19 Dec 2024 12:30:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6F4D06B0082; Thu, 19 Dec 2024 12:30:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 596656B0083; Thu, 19 Dec 2024 12:30:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 3E6B76B007B for ; Thu, 19 Dec 2024 12:30:43 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id B3D5F12012F for ; Thu, 19 Dec 2024 17:30:42 +0000 (UTC) X-FDA: 82912397022.25.D3CE914 Received: from fout-b3-smtp.messagingengine.com (fout-b3-smtp.messagingengine.com [202.12.124.146]) by imf05.hostedemail.com (Postfix) with ESMTP id E9FDD100023 for ; Thu, 19 Dec 2024 17:29:36 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=fastmail.fm header.s=fm2 header.b=jJVAXStg; dkim=pass header.d=messagingengine.com header.s=fm1 header.b="m p2Tzlx"; spf=pass (imf05.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=1734629405; 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=IDuYtnssHU4nHmVzhDTI2qbL7scuU39ZTowlz3uiE2U=; b=HuSUJW8eYYeB5XaBc48slReWVvckHqXsxal+hVH8AtBkTYyxzr1RRXZmjgMIQpr3MpiXlY s6lmfl0oswO06hMkzF/1bGRqmhlxroMZGH9KYM29ER6n/RdsSpkTn8DnR416GyhB44MyNH 6I/0qj/RZ3gIs9tZgXJ4cHCh9l6vFFM= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=fastmail.fm header.s=fm2 header.b=jJVAXStg; dkim=pass header.d=messagingengine.com header.s=fm1 header.b="m p2Tzlx"; spf=pass (imf05.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734629405; a=rsa-sha256; cv=none; b=SEm2Z8FTT7g39UY2UaBenWxhWF22q6LJLOiRNlqbktrMuxIdPl8pouyG+CnAWJ0JaLUscy 9TrgEnQmpzbQ7n6t9aCAOjwa6AxeHxixhdR+EFubTJbMO04aBPeeEbcNt3ricNenGXrdaY wyvunQY1ru/BjlQQ5H3CDCxQiTMQ3B4= Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfout.stl.internal (Postfix) with ESMTP id 58F281140174; Thu, 19 Dec 2024 12:30:39 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Thu, 19 Dec 2024 12:30:39 -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=1734629439; x=1734715839; bh=IDuYtnssHU4nHmVzhDTI2qbL7scuU39ZTowlz3uiE2U=; b= jJVAXStgIaE/cowSCKqRN/uQtdwsD3U5KzfJS2CWbBZ6HPr6P78vOsIL0eV5Ufe1 XMKGb2isjLBqALXY5cLCm4JvHWimsTVqS1jafK+atXlO1qZVwPEnv8dLTExKalBb 4Ubx1DxX6xpgrTD/9D2jD0vXBfCAlitD8akVJ9ozgp6HkQ4Q8v8ZReIsY9hMKPQc M0NztlU8C2xxEscbvt2G0Ww6y6Ad4QvBL6v5YZ4TUorrq15OV9sKrGaJhoqH4Zqu mMdbDUAJ5F9RaLVkyaiu1kanPIDaZvX3fLHLF+sfUUGTmag29YimC7FmRh3u783y ikESqM55FtIUzTmVjmwpWA== 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=1734629439; x= 1734715839; bh=IDuYtnssHU4nHmVzhDTI2qbL7scuU39ZTowlz3uiE2U=; b=m p2TzlxgY6dAfW+mD3jflXT5lDSoUVSGBrxnk++wyKORrsOYgNnppJhxkEsIu0ZXU 2SWyGljDK63xvxDwGuZRfqOAwQSmIBnwXhNOEt6hDC3aQF80CS5o+D/NCNyTRd/D G5nmUbocbZ0YvleSOt2xBU9yVne0oLQktfpPCu9AEtKTiKvKtr82pckGEsP5iApw mhV3v7FSDBHpqolyDZLv5bE8kNkrbG6aZ0My9zOv8Auos/MZLKq46HH9fXGnyHz1 5C9A+3ukKV1hQZI5cRM5R3WJ+7iXIFrhpiePAR1GprYq3fFWvk1buXUjVElb3UO4 +DA9Q/nULcZJ+6l6pVebg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddttddgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdej necuhfhrohhmpeeuvghrnhguucfutghhuhgsvghrthcuoegsvghrnhgurdhstghhuhgsvg hrthesfhgrshhtmhgrihhlrdhfmheqnecuggftrfgrthhtvghrnhepudelfedvudevudev leegleffffekudekgeevlefgkeeluedvheekheehheekhfefnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepsggvrhhnugdrshgthhhusggvrhht sehfrghsthhmrghilhdrfhhmpdhnsggprhgtphhtthhopedufedpmhhouggvpehsmhhtph houhhtpdhrtghpthhtohepuggrvhhiugesrhgvughhrghtrdgtohhmpdhrtghpthhtohep shhhrghkvggvlhdrsghuthhtsehlihhnuhigrdguvghvpdhrtghpthhtohepiihihiesnh hvihguihgrrdgtohhmpdhrtghpthhtohepjhhorghnnhgvlhhkohhonhhgsehgmhgrihhl rdgtohhmpdhrtghpthhtohepmhhikhhlohhssehsiigvrhgvughirdhhuhdprhgtphhtth hopehlihhnuhigqdhfshguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghp thhtohepjhgvfhhflhgvgihusehlihhnuhigrdgrlhhisggrsggrrdgtohhmpdhrtghpth htohepjhhoshgvfhesthhogihitghprghnuggrrdgtohhmpdhrtghpthhtoheplhhinhhu gidqmhhmsehkvhgrtghkrdhorhhg X-ME-Proxy: Feedback-ID: id8a24192:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Dec 2024 12:30:36 -0500 (EST) Message-ID: <2e13a67a-0bad-4795-9ac8-ee800b704cb6@fastmail.fm> Date: Thu, 19 Dec 2024 18:30:34 +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: David Hildenbrand , Shakeel Butt Cc: 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: <20241122232359.429647-5-joannelkoong@gmail.com> <43e13556-18a4-4250-b4fe-7ab736ceba7d@redhat.com> <968d3543-d8ac-4b5a-af8e-e6921311d5cf@redhat.com> <7b6b8143-d7a4-439f-ae35-a91055f9d62a@redhat.com> From: Bernd Schubert Content-Language: en-US, de-DE, fr In-Reply-To: <7b6b8143-d7a4-439f-ae35-a91055f9d62a@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: E9FDD100023 X-Rspam-User: X-Stat-Signature: rm3f8noi3urm7tjz1eqp63ja1isje85e X-HE-Tag: 1734629376-479271 X-HE-Meta: U2FsdGVkX1/wC7CFlITxoPQNdiksyUcPjas8mrmggrqNNNV/dXmztWvgPrRETsiBYmKMUM/mbPUJ7EYQ/BgtbBtEFjvguFGhDODeE7JxUlkHc5xbkKXFl5PUxNh9n63lQAa+uxFcIzvbA1xkVijQun7RAfaf3iUjNdwGFR3L2dvFdHNwkStMvXvRWMmJMJeEhBVsMSyENlOFwnnXHx+YosVW5/WVjDww208+b2+aAki3ZD70ZNj4lb9cmwDRGxyMB1g8CGNEwg8YHBIESST+6/TNFsRdqvS82+D8WD551G1VVFx9IGk4m3L6e85NAa/9It3y1iWzUy27Fd57aYXrfr/pRauBePynewPJEMFD/nMHPIpGvQRPYJZE3Gnl+8ULP9GAqPYNlROg1mQ5eNTIWxIwGjjx3asyMFUZmLJKBM4joxwEC8bAF0yhQ0Dv05FCJjdJasTEaTYihm+DL2GeVRFZ7CXbebc/nVSSLAQroxMXpQvYYuMMG4523YDC33U5tbuadYgm4rVmUcydSMuTkljLV7yIu3hfAu59q58ZWo9oGtHNuzf9pzO0koHRVlz5BXJtmSWOZQglFft4v5dug5q6I5/ThI75EHdgKedi2kUNpCWLihBpbcfT5ZPXhSnhuz9MRqDVNmy//n78n7y0wcIwbnakYLnCQZ+RblPKyWLFDiE8Vto0w7hsvhrq3e5Tvwqnd5ks9/SDEDzWQJt8foy2lxk3t/4jULT+trszKQzjkgcMsyFhXsyUAvVy1zng1TBZNN8T6dK+yGSZoxwnPw0CCqZBwTJBxkW5eYym6xBdEuTa56u3nsIwXpXrwAU2OlPvw0s5tNNEQz/KNtzZ9PNiC6aho+BOTxoUxl3V0kCtMJ0b9f5PFpHrq8ZSxyuXZL8Vl3iolKnPxBh95wL3jkYRb9jW/3+w7XYtg1rEGx5qnIEH2rS35cXPDuVqqN2Rnl1uuyigKJOCEbNPo6F CqBfRrOI zAzkfOPyYO2FqAS9X8f5gXoErUMXmQaJDG2pbCId499SMKyQ4L3ZX+jTf6CLBAlmM7gKe0UisAclZkYKrNa1kbZEI8xxqlWo8B+Z+QjfqlQ8oEuanSfUeFb7Tyu6q2vYBVTUDgySG1FoYr6CreKNLTbTIP9UtQ7zQeQ4YYwBwGHitJ7J7rwK+/UWLkChVdHG3td6kKTy8ErrwW0AcWjQ52+h4X14a4WkGEOlMX8k4Y7VIuXBYwraVCiKW7v6x2QK2d853KI8k+SyrKuk2PtsY7j9NlbEfZuDrlQ8etGFsfcuWDQOhyvkdn1QXis5blFv9iZkLQiwPENfKoHL0NNEuNxQfOi+/MjTWjeiuzXkqxaBFCbOF/W5k7VGpU/anzJfNGDZREme43PX2fBFPXRggX2zvKuVpgbIX6k1ANw38LIaVfUJS08l4Y1MhM6L69ovAbS5WqFr9VxEWKtVD5Q+bnB5OCA== 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: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