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 2CE78CD5BA6 for ; Thu, 5 Sep 2024 10:19:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9C56A6B016E; Thu, 5 Sep 2024 06:19:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9745F6B017C; Thu, 5 Sep 2024 06:19:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7C6F26B017D; Thu, 5 Sep 2024 06:19:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 586686B016E for ; Thu, 5 Sep 2024 06:19:55 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id F26BFA825B for ; Thu, 5 Sep 2024 10:19:54 +0000 (UTC) X-FDA: 82530288708.25.812B9CB Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by imf24.hostedemail.com (Postfix) with ESMTP id 1575B180003 for ; Thu, 5 Sep 2024 10:19:51 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=konsulko.com header.s=google header.b=CnPfL3bN; spf=pass (imf24.hostedemail.com: domain of vitaly.wool@konsulko.com designates 209.85.216.44 as permitted sender) smtp.mailfrom=vitaly.wool@konsulko.com; dmarc=pass (policy=none) header.from=konsulko.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725531463; 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=PA7JIemCyiEdqILj6UaKRiRobVb7jaWwTSUCykQJ3Wk=; b=R3m+0wn036kaW2wql/ajfbdh5dKgEsUyRgYjFnTr8t4MgDBf8zxQRfOAjTSlhSGifnC+Oh a12N9eSYp5S8msP5nKSSLoTIexIXC56dgPwS81ce1VmK02O62NGPBaPhcdC6LSqQ2f6BiG RTbydxon4P+17+Ah+mlrrDvgREQ8/IE= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=konsulko.com header.s=google header.b=CnPfL3bN; spf=pass (imf24.hostedemail.com: domain of vitaly.wool@konsulko.com designates 209.85.216.44 as permitted sender) smtp.mailfrom=vitaly.wool@konsulko.com; dmarc=pass (policy=none) header.from=konsulko.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725531463; a=rsa-sha256; cv=none; b=uzgPiOfRZm+7OmLbkQc1IvaxzF6or8dfPbpROS/2CpSeYn2QPRy7vP1smly+LH5oyL5xBU MyneaFu5Yj1uamjSpQveGrGC+co7h5G6EvoYVzCqCYZfj41v5LL2q6d2tpMlT0a2U38zJR Zi88N4xh7hHwqBSn3YOnCAWn7WtbN34= Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-2d88c5d76eeso409882a91.2 for ; Thu, 05 Sep 2024 03:19:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1725531591; x=1726136391; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=PA7JIemCyiEdqILj6UaKRiRobVb7jaWwTSUCykQJ3Wk=; b=CnPfL3bNo0WBFqY/KbJIDoYVWHKW18ZnuRECbcNLX8TxMlP/z0EHw565u9FMJqEL6G FWBq1fNpJWc1rtNAXsJpWc46vZrUAh+wvylHPd5/9ibN6oLD3HlrwYUD6iE7keUfvmv4 kDOmclKbVnhLOwMj8NdGMmpC6lka2BLCV6VTw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725531591; x=1726136391; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PA7JIemCyiEdqILj6UaKRiRobVb7jaWwTSUCykQJ3Wk=; b=msAYVrTJcIRfNfftL9pcMM48HSGJNx/CY7V7tm/m9kYrY5gZVEJ7Yd5nq+pt2ltRcM GD8dLx/XbUn5OPDruPohQrKYenHEGBDIAgbszn9mKVZe4uQn96psFq5Lxbz/iHjcc140 ZFz/x7bzgP/58W9uN06nxaFzzT21+4YmLcL91HvGDYeg1ro9cvZj7QQn1NVOTt6ocgp+ NnDuyVSl8b7A4aRQofIqknZ247faYn6UH4xr4g1a4x5xL6JTTp6bsfkKfMsSB97POZgv Eg3qGsvH13NeTs07Rt4J1VBCRA91gI4gOrQW/bk/B0QaTU0GykBc1kU9Igeq2+iYtsUD E+VQ== X-Forwarded-Encrypted: i=1; AJvYcCXVEhz059ntv0nER2LUKkX5V1HYM/0mcM1KNajw9mZguq4+aAotTVaYiqXNBa/mwX+EJf1KuUV8zQ==@kvack.org X-Gm-Message-State: AOJu0YzwUNAaznt+OO8HPXeVKgO6WwpkWfRm7NmUobHIllcBueTXGRhU zemBEUbLPMQqhlRI7EvGZedf3szQnAsX+XbyWAvqkX8qvFdmls2HryraHqONnN3aezCeCP9S6po HTu0LZMdJfqY6TtOaWvRCA0nwv371cUqNztLsEA== X-Google-Smtp-Source: AGHT+IHyTnBl3/mA7BCy8C7Mdrgi4kraU3T2YISEDkiQ+C22fRtuX7dRpdTavjnbTJxnBQ32e09vaczZ2IZyJiMaQuo= X-Received: by 2002:a17:90a:ba94:b0:2d8:cd04:c8f0 with SMTP id 98e67ed59e1d1-2da55a78cb0mr10646151a91.39.1725531590333; Thu, 05 Sep 2024 03:19:50 -0700 (PDT) MIME-Version: 1.0 References: <20240904233343.933462-1-yosryahmed@google.com> In-Reply-To: <20240904233343.933462-1-yosryahmed@google.com> From: Vitaly Wool Date: Thu, 5 Sep 2024 12:19:38 +0200 Message-ID: Subject: Re: [PATCH v2] mm: z3fold: deprecate CONFIG_Z3FOLD To: Yosry Ahmed Cc: Andrew Morton , Miaohe Lin , 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 , loongarch@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 1575B180003 X-Stat-Signature: u8zshc53mcz7brp5oasngkoqr7a1gggw X-Rspam-User: X-HE-Tag: 1725531591-265447 X-HE-Meta: U2FsdGVkX18v1y2DtcuAHo48IvT9CJIdTVcNTAd3qH3rWknE0BeADUfbo2jISbIuX7itHfXENwwSxeo6dMgHfWEZ+TFAP0X2F+mkHmi1AVIONSYg8NlnnZSyzYUbNMLyeNjokza7fcs8Xo6ia0SvFm1yws/VVHZL0mS0gnzHHjdIXtTVPrGHUQ0JDXj5BNLlqxEI9BWjdPvRPAx3P2VYWsjh/4DVuR0/6Xk9arvOfzbsvI/W8RyLPv3C+2FBOC6Hi9syVAWFsge7ynebdwhe9F7+AOtOTOVT4s6TWKcpDalqVFf8N14S405Q8lWqaE6eKyHWqP0K1CYnJUjDn/l2tcKNUmmRMiyUD4mvnSePKxUYX9DRtvYpgfc9bPV2BiBpsErJuEhq+BPkHer8OiqyyLF53rdR4uuXDQDzPYpRWr6q/OQ489rM4IBzXiOOiIbIekZGAjOHtBzgrSLRfqBBD0miIF9nFplz7tMizb1JVZC7S9w42fBQ2omJ5STaAp7sEB34qo6A2f1quQqIvYfp0NBJmPJOmDPIxpkxi6jJEgc6Np4Or+5smivyTg+Yl26p1cT2ejS9Zfp/rGHlMacfGBXkQYEMc6GOQcRdu2ABuJ+btXMZgTQM3EI0y+DqfwimqpHgr4P/i5R2cM2Z0ExTmchI88NLSLwov4YrZi6ADxW3lvgjqoXYlEPOkqb7S+jk25JTiPZtCArbLuMdbbwO8og8fzmKwZ2rQhRLoQNYt+Fropj2VCwputlRyjGhPYuZTRGyxtbPxPzRcj7MngH2ukeiC3Q5xWiyzZhcQ8HNRmQccgc20HhWVsu87lZ+TyD2ML8rCl7Y4seeWgp/PKFeEuGDYr4ZHXzLGE16Q3+Aj97GhAgBHWvI+a9lMnw1q3qzjHbhUAOkAihs143SPc7WJqz3vFXzqXoPx83x5+E7tGTSD6Nu0padDOsuGogtKoPag/Z614aGS1yZAHGjYAF 3sfea8tU em099ZvNoAz1L7Ad4NOUwL59W/rlicgYL7czKxYBcWWbqpTWlS4o9GYNeLzRhliqyKSvFDe5HaSxHhUALu2ACZI64GZsn+QHRFf+xSTqZb33YroGOQMQHCYhpvVXJMF3ezHQj9eiZeWPPG+VAqXf8IrUMiofA+D5DBpO15O4zEYQt7+jicnr4OJWAssJqN3hQ+wUc7iC+y+nseuhOBIns8FzumkwHBQHKiVNzogHMbma9gdnePDmnmVrZ3L+feiN8B2ZjAezhbbsY0Klv+M2q6uKuZmTeAFOP1U8FEjWXVdzpK99Gv+N1GZ8fXZLr6u8O9wjmUSimey3+Ny6Sw0KVBc/q1VqkbxhzFIkYVq4UQXs/9og/ApNBAcwDW1QYY8qD2aqi33TSI4yrgHdrKvuwpxxaRljPfMjFokTd+STGRb85yQxumjVHOcZ+VQ== 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, Sep 5, 2024 at 1:33=E2=80=AFAM 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=3Dy get a new > prompt with explanation during make oldconfig. Also, remove > CONFIG_Z3FOLD=3Dy from defconfigs. > > [1]https://lore.kernel.org/lkml/CAJD7tkbRF6od-2x_L8-A1QL3=3D2Ww13sCj4S3i4= bNndqF+3+_Vg@mail.gmail.com/ > [2]https://lore.kernel.org/lkml/EF0ABD3E-A239-4111-A8AB-5C442E759CF3@gmai= l.com/ > [3]https://lore.kernel.org/lkml/CAJD7tkbnmeVugfunffSovJf9FAgy9rhBVt_tx=3D= nxUveLUfqVsA@mail.gmail.com/ > > Acked-by: Chris Down > Acked-by: Nhat Pham > Signed-off-by: Yosry Ahmed Acked-by: Vitaly Wool > --- > > I think it should actually be fine to remove z3fold without deprecating > it first, but I am doing the due diligence. > > v1: https://lore.kernel.org/linux-mm/20240112193103.3798287-1-yosryahmed@= google.com/ > v1 -> v2: > - Make CONFIG_Z3FOLD_DEPRECATED a tristate option to match > CONFIG_Z3FOLD. > - Update commit subject and log. > > --- > arch/loongarch/configs/loongson3_defconfig | 1 - > arch/powerpc/configs/ppc64_defconfig | 1 - > mm/Kconfig | 14 ++++++++++++-- > 3 files changed, 12 insertions(+), 4 deletions(-) > > diff --git a/arch/loongarch/configs/loongson3_defconfig b/arch/loongarch/= configs/loongson3_defconfig > index b4252c357c8e2..75b366407a60a 100644 > --- a/arch/loongarch/configs/loongson3_defconfig > +++ b/arch/loongarch/configs/loongson3_defconfig > @@ -96,7 +96,6 @@ CONFIG_ZPOOL=3Dy > CONFIG_ZSWAP=3Dy > CONFIG_ZSWAP_COMPRESSOR_DEFAULT_ZSTD=3Dy > CONFIG_ZBUD=3Dy > -CONFIG_Z3FOLD=3Dy > CONFIG_ZSMALLOC=3Dm > # CONFIG_COMPAT_BRK is not set > CONFIG_MEMORY_HOTPLUG=3Dy > diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/= ppc64_defconfig > index 544a65fda77bc..d39284489aa26 100644 > --- a/arch/powerpc/configs/ppc64_defconfig > +++ b/arch/powerpc/configs/ppc64_defconfig > @@ -81,7 +81,6 @@ CONFIG_MODULE_SIG_SHA512=3Dy > CONFIG_PARTITION_ADVANCED=3Dy > CONFIG_BINFMT_MISC=3Dm > CONFIG_ZSWAP=3Dy > -CONFIG_Z3FOLD=3Dy > CONFIG_ZSMALLOC=3Dy > # CONFIG_SLAB_MERGE_DEFAULT is not set > CONFIG_SLAB_FREELIST_RANDOM=3Dy > diff --git a/mm/Kconfig b/mm/Kconfig > index b23913d4e47e2..536679d726417 100644 > --- a/mm/Kconfig > +++ b/mm/Kconfig > @@ -177,15 +177,25 @@ config ZBUD > deterministic reclaim properties that make it preferable to a h= igher > density approach when reclaim will be used. > > -config Z3FOLD > - tristate "3:1 compression allocator (z3fold)" > +config Z3FOLD_DEPRECATED > + tristate "3:1 compression allocator (z3fold) (DEPRECATED)" > depends on ZSWAP > help > + Deprecated and scheduled for removal in a few cycles. If you ha= ve > + a good reason for using Z3FOLD over ZSMALLOC, please contact > + linux-mm@kvack.org and the zswap maintainers. > + > A special purpose allocator for storing compressed pages. > It is designed to store up to three compressed pages per physic= al > page. It is a ZBUD derivative so the simplicity and determinism= are > still there. > > +config Z3FOLD > + tristate > + default y if Z3FOLD_DEPRECATED=3Dy > + default m if Z3FOLD_DEPRECATED=3Dm > + depends on Z3FOLD_DEPRECATED > + > config ZSMALLOC > tristate > prompt "N:1 compression allocator (zsmalloc)" if ZSWAP > -- > 2.46.0.469.g59c65b2a67-goog >