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 6100FC6FA8E for ; Fri, 3 Mar 2023 00:01:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 96EC96B0072; Thu, 2 Mar 2023 19:01:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8F7406B0073; Thu, 2 Mar 2023 19:01:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 797AC6B0074; Thu, 2 Mar 2023 19:01:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 643ED6B0072 for ; Thu, 2 Mar 2023 19:01:29 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 25392160D94 for ; Fri, 3 Mar 2023 00:01:29 +0000 (UTC) X-FDA: 80525632698.24.6DE481A Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf15.hostedemail.com (Postfix) with ESMTP id 74DDEA000B for ; Fri, 3 Mar 2023 00:01:27 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ULcVgQCQ; spf=pass (imf15.hostedemail.com: domain of chrisl@kernel.org designates 139.178.84.217 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=1677801687; 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=RM9cWw4uHULmaT7z6uRSEMtX5flwJh6R+hCWL70vPO8=; b=puxT8q59N/YXO2OhEKLqrkecizCwpJ53JHBXdl8zuwsZIrnNauM1fqkS3ugm8iTWovb0KX c6HR+MqQ1zCk3/q9r0juq9lwmW5fa8mAT3YryS8ehcS/dhaFCMLKN0MUqp31e+s+UW8oq0 VwWchvV7OETQzBKo+tlVkWpM5RSFlyA= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ULcVgQCQ; spf=pass (imf15.hostedemail.com: domain of chrisl@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=chrisl@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1677801687; a=rsa-sha256; cv=none; b=0bgtCKuqv5Su/ZH43QwsVdgEDRuJE5fmKqmC7LT230GnQ+7HwcidHVhrcUj5al9U+vFRYl x+Dl9sZ7uDag/0acko7nNslllsMqJ4Q6eN6znz/kzPlHmGCfwTDupDW7le7Cm6QiYrHn8f cU+mcIMWtxwr5DNl68qT9OIqf4YAnhY= 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 57243616CA; Fri, 3 Mar 2023 00:01:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3040FC433EF; Fri, 3 Mar 2023 00:01:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1677801685; bh=lH7CTkd8Y01HyvH1ioNEtf3NIk6NzKvyt+s2bKGIfqM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ULcVgQCQqQPGZ0Q8lqrrVtQ3Z194ovc6vZ6h0kCXQGDyf+HJ+2H0tl0bEethSs7SR 4+8G4YyIXj41YeGYgbFwpyFWyDP14d7DkOzxDXir94cFtZViVYq4kHIQaen5tCqxR/ NThatkQno2vceuuoN/AeGnFc0X0lpTj98tcxIzB2+tBJu9h33qtlKuTqXZIKTsDfMS 2cLO2sb/mEnSzOZOkUqgQGagPzN+3US7YT1A+GWDIXolxA+fLgieDTp+XX5arANJmd Vlkgk7MczaES3b+FJaqrhjHspsKg0jAvY+RpNV5JcudfMY0kAL4+wvV1EJvAP+rgYF hRHAiiv2zhuJw== Date: Thu, 2 Mar 2023 16:01:23 -0800 From: Chris Li To: Rik van Riel Cc: Yosry Ahmed , Minchan Kim , Johannes Weiner , Sergey Senozhatsky , lsf-pc@lists.linux-foundation.org, Linux-MM , Michal Hocko , Shakeel Butt , David Rientjes , Hugh Dickins , Seth Jennings , Dan Streetman , Vitaly Wool , Yang Shi , Peter Xu , Andrew Morton 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-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 74DDEA000B X-Stat-Signature: xyk3rhddxrjws4i77746tsmjpdqfurct X-Rspam-User: X-HE-Tag: 1677801687-847669 X-HE-Meta: U2FsdGVkX18Rjg1c6d0Pv1dsytyEhdD72oyJMFjnMYCL3gXzMUSXVHBGEzbE0IsxIiYZaxhtR2D+stRARHtrPPNoL9glwPuAnTgm8luTBW345LtFHVzcbmmzMe9RaOlwrnqwCKtqf1bOAwkm51uPqY5JVEtxWg7fmMZ7daQinzIQsS5VWZWjaNzLi9oF2t7ETFmyUTs9Ppr9tuliUhkylpEP9lE4ktvmH5mbNxCiYdLGZDdG0HWfYBihUnlm5+urw8b+wpEGLYHNDRO/QObwKA3BXCyEXfODeM7lJiT/PmWpASGsFKfXzvAZT6FEEUzRlsKXDUcEDJmQ/WcVA+NxNh4+kXMdDGL/NoP6qnBLAumXbuZzBm9BQh7+6TEEN6htrbUh7NjGdTVgNfcgO2oz6Kw6+aMb3gQqeSZvwO43/h4Ey7K1wB297jEdps4PtNCXijKyPGYS9HtlGbErxgzFcV3oZRB+JJ39uNbCEassuuxCxKrfQwyR7Eu3xL3SoVmGUqqj7p8SzKwe/FL7+ZfQIWV+kmjSWeiWsH8tzPs7lYIAl2VXyZKoF6U/wNJeOHdfQOBkiK8S6q9pkSwGeF1NlqMiQpO3+4myoDqtOwJYW5z+fEMdnEj7U6iEcuXJh9gk5sm81jpBqrNZb3SF6RWuc5AYYc+QKA8maVqBC7NHNXG7Lm5sG6FfUBIrUeIGLeNjPwiBTbAwX5koX6YaKncS1kIyEZQEo0IW1KCCv/a0EIE7nR+NNvn1O7ciMggV/T39JyFiK1iUGbRiS+VsCdqiKFcH/Npd4o1x9TdsJSAtTuuwqvx6Q/MXYcwWuffKgsjl1WI5km1/TyfNPQE3Nh8CBEjRH6OiNvQXRwEB90XXrk1QPAyNkNl73AFGQ1pwjSHz4S9sd9V4RwaR3GdEu0IUT1Gk+EpvAQX8Ag6wMhnpcBryAYrK8keyg+3dVlIIG9fcHcCnOg5Ts4eLOEv8NOO RCUFg6fL ZbUnN5bFJ8t7kR+7d9LnK1TgQrggVIqj7wfm8nwjmLljZJ2AUK/ctclig05i1Bynrp9ChRpin015InDGg0Lz0rGC8CKcVSlpeZn9K/4W6WDYJPX9Hdjb6zeC3eUp+5yzM2wfML2cvoWt8/tKpnQr9rXCOsfzfZCot2uObJX4cR9rqBtvTmPJLl732EUxkt+3KAoTcnzdtxQYCB/v/M9fI0WEdpOQP7YeTBQHSFuuxbHG6EfpVbEEM1HwTeNzZjeVwcii+EmYaFS4PgdA= 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 Thu, Mar 02, 2023 at 05:36:20PM -0500, Rik van Riel wrote: > > The questions, do we have this indirection layer apply to all swap > > entries? > > > I believe we should have a system that tracks every swap entry > the same, data structure wise. Otherwise we will have two sets > of code in the kernel, and it will be too easy to get corner > cases wrong. It is all about trade offs. The original proposal is adding 20-30 bytes per swapped out page, compared to existing swap devices. That is why I want to trade some code complexity for less memory usage. I will mind less if indirect overhead is much smaller, for the user who doesn't use it. > > > That might be a net reduction in the code over what we have today, > > > because it gets rid of some ugly corner cases. > > > > Great. > > ... but that won't happen if the indirection layer only applies > to some swap devices, because we will still need to keep around > the crazy code to deal with the swap devices that don't have it. I understand your concern. It is important to have good abstraction between the different swap devices. I was hoping to good abstraction can isolate out the difference in different swap devices. Chris