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 EF696CE7AA6 for ; Fri, 6 Sep 2024 02:24:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4184C6B0082; Thu, 5 Sep 2024 22:24:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3C8BF6B0085; Thu, 5 Sep 2024 22:24:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2B7716B0088; Thu, 5 Sep 2024 22:24:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 0E92D6B0082 for ; Thu, 5 Sep 2024 22:24:23 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 4F0431405B6 for ; Fri, 6 Sep 2024 02:24:22 +0000 (UTC) X-FDA: 82532719164.02.6CC3C82 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf11.hostedemail.com (Postfix) with ESMTP id BA9994000E for ; Fri, 6 Sep 2024 02:24:16 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf11.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725589363; 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; bh=eVE+ZXFI9Vp/HJ91UVhpgF70PzsVvMLWdcrEBDSFAB4=; b=OEyKcb6xcXagPsUCUbNyJusXmVI7cxWMGUUruxJS3OjAcLwJpAvb1IH1KsJPX9RDOmT4t2 AaclxfAPWdc9rV45pkV7T8OyneCtA2hVKKhOGlml/qtLQWIm+mXHX9gnPezPcy31JYVeIM nOrkWulE1DNgXKxM25sp9iKIzUCdbhk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725589363; a=rsa-sha256; cv=none; b=gEzSDlj4cOmTDCoCCwnnBfbU/+cbS2o9QGaJwvHHxLEsVoIUhaEeYDnNFD4cGKTK7o0Jkk 04AXFLHrN8CjALuWmpZ+5orfE+ASO/O7q4kvhfkC2gKcrfpvEiGP/JzE0wEXMf73+vYU94 +wjYWtGRcjlIWUscrG+b3l2TWWedh0I= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf11.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4X0KkK2RxczpVSm; Fri, 6 Sep 2024 10:22:17 +0800 (CST) Received: from kwepemd200019.china.huawei.com (unknown [7.221.188.193]) by mail.maildlp.com (Postfix) with ESMTPS id 790B81400DC; Fri, 6 Sep 2024 10:24:12 +0800 (CST) Received: from [10.173.127.72] (10.173.127.72) by kwepemd200019.china.huawei.com (7.221.188.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 6 Sep 2024 10:24:11 +0800 Subject: Re: [PATCH v2] mm: z3fold: deprecate CONFIG_Z3FOLD To: Yosry Ahmed , Andrew Morton CC: Vitaly Wool , Johannes Weiner , Nhat Pham , Huacai Chen , WANG Xuerui , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Aneesh Kumar K.V , "Naveen N. Rao" , Christoph Hellwig , Sergey Senozhatsky , Chris Down , , , , References: <20240904233343.933462-1-yosryahmed@google.com> From: Miaohe Lin Message-ID: <1d3a5751-8af7-8ca9-8dff-4de2597f9751@huawei.com> Date: Fri, 6 Sep 2024 10:24:10 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20240904233343.933462-1-yosryahmed@google.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.173.127.72] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemd200019.china.huawei.com (7.221.188.193) X-Rspamd-Queue-Id: BA9994000E X-Stat-Signature: nkt6z8prqn4ed9grd59q6zbjkm1tk8mp X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1725589456-253984 X-HE-Meta: U2FsdGVkX18OVbMuega8Qa9LuEy5M+dKWDpXgUfUxAdfnKWxZ/tzDrhlU/ul4WgmCHNluckX3RW4eM/i+ggSZg1bYwT6f7RWnjytEJzSZZsadab9IX0X7nywwj2ec8gcW9HFj5Wz7V54SSVAOk0rTXMx1tzcGhfgV2LvSCYxA/V69CGNbaGfI2xcWzF5QSnXXZ2zsiT8oFU/tNKYxqT2UpJpwg39lZjrnnZxzxQ9sh6id5RKLD6zwkKKAZ+NdvYg4nM/Mp2lAIjGlKaPATqFmAlbzXfsjQwWKhprB1IEMKJPaVG6SdBI/WQ5kYT9ejaM8gsQdSbRwTMZO6reYj5dkW3I/endExrdaqbIWSpCqQT68hepiex62s9XHrc/fOz3DLl3KZzZrJgeL4bs6/c9ncDq+HxxmA+DokdMm5xxojdvAdaWLRqSLJ0pjvBOzpfZMd2oU0maaA9NVjrxMgWevCT4XsSNcdWAe9tCea34EiZ9WrVmQ1a3rAfESwpaHr1D/J1nTiQ5z9EjE4Gp5gGhb3puv8cpIDqKfUVAFQ7pCpa1lsJWp4M2dzf5PSwZ6uhaOYfXJ+9/RLWwfCSSjR0V8i1f/EwLARIUSndsgC2FXndg90tEBG659cDfHeuovr5ZX9PclUUvNpdYoXKneo6Uh2/FEQ+DslOsyEo4FTDGbo9ZN2FhTksU6RqvgnrxAtCMiJSElQo2N1kKLb1RfFO8EpcFigKytCCbIHQsWVSn4CoixJR537U2LTySVAY67XaDqo7G3mPJLarJhwbGTj1ey3mn5unN7R/AaMQ7xWARAKIlXHM9yEr6xJx9wEM7XvKuhPjXKYJl/oKDJAaInVQuq+nVnNLXGjuiji70Ij7qFfbFVHRi3/zoK1XcnbEtbbsfGwqNqe2St5B/n83sWeKt35FjNu3JmK12a6fno9ASj89+M6JouNXUpjzAzlo2CteTn2SDkf9X+DCBqxzypja yPPs9zpr +D3ao5PPTPTUq0FqwNbv75LtYpElEM3ZfrFc7Tt1IuTc9Bq/4c4i53OXyGBee2GSsF19lucoYNziFheI1/8EczcxvM0CnhVxViDsPA7TdrvTsbG1Ui1R8Kgfg1GGEXWbsBnZMjOezX/bhVMLEtPQv5WkgROzaTdpUGLK6IkM61DXt7QvBkrx/4ODkRPVUgaGiCG9k3s75Sy/2d3YL21GQRNFYCsl9pC3NzCoR7e0ZxzEZxMk= 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 2024/9/5 7:33, Yosry Ahmed wrote: > The z3fold compressed pages allocator is rarely used, most users use > zsmalloc. The only disadvantage of zsmalloc in comparison is the > dependency on MMU, and zbud is a more common option for !MMU as it was > the default zswap allocator for a long time. > > Historically, zsmalloc had worse latency than zbud and z3fold but > offered better memory savings. This is no longer the case as shown by > a simple recent analysis [1]. That analysis showed that z3fold does not > have any advantage over zsmalloc or zbud considering both performance > and memory usage. In a kernel build test on tmpfs in a limited cgroup, > z3fold took 3% more time and used 1.8% more memory. The latency of > zswap_load() was 7% higher, and that of zswap_store() was 10% higher. > Zsmalloc is better in all metrics. > > Moreover, z3fold apparently has latent bugs, which was made noticeable > by a recent soft lockup bug report with z3fold [2]. Switching to > zsmalloc not only fixed the problem, but also reduced the swap usage > from 6~8G to 1~2G. Other users have also reported being bitten by > mistakenly enabling z3fold. > > Other than hurting users, z3fold is repeatedly causing wasted > engineering effort. Apart from investigating the above bug, it came up > in multiple development discussions (e.g. [3]) as something we need to > handle, when there aren't any legit users (at least not intentionally). > > The natural course of action is to deprecate z3fold, and remove in a few > cycles if no objections are raised from active users. Next on the list > should be zbud, as it offers marginal latency gains at the cost of huge > memory waste when compared to zsmalloc. That one will need to wait until > zsmalloc does not depend on MMU. > > Rename the user-visible config option from CONFIG_Z3FOLD to > CONFIG_Z3FOLD_DEPRECATED so that users with CONFIG_Z3FOLD=y get a new > prompt with explanation during make oldconfig. Also, remove > CONFIG_Z3FOLD=y from defconfigs. > > [1]https://lore.kernel.org/lkml/CAJD7tkbRF6od-2x_L8-A1QL3=2Ww13sCj4S3i4bNndqF+3+_Vg@mail.gmail.com/ > [2]https://lore.kernel.org/lkml/EF0ABD3E-A239-4111-A8AB-5C442E759CF3@gmail.com/ > [3]https://lore.kernel.org/lkml/CAJD7tkbnmeVugfunffSovJf9FAgy9rhBVt_tx=nxUveLUfqVsA@mail.gmail.com/ > > Acked-by: Chris Down > Acked-by: Nhat Pham > Signed-off-by: Yosry Ahmed LGTM. Thanks for your patch. Reviewed-by: Miaohe Lin Thanks. .