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 E49BCC0218D for ; Fri, 31 Jan 2025 09:22:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7CB1B2802A5; Fri, 31 Jan 2025 04:22:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 77AF7280299; Fri, 31 Jan 2025 04:22:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6424F2802A5; Fri, 31 Jan 2025 04:22:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 45ED4280299 for ; Fri, 31 Jan 2025 04:22:03 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id E4A4D808C9 for ; Fri, 31 Jan 2025 09:22:02 +0000 (UTC) X-FDA: 83067205284.24.D8204FD Received: from out-186.mta0.migadu.com (out-186.mta0.migadu.com [91.218.175.186]) by imf25.hostedemail.com (Postfix) with ESMTP id D6FAEA000B for ; Fri, 31 Jan 2025 09:22:00 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=sC9ryRzj; spf=pass (imf25.hostedemail.com: domain of shakeel.butt@linux.dev designates 91.218.175.186 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=1738315321; 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=nao/21fKq7dfZvtGOLf2zDrQLZAuXxCXxgWG8ruJc+s=; b=Wpc9w2cDbGQsuk2ankaBWRSdCeZPFgprzBLsrQWiCXpsGwy+5n3eZ/MOO/fseR6f3LxNUe fatrlqe8HGSxHNKoEPCD+dGESKge3bpXRr0GdNA5bidI3Ws1Mfo5cFRUF4QG8xrovSQTbx bNtlr8qnuJViVuz/xkgBahssK+/0vXs= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1738315321; a=rsa-sha256; cv=none; b=wjsY4xkTdMg66JliuxsIG+ztmOFMgHO7Xg5tR9wrw/9wgP5D/cUtNKy2QpVFiYscTk8LiI GSTMOUkiQ0znVL0o17WftWB6tdpoJCKiAbXzRPBg/SRkNSokxZUqyuiRCW035IXWmPvzss GzWHzNR1/jZFq5LMNF6ceoKRi9GotpU= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=sC9ryRzj; spf=pass (imf25.hostedemail.com: domain of shakeel.butt@linux.dev designates 91.218.175.186 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev; dmarc=pass (policy=none) header.from=linux.dev Date: Fri, 31 Jan 2025 01:21:50 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1738315314; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nao/21fKq7dfZvtGOLf2zDrQLZAuXxCXxgWG8ruJc+s=; b=sC9ryRzjcNGw4dvAk/4RewObnXn4/1bJAa2tNszv23PQQA0cTYr8BAyEkvtDcQB1P1pegR fd9wpRKdfEgf5ffSTJazsKkG4eLs78EyTUmjPGWq6+rwlPE6NL93wfoe6p/gYS3lWMWBx3 SX7hCZ5u8sqWv7SRqU7bYZus3MWUkwM= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: Frank van der Linden Cc: David Hildenbrand , "lsf-pc@lists.linux-foundation.org" , linux-fsdevel@vger.kernel.org, "linux-mm@kvack.org" , Jeff Layton , Zi Yan , Joanne Koong , Miklos Szeredi Subject: Re: [LSF/MM/BPF TOPIC] Migrating the un-migratable Message-ID: References: <882b566c-34d6-4e68-9447-6c74a0693f18@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: D6FAEA000B X-Stat-Signature: iotcukqxc7bjxhh6r4pu5aycrjekyioq X-Rspam-User: X-Rspamd-Server: rspam12 X-HE-Tag: 1738315320-515132 X-HE-Meta: U2FsdGVkX1/K06gj6KVc7wjt94bQSRJFpA+uRsUHwn64ppkn0YfS1L7Z1CUcAFq0kVdO9uEX8l4sHiw4bJv//PZVRD2w+KqAOqxEUC8YUAawKbr7wU4g0FTwq2D3ZWL/BZnUplQLPJoAz95S+el76miY69sJKruwpQaaO5BwkTtd8xkLGYUwLT2ilaFM9fCCaA7UfpW64MOHm9P+wtDU0F67bDtaszlCBDi6U8FIgMFVia7QJ27bVUpJWvpnhBRoN+upl+EPVl9aGGCCN44vJKuxJ+HuwrD9x4Hy9BQBgRbRZ0XnPLcN6ZlWckg29qjfUIAoWbfJijEgjSmqPV3S0V7K+qRW3+2ZfK5czLVoJGby6c7mjxi5Cnyaq3pdtNnGvtCrc/4liD/GNwvC0RJsD8d1rfDrblTtgHTSmaTIq5IVgvpXcoITr8M8CAGjYhxtHjX9MrUw97gKEHrzNvj5zv8b18gJ2bxlWYZKwdKN3F02/S7NbByDYLSR10De1KdI83JUJBmb7cv2Y3wDNbT1uAMkIWb5cXW4GgdMSscP34TVTCcqPvgQvHi79La15tNzCMn8oal8kNeebGuoE9iUzqdmM2caST+vPA1A7mAA/lZe9iDno1z6MuN5QLsY9g7UBQ4ifzEiOufxZJgJeF4qGSpSzUJg4JRoS34w/nfz9wzdXJQsamCynylaRN1DPKITwjXkYPK1wac/g65wLYbMP1vaKBINv17UYnD9ztk19SvBEywg2y2c5H1ZPl4Ec/WSGI1OinVot4KI3Vz8Rf1s04dsQMxNIlEdKEo3t8Tnbby9sTWGi/qim41k92grgOXY3J1BAUpQ1guM8k9K9dXbZ7Zot3s26x4uTZHV3Yu+GsBKa3gStPMJPm/aU6RQGMBuk5s2a4CLu1YlzamFujlHtD9D7dJbjHLNYSrfHBPSDzcexB4045/a20zmP9jU1+bJdLynATSNwgbwXBDL05o YSc9bmfk nJvkVPReAjvAkvCXD0ZYfhI+FDOUab6/pOIshmLd1kYLK9UsMYlputYDFgBXzQn9b4YxIGLN9aPiRqEXlY3yJQYmwZKIRQxM2RsGjAyLFdhlPPLuVNyWfEZTAJNrbEg6RB05cgsN11QYsr12z18Op2act3Hsrvbg6sISNa0RPf5yMIQL+NNEvSMhALqTljPj2uWuTztD/WGpMyXxxBr1Jyn4sopw8Hs2cwS1M+nvpd5+LwBoVqt2ceF7lV0AO/QiVl3EUHSQMBsvButKo3yoG8CNJ/XQ/rk52HcXAODyrLoR7CNOyq3N38DltqpHkCVrSbsj5 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 Thu, Jan 30, 2025 at 11:39:29AM -0800, Frank van der Linden wrote: > On Wed, Jan 29, 2025 at 8:10 AM David Hildenbrand wrote: > > > > Hi, > > > > ___GFP_MOVABLE allocations are supposed to be movable -> migratable: the > > page allocator can place them on > > MIGRATE_CMA/ZONE_MOVABLE/MIGRATE_MOVABLE areas: areas where the > > expectation is that allocations can be migrated (somewhat reliably) to > > different memory areas on demand. > > > > Mechanisms that turn such allocations unmigratable, such as long-term > > page pinning (FOLL_LONGTERM), migrate these allocations at least out of > > MIGRATE_CMA/ZONE_MOVABLE areas first. > > > > Ideally, we'd only perform this migration if really required (e.g., > > long-term pinning), and rather "fix" other cases to not turn allocations > > unmigratable. > > > > However, we have some rather obscure cases that can turn migratable > > allocations effectively unmigratable for a long/indeterminate time, > > possibly controlled by unprivileged user space. > > > > Possible effects include: > > * CMA allocations failing > > * Memory hotunplug not making progress > > * Memory compaction not working as expected > > > > Some cases I can fix myself [1], others are harder to tackle. > > > > As one example, in context of FUSE we recently discovered that folios > > that are under writeback cannot be migrated, and user space in control > > of when writeback will end. Something similar can happen ->readahead() > > where user space is in charge of supplying page content. Networking > > filesystems in general seem to be prone to this as well. > > > > As another example, failing to split large folios can prevent migration > > if memory is fragmented. XFS (IOMAP in general) refuses to split folios > > that are dirty [3]. Splitting of folios and page migration have a lot in > > common. > > > > This session is to collect cases that are known to be problematic, and > > to start discussing possible approaches to make some of these > > un-migratable allocations migratable, or alternative strategies to deal > > with this. > > > > > > [1] https://lkml.kernel.org/r/20250129115411.2077152-1-david@redhat.com > > [2] > > https://lkml.kernel.org/r/CAJnrk1ZCgff6ZWmqKzBXFq5uAEbms46OexA1axWS5v-PCZFqJg@mail.gmail.com > > [3] > > https://lkml.kernel.org/r/4febc035-a4ff-4afe-a9a0-d127826852a9@redhat.com > > > > -- > > Cheers, > > > > David / dhildenb > > > > > > We have run in to the same issues (especially the writeback one), so a > definite +1 on this topic from me. Can you share a bit more on what issues you ran into with writeback folios causing fragmentation or making memory unmovable for arbitrarily long time?