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 4458AC5478C for ; Thu, 22 Feb 2024 22:26:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AB2A16B0075; Thu, 22 Feb 2024 17:26:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A62066B0078; Thu, 22 Feb 2024 17:26:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 951D76B007B; Thu, 22 Feb 2024 17:26:57 -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 841DB6B0075 for ; Thu, 22 Feb 2024 17:26:57 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 595BDC0FE9 for ; Thu, 22 Feb 2024 22:26:57 +0000 (UTC) X-FDA: 81820876074.09.DAA5269 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf05.hostedemail.com (Postfix) with ESMTP id D90F1100017 for ; Thu, 22 Feb 2024 22:26:53 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=vEfHm21w; spf=pass (imf05.hostedemail.com: domain of chrisl@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=chrisl@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708640814; 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=15U6x4Y9WlC7UfyUHnQHw4OlTgujMknxDfFeg5+MsvM=; b=j7poL5VHT6pa/pXGwQSs7QIr+xIPOOz5gcWMM4RWNBeNAUTbDELq98YMPaHcUEQyo52wdL 8iRiO8hW+J44k5eeoHSh4KvnzHheqgSJw0XjzkBal2rCUZm7lNTg0t+Y7FqMDrj/c55sq8 tXibk54wKv7oDb9iRQV5FWYQCJ6sw8I= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708640814; a=rsa-sha256; cv=none; b=kptk/NZ0bn7xTNI13u+ELkyA8K4bt1F5DiuoeRKs8Vv/FJoH0MHRKE92zhK+v9ObtKDgRS d53oPufDWw5XRLUjFjO2z2bJ5bW0cfTTFMwsXmwVpx9edrlKMR5cy8hKhoMHews04iGK7c KsWnIBY6taNrQAN0BgDAL4+eYrPceB8= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=vEfHm21w; spf=pass (imf05.hostedemail.com: domain of chrisl@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=chrisl@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id E5187CE29B6 for ; Thu, 22 Feb 2024 22:26:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31C13C433B1 for ; Thu, 22 Feb 2024 22:26:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708640808; bh=uakp6pNcUQpeLqxV/KFsqT6ljx2PPnsKSGdS4Nn4ldk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=vEfHm21w2Pjw74NoHq2HRFMsBF69w5mTJQ+DAzdfP5//ZJ967ExWVX2xEO/SyIB3s XdxPmDbTDVJ6iP/bs1CQHu62XaWjS/T8MNU5Ez7Wsk4D0bbGytS02BydsNwfG1QRAx CVPtVUJUgY04SREWatdjWatpdPFAzoGEisighju7z5ZRVjgqjYDa+fytXkxUBqeMHu iecEL+kUj+6bX9UAC8mgmK5VIlzsWZz6wvHaeRLJlURcEySXES4DoFl6dHWiDQ9eSS enPtasWN273I4YjYaV6n6Qw3tLRnxxFynBDaVfrrK70jirAUctCFYHXa8ZWFbusnEZ ju2KtHUrRHxUA== Received: by mail-il1-f174.google.com with SMTP id e9e14a558f8ab-3650b558a8cso622385ab.3 for ; Thu, 22 Feb 2024 14:26:48 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCW19qjMosVpHbPKdDIbaHIuBNEb43gffDArMv870bEeIT2d9jpLKC0r2EzhO+IVIBpvOunKeAUOkN/tEa0vC5ARlec= X-Gm-Message-State: AOJu0YxHaNhTzEeojy0nZZAj0xB/zd4HHGLJ1myCfQAawGsH8G2Oc0qU lBMjf2Ei8F+H0XlE/i0VEN3TzO7SAjtnO5LUIKjYqWT2Z8bKU8A0QjnYDbsq3hcxXN6MqaAjy/R iAjkyd8GFGOElPR4roQZpS3FmtuPLaktQc/TK X-Google-Smtp-Source: AGHT+IEJtvmtefD3Od3t1bbl8B5RouNFbPYfROpVtt9Kyh4HZQ6k22NC85SPF3O3XKdoWz/28JwIFtcPvQXRn/oqWCA= X-Received: by 2002:a92:d449:0:b0:363:f8c5:9d7b with SMTP id r9-20020a92d449000000b00363f8c59d7bmr317959ilm.9.1708640807451; Thu, 22 Feb 2024 14:26:47 -0800 (PST) MIME-Version: 1.0 References: <2701740.1706864989@warthog.procyon.org.uk> In-Reply-To: From: Chris Li Date: Thu, 22 Feb 2024 14:26:35 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [LSF/MM/BPF TOPIC] Large folios, swap and fscache To: Luis Chamberlain Cc: Matthew Wilcox , Yosry Ahmed , Daniel Gomez , Pankaj Raghav , Hugh Dickins , David Howells , lsf-pc@lists.linux-foundation.org, netfs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: D90F1100017 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: rckdfgriok3jrsp5drgt98keahe5hiop X-HE-Tag: 1708640813-639854 X-HE-Meta: U2FsdGVkX1/wEKFq78RbsGzco/u7u3WG5/hh7SafUyjSPBd1uDdMpFH3yGf0DPq9i1gJJzFtUZ4Ek/zbMdjlATY6rp21Q1AcBZBkj9Yuqu7nj68pjdZBR8BPjaE3PoAjzzttl8zOLB1Ys+sg1DTiiWavMGC6EHpYUnngGS9K1kUFfunLYhm7tAMb/Azec4/FFtIf7KT6dIZRcTdkDUrWVRx+jz6aprLtKR3w+xFBKuMyDf0NtrITnu7X3L2tSK81jYubJXCyVRGZmPUynqMl2pHl+vHwEZatdlAh64+Wqx0HXEVB5XItTLDNo58d/ucDxV7qJ/SuiRsvT/kE2KbV/jdlvpwLQft8Zci664A+wrBiMDekOW2lvoAQh4gD4G2vHt/QaWnduvrwWib1yBvfoKF+gAtwGidY38NSUjXpOByHKOzgZV77mMgKXMFB1wZnY8zym83f4LVt4k4m7iGBpufXYfCFCGcEhu9v6lj/ZQiPqjh9ufEjErCBwv4CKEhKw94EeFTZFVUAshqRalrk9l3OywqYkjq6GmYAaUEFUE5+n29bRbuwy1ZpiPUbNWzSRO59+MKBDOvY7QLzDPFcxPG6cBrsglZrj0YWolpmkp+3bjFGGVlqkIScl4sGa4mN2r0xjbnWMOuIvCMTjg1Qy/0B5P8BDffY3Zw9Joe8kkvIJIGGRnqY50vWWKTlCIeE2gFBMVF+KPIUvqhvR3hHgqvdKFL0WMIRwg90XVwf6n7CbLBdyc+kIQJeJ/ET1qh/RM5xtMykhOB++nfzI1xqcIUaazIJqn0ZlxjgwYUO0K2VhCFCNCjh3lrF9TDVz0Y43gksY1Lu6Dlq/Jxem7MZWnum+hI+MJ2DIpFMJ3s1PfoMlslEYSPc3qKVHy9pLtmEDjUz8xlu3FkXwofb+QXcPqC18lDUrj6vQ38fL2YTcqcN+dhrCrfhkpCJ8guuigJ56UGWyzm9E/6om7cjN61 iQrYtvsy v+2NIFEAt8lzWY5tzm2/YIxqYpCYP9PI0cmuCl/DG3CLI6zdCSW+bx0jadx/f/0udLzd2oAYf+wRh5FurP8cuB4pvDAgI8kuh4lAo0jjhOaY9qv5GTEQuH6BNLH+KNaljoW3dOjb6sF0ukcbDzsW9Nb6DtmaGnEN3QhHMAZ1dBVVTD2IT38FSbRuRkW+KUjQL9BAu+RqQk1knI3KarSKNRjWl7bkgxQqkHRbx570LtkHFMDk2HDOlptyErGulP9BoJyz2zNWqNwbram+t0xK3YIHDTzcEu5PvzADNTKIcHj/4JlMiZ7/B/u0E7ADPRzHi4wyDUPB+9jc0ARiRhOMmRv7MYfdm7zoddgDtgHN6Bbahfo3J/G81WgWQNlR3n+QTWUAO 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, Feb 22, 2024 at 11:02=E2=80=AFAM Luis Chamberlain wrote: > > On Fri, Feb 02, 2024 at 02:29:40PM +0000, Matthew Wilcox wrote: > > So my modest proposal is that we completely rearchitect how we handle > > swap. Instead of putting swp entries in the page tables (and in shmem'= s > > case in the page cache), we turn swap into an (object, offset) lookup > > (just like a filesystem). That means that each anon_vma becomes its > > own swap object and each shmem inode becomes its own swap object. > > The swap system can then borrow techniques from whichever filesystem > > it likes to do (object, offset, length) -> n x (device, block) mappings= . > > What happened to Yosry or Chris's last year's pony [0]? In order to try > to take a stab at this we started with adding large folios to tmpfs, > which Daniel Gomez has taken on, as its a simple filesystem and with > large folios can enable us to easily test large folio swap support too. > Daniel first tried fixing lseek issue with huge pages [1] and on top of > that he has patches (a new RFC not posted yet) which do add large folios > support to tmpfs. Hugh has noted the lskeek changes are incorrect and > suggested instead a fix for the failed tests in fstests. If we get > agreement on Hugh's approach then we have a step forward with tmpfs and > later we hope this will make it easier to test swap changes. Ah, just notice this. I have some pending ideas on how to address that, I might be the one that brings up this topic in the discussion David was referring to. Will reply in his email of this thread. =3D=3D=3D=3D quote =3D=3D=3D=3D=3D=3D On Fri, Feb 2, 2024 at 1:10=E2=80=AFAM David Howells = wrote: > > Hi, > > The topic came up in a recent discussion about how to deal with large fol= ios > when it comes to swap as a swap device is normally considered a simple ar= ray > of PAGE_SIZE-sized elements that can be indexed by a single integer. > =3D=3D=3D=3D end quote =3D=3D=3D=3D > > Its probably then a good time to ask, do we have a list of tests for > swap to ensure we don't break things if we add large folio support? > We can at least start with a good baseline of tests for that. That is a very good idea to start with the test. We need all the help we can get on the testing side. I know Huge has his own test setup for stressing the swap systems. Yes, more tests are always better. Chris > > [0] https://lwn.net/Articles/932077/ > [1] https://lkml.kernel.org/r/20240209142901.126894-1-da.gomez@samsung.co= m > > Luis >