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 968A3C05027 for ; Sun, 19 Feb 2023 04:31:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ADCDC6B0072; Sat, 18 Feb 2023 23:31:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A8C616B0073; Sat, 18 Feb 2023 23:31:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 954406B0074; Sat, 18 Feb 2023 23:31:51 -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 838BA6B0072 for ; Sat, 18 Feb 2023 23:31:51 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 4D396C1297 for ; Sun, 19 Feb 2023 04:31:51 +0000 (UTC) X-FDA: 80482768422.05.0971496 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf29.hostedemail.com (Postfix) with ESMTP id 0B43D120003 for ; Sun, 19 Feb 2023 04:31:47 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Hdg8Q1DR; spf=none (imf29.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676781108; a=rsa-sha256; cv=none; b=p0VQXUX64+R+Ns1gXkjkyMBOvuHeZkXQPn1++FKCgrHcRQsTCcG8OAx3H4SUbS6FCgrgmf R1pQh6Au0A4yowvXYoiwsOon/QgLG34FeorKo9ugVFXjb7ebdOnpHtZY/9Yu1iZXoEaszr aBP5P1ly1ZVvoUoWrC19O76cySv3gnQ= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Hdg8Q1DR; spf=none (imf29.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1676781108; 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=oFoRsv6H14YAfLh6qetwYFt4P6cVa/i1AWUGfv4Rs/8=; b=VqLmpvFrHuCR39HB8K9Kx4CWtRwUWupkXAvSlZwxr6sBiGv342sPrXYodRazkPQhICdlLd EMmrg4galDgDzcTTJd7QreOljNmrzUh5Kyom4vCUu9BIj5g0zcg84tOxM8UIvd1aqWryi1 XP0/JrI6xJ0Sf6gSPirzlzk1h5UPtQY= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=oFoRsv6H14YAfLh6qetwYFt4P6cVa/i1AWUGfv4Rs/8=; b=Hdg8Q1DRHqSBfy464+oKwVpVMB PsQc3Amep+j+1UfJcjXIICQDHac44tVBhQgnTwl/hp2/RV2Hupt1qb8pef5K2hx7XePFgTJQemdAO N0AQzlEDJWS7qn8Guln3lyd8GbceKIZj9+Vj1iacQqAujbCSblneL3Bi2yds+ZiB50ZIEaPHjts3h 3mYVLKZfrcA2ju94FropwuXNMR+LUIEzDu++k5hjN99waPYrI72wSPkRvzPSSm5sM2zA9DhIPr/UH NIP9fiBWpqYO9zarce2eTtNKGkqK3VurSNng+ggrgVw3MKr64JSwI/+tV2u2BElubEJ7pDjpGSH+Z YkRpyNwQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pTbML-00Afp9-Jh; Sun, 19 Feb 2023 04:31:33 +0000 Date: Sun, 19 Feb 2023 04:31:33 +0000 From: Matthew Wilcox To: Yosry Ahmed Cc: lsf-pc@lists.linux-foundation.org, Johannes Weiner , Linux-MM , Michal Hocko , Shakeel Butt , David Rientjes , Hugh Dickins , Seth Jennings , Dan Streetman , Vitaly Wool , Yang Shi , Peter Xu , Minchan Kim , Andrew Morton , Huang Ying , NeilBrown Subject: Re: [LSF/MM/BPF TOPIC] Swap Abstraction / Native Zswap Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Rspamd-Queue-Id: 0B43D120003 X-Rspamd-Server: rspam01 X-Stat-Signature: cabh1zrkgp811sbobi7srg8sufiuzgrm X-HE-Tag: 1676781107-936160 X-HE-Meta: U2FsdGVkX1/MjITK1SI11xWFTnErwALVOJTrS1Gibi5InWj1OiLWISUf/qaNQQ7v0mGzTb/kXn22kdwOKjw6TxHKWP6ryAI9ssQSEAsI27hqSpR9kLc2xL2SeQ+CpHtMmSOe1LNSleNJyrIuftqSg/74xSg8EShWaerZM+bEydS6Pkx2bpFUsseqLrRMGvTZpbfifwB5ktBXpaQMANniQ2uV26mLsh1MJNO/UJDp7h2okeAUv7v+29Dfc/ynFelwP6pnjrLHKjs/ztiUgZSQXw0ZR3vsfTVq1DI95r3V34fclx7jcUAa5FjnRb1w7pq05WWStZNxLfjvDXqh6j29XAwoeH+ga32iNqtpKQfwiWm4NYbU3L+Fhi2SS5CrsQRdBOxdAlVi274Qebl78seWgAZN16ipFdpV5jnuza8F7btU1Wnaa+M8TxB5BUFW77N7ETb+VmzG6cVsgnkcBltbFGzyU2GP8EI3a4WZFeb2SuS4+pawJcV1xYFEvkeVGeLO6xdHt31MJlCLleS3YFgKGVlwgf7RexEWeXGZDqYXqZqcdV9YnoU3y4u0XdOKr6MNaAFEvey67xiCAGMx86qxUSLPiZis/TUtJlEJs5yy/wwTVrgWYyRkqGAskUhKnsEIrO6bTCo/ZQwxEDe6SrejYJZkIK3GEE0d5VSP/YyWYvaO/MudL/WrYzIYKPUJxi07324T51aG7S1fy31McSgzGEHnigwVqKm8PRrecBrrYRIjQRxnh9VxI3Fs+kIV2G27w74qxcx5H7jNdUild+/q8zMu13j0jxUuBd8hnyFzcgSUMfyHAegWXijlVIZWuFXsR+uavjCbOLz7wAXWSin9wv+64Ype6/uW2QHaFPt2BeyT7W2zRZ2p3+HYojGjjcavf4oKvE8h2/kscX4mT/q7ejN0cJhuIH6rQ9OvInFxiyah9ILZp4TW+MfrvLImN0fjKPdRZRf4RttyjVbMbI+ g4k3YtHT bUSOncJqqghspKCrZQkVR5hCQDYSzUAsPJJ4vkYohMN+gXfNelYyQrvT5tkcisCckIFHZMcqoLYKZFEi0qsbt5Dh1hRkJHF++SjPydxinXQz22CCgBK5d3kUAMLMhE+RQGx/Hzh0vUyrOPR07Stj9f9h1SnbH/NfFl0hO 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: On Sat, Feb 18, 2023 at 02:38:40PM -0800, Yosry Ahmed wrote: > Hello everyone, > > I would like to propose a topic for the upcoming LSF/MM/BPF in May > 2023 about swap & zswap (hope I am not too late). Submissions are due March 1st, I believe, so not too late. > ==================== Bottom Line ==================== > It would be nice to discuss the potential here and the tradeoffs. I > know that other folks using zswap (or interested in using it) may find > this very useful. I am sure I am missing some context on why things > are the way they are, and perhaps some obvious holes in my story. > Looking forward to discussing this with anyone interested :) > > I think Johannes may be interested in attending this discussion, since > a lot of ideas here are inspired by discussions I had with him :) I think an overhaul of the swap code is long overdue. I appreciate you're very much focused on zswap, but there are many other problems. For example, swap does not work on zoned devices. Swap readahead is generally physical (ie optimised for spinning discs) rather than logical (more appropriate for SSDs). Swap's management of free space is crude compared to real filesystems. The way that swap bypasses the filesystem when writing to swap files is awful. I haven't even started to look at what changes need to be made to swap in order to swap out arbitrary-order folios (instead of PMD-sized + PTE-sized). I'm probably not a great person to participate in the design of a replacement system. I don't know nearly enough about anonymous memory. I'd be sitting in the back shouting unhelpful things like, "Can't you see an anon_vma is the exact same thing as an inode?" and "Why don't we steal the block allocation functions from XFS?" and "Why do tmpfs pages have to move to the swap cache; can't we just leave them in the page cache and pass them to the swap code directly?" Maybe Neil Brown or Huang Ying would be good participants, although I don't recall seeing either of them at an LSFMM recently.