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 3F01DE77197 for ; Tue, 7 Jan 2025 18:08:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C2E5D6B00AF; Tue, 7 Jan 2025 13:08:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BB7716B00B0; Tue, 7 Jan 2025 13:08:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A307B6B00B2; Tue, 7 Jan 2025 13:08:03 -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 80ACA6B00AF for ; Tue, 7 Jan 2025 13:08:03 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 042A0A0B82 for ; Tue, 7 Jan 2025 18:08:02 +0000 (UTC) X-FDA: 82981439646.05.39CD38A Received: from out-188.mta1.migadu.com (out-188.mta1.migadu.com [95.215.58.188]) by imf10.hostedemail.com (Postfix) with ESMTP id 043A2C001B for ; Tue, 7 Jan 2025 18:08:00 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=F42TyEdB; spf=pass (imf10.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.188 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=1736273281; 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=UlTBV59tQI4p6soTuVdHSsi53ggiM94qcxAUVClW1FI=; b=3IKA8MSCSFPD0dkGdkMbkvwpyHUNTaFTHLpDsK9JmN0K4R5Od3EQuGfSv200rsIJaq4z8U B/yOVq3G3YDUfVomNI77URkfOF5lMsZPSvEzKyCELl2i3CZ9wLAJFrb7FBCaZALlgnKrpP Cw/zXKiKF3Gegeeaw+wbe123s/6fqpQ= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=F42TyEdB; spf=pass (imf10.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.188 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=1736273281; a=rsa-sha256; cv=none; b=0tHQ0RcUGeJNZEDc+S7phwcqcZbjtKagixVextxl41OhJruUcMu/5mEimTSAOXjCjNQApM Lh+eKj88VYPvvoOk/vi/bkspPofdaaQn4fy7TP04TRKRH/jMSgJpkx1EgM4IH8YgZVnanB xgoHCFQsolwDrdC5FJkbjp6/TeQZNY8= Date: Tue, 7 Jan 2025 10:07:54 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1736273278; 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=UlTBV59tQI4p6soTuVdHSsi53ggiM94qcxAUVClW1FI=; b=F42TyEdBzh/W4f1dY/234muoLagcd0O75lKfy7Oq+0AHaJlb6XC2xNKtL57w2JFI+AMzWq i+5lvm2vi+gcJ1SMdDqYzR8DZXCn/8Y0vuLbCrtPZdSlzuz4UmLOQemEoCfBScdtRMwSpH lhGEiwRFT/PhywZhju361Hd/xBLhn6w= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: David Hildenbrand 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 Subject: Re: [PATCH v6 4/5] mm/migrate: skip migrating folios under writeback with AS_WRITEBACK_INDETERMINATE mappings Message-ID: References: <0ed5241e-10af-43ee-baaf-87a5b4dc9694@redhat.com> <446704ab-434e-45ac-a062-45fef78815e4@redhat.com> <791d4056-cac1-4477-a8e3-3a2392ed34db@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <791d4056-cac1-4477-a8e3-3a2392ed34db@redhat.com> X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: 043A2C001B X-Stat-Signature: e3oirf3qsh6911egcwg3hu43d7sfx3xx X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1736273280-925308 X-HE-Meta: U2FsdGVkX18rRJTOUAWtA8eR3lubSTeNyuieUuI6j7prbCy7NAFQdpfmYMRqsQFYmUnC8AlH9uxCv7HFcKincNALZ2wUkXYyg4WdB/cT13b/Iwrs1WJ/EmsUIo7yxvMuwifVOWIRtgwc2S5ZE0RycNtg3LkgC0eU2y8OkwZ6Q8PJZkUBwzB4i8qFAdYTKehnW+zruf+dWLmAIhnpYUBL7CBKsKDpydN2XvH9Mjb+4afVkr9nR8Y/gpjir3uM3P8dDIrcCam0v7mWXQ73HxYwzQ90ueP/FIIqJW2AxaaEtp+Xqhn9dmK3M0YMgsU/OHycb3Cnl4m+PEF4nPvyBRNKVDBFa/evff7o5zF8HS5f/eRbfh30MxnxaKqUEx5XqpYoUx138u157VjOhXpc7bLnnompXeBmdNiatQtmQ24QfANDDJo5n2a6MlJ20aMgYAiLqacCYI1Y213VWw4pTOx2+ZyuZgPBDI9s9WrAR3W0Pyphfo7CW9TpiTKGRyMF3NdqpkkWwsmG/1XgS9CbqP27bE0qKzY3KiaTV6ZnZW42W6kMnudU0PyPw9va4mSVcHkdn7E4ZSRO0gy5P7DPqggoFxwufPxn+53SrwB3i+XNRo0BFDL1SyISzDBpFbybV8eEiM/IO0YuVPbnFibS54Lq7s4V3CIY4Y1NpDg1x8fa8+0WTaQ3+iKmQP7WWok2yLKK3R+7X2y+7/x5URHCFG7ze0KfqCEAh1k2FQ2cPFLrvD6Yls1MNQXq91e0cUQYs5R8ZfJbN0fhU9Qnix35UWlE7tS4TIHShrkvMDvR8GwdiURsf5DZaB+KBcpRZI3iUKu5o49nsiGMjOr+AkPgYKOsvKlAAjc20KFlxQnLv5j6uYulyqsRKFS9ILfetHpnUlrN6DJoVwXP/4u2kiUVDTXevxtTUfjc4MQCOm+X3Vzlms5/pSjDmpgk6OrEAJMmjNaDnGQ46rP/HUpZ25EfKG8 F1C3yM2t L/CQ5tUVL7LYYBgtAfii5iwSa+pZDEm2dAZDrXTq2FFDAEWw9HNA2tHWoVZ3ZiBAaCiAcBmeTy9xRsexdkMjhasNmhRg8oKibsJtlg6xeEC7+wEjXvdijQ6ufqkcF85D2AqSPJJmVEB6eyC2eorqKuvthAS1eTCdEmggjUTIbke+qAGKr7aJ8wOZnuSvAXMau1EWs4pqhH0Ts+i/PiwweBSA6n/QiIxLswYcL 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 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 to persistent > > > > writaback is something that must be fixed, not worked around. Likely a > > > > good topic for LSF/MM. > > > > > > Yes, this seems a good cross fs-mm topic. > > > > > > So the issue discussed here is that movable pages used for fuse > > > page-cache cause a problems when memory needs to be compacted. The > > > problem is either that > > > > > > - the page is skipped, leaving the physical memory block unmovable > > > > > > - the compaction is blocked for an unbounded time > > > > > > While the new AS_WRITEBACK_INDETERMINATE could potentially make things > > > worse, the same thing happens on readahead, since the new page can be > > > locked for an indeterminate amount of time, which can also block > > > compaction, right? > > Yes, as memory hotplug + virtio-mem maintainer my bigger concern is these > pages residing in ZONE_MOVABLE / MIGRATE_CMA areas where there *must not be > unmovable pages ever*. Not triggered by an untrusted source, not triggered > by an trusted source. > > It's a violation of core-mm principles. The "must not be unmovable pages ever" is a very strong statement and 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 period of time). These operations are being done all over the place in kernel. Miklos gave an example of readahead. The per-CPU LRU caches are another case where folios can get stuck for long period of time. 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. The point is that, yes we should aim to improve things but in iterations and "must not be unmovable pages ever" is not something we can achieve in one step. Though I doubt that state is practically achievable and to me something like a bound (time or amount) on the transient unmovable folios is more practical.