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 52023C76196 for ; Tue, 28 Mar 2023 20:50:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B603E6B0071; Tue, 28 Mar 2023 16:50:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B365C6B0072; Tue, 28 Mar 2023 16:50:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A25E06B0074; Tue, 28 Mar 2023 16:50:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 9347A6B0071 for ; Tue, 28 Mar 2023 16:50:31 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 6684FA03E7 for ; Tue, 28 Mar 2023 20:50:31 +0000 (UTC) X-FDA: 80619500262.06.FC49FD1 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf13.hostedemail.com (Postfix) with ESMTP id B5F5420007 for ; Tue, 28 Mar 2023 20:50:28 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=buRUiWru; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf13.hostedemail.com: domain of chrisl@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=chrisl@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680036628; 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=1Nkc8MTuEmGoD0S4i+oUhOS9r2qa0rWcjZnUD2F+wD8=; b=vaOFH1gYvDq/hlgpJRuG80Q0j0lilE81Yed+qHR0INm0F6gvlNpjQTjS2XoZ9GX6VxpMK8 0DYzTIDZ+pn/zxE0Az3oCgR+zA2kTrOHm5uw7QBkCKSM3nwn1Jj3VLfi1fYml23MMbM7dj hFQ11vQrYRIQMSSKviGcYNLI6sz+Zn8= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=buRUiWru; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf13.hostedemail.com: domain of chrisl@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=chrisl@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680036628; a=rsa-sha256; cv=none; b=QdLMO73/ni1Rxssckm5FLPCCZaU0vEyQWF96v+8blQVcHWzIvfzmtiUhtFp5tA0SNCLt5j bhxFAssSaYs5csZFcpU5h2N2vPiMm8hsNp0C+W99trK5hzqJNMVytgjhszUPYTqak3d3sV A8Gj3TSyJ0YVVQWzVKYoFZiVFKQBpEg= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A22E261957; Tue, 28 Mar 2023 20:50:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66030C4339B; Tue, 28 Mar 2023 20:50:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680036627; bh=lEq7DARKn82X+gXGcxoP3nBV/ZkHh4bR7cwaLcKKjRY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=buRUiWruL7XSpKbOZaHw+kHpUsVJZqWpFQ8t3hXNFg5jGZFCcer+l0ClXo4Ja0O3r i+/W8U8/9+9XJaXUdh9HUnEDxgCSEEGAweDUvqPXX3PumT/NpLQK3UGEu5LMcJFOP7 Aes23e2y3g63KLl1HebO9+wQoA1+hvRWi1bwoWEkVKkoyk2esaXBjg6U07C5mnVMfO cL2ePAWgKDY2qEG7is9hzOFRQAF9dNqR4gC1j8shZxbiFDC5OxnTPb44kxv0dsWkUh KjciziLDI9X7HQipNikXnExdw/0+oruxtM7RjOra3y30wJP4dgvitR3xQOsw6CROa5 URKTb5F1NCXqQ== Date: Tue, 28 Mar 2023 13:50:24 -0700 From: Chris Li To: Yosry Ahmed Cc: "Huang, Ying" , 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 , Aneesh Kumar K V , Michal Hocko , Wei Xu Subject: Re: [LSF/MM/BPF TOPIC] Swap Abstraction / Native Zswap Message-ID: References: <87sfduri1j.fsf@yhuang6-desk2.ccr.corp.intel.com> <87edpbq96g.fsf@yhuang6-desk2.ccr.corp.intel.com> <87jzz1pfb3.fsf@yhuang6-desk2.ccr.corp.intel.com> <87fs9ppdhz.fsf@yhuang6-desk2.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: B5F5420007 X-Stat-Signature: fqtqeyqgbeksdq744br41jku8azkncxx X-HE-Tag: 1680036628-191626 X-HE-Meta: U2FsdGVkX1/qnhXsZ7sWk6XkQcNkOJtY5fULtqgwl67mMFVxd3cF3ellvxcscV2yWM28GozOW5jlxGlo3hTwyTBPz6domDg2ILdDq5sSmY8efJvUYkbSZxRFe4HmZNj5+AOuLcKxaCqvhxEgqIslEODHH95Fbghf8eRlnsLrCgv6QNI/OeR0La7iIMlz68Oz6MSmHE9hFE5j3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5gp5CJMxyUwAguqq6Q== 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 Tue, Mar 28, 2023 at 12:59:31AM -0700, Yosry Ahmed wrote: > > > I don't have a problem with this approach, it is not really clean as > > > we still treat zswap as a swapfile and have to deal with a lot of > > > unnecessary code like swap slots handling and whatnot. > > > > These are existing code? Yes. The ghost swap file are existing code used in Google for many years. > I was referring to the fact that today with zswap being tied to > swapfiles we do some necessary work such as searching for swap slots > during swapout. The initial swap_desc approach aimed to avoid that. > With this minimal ghost swapfile approach we retain this unfavorable > behavior. Can you explain how you can avoid the free swap entry search in the swap descriptor world? The swap entry space is smaller than the memory address space and there are other swapfiles can use the swap entry. You do need to do some swap entry space management work to get a free entry. That to me seems unavoidable, am I missing something? > > Personally, I have no problem to change the design of swap code to add > > useful features. Just want to check whether we can do that step by step > > and show benefit and cost clearly in each step. > > Right. I understand and totally agree, even from a development point > of view it's much better to make big changes incrementally to avoid > doing a lot of work that ends up going nowhere. I am just trying to > make sure that whatever we decide is indeed a step in the right > direction. The ghost swap file patch already exists. We might just share it here for the discussion purpose, list the pros and cons. Chris