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 D3E3BC0218A for ; Tue, 28 Jan 2025 16:45:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5883F6B0092; Tue, 28 Jan 2025 11:45:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 537FD28023E; Tue, 28 Jan 2025 11:45:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 38AD128021C; Tue, 28 Jan 2025 11:45:37 -0500 (EST) 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 174CD6B0092 for ; Tue, 28 Jan 2025 11:45:37 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id B8F0A1A0230 for ; Tue, 28 Jan 2025 16:45:36 +0000 (UTC) X-FDA: 83057436672.24.20D346D Received: from out-176.mta1.migadu.com (out-176.mta1.migadu.com [95.215.58.176]) by imf11.hostedemail.com (Postfix) with ESMTP id 348404001C for ; Tue, 28 Jan 2025 16:45:33 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=dU4N4Rtd; spf=pass (imf11.hostedemail.com: domain of yosry.ahmed@linux.dev designates 95.215.58.176 as permitted sender) smtp.mailfrom=yosry.ahmed@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1738082734; 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=kFn2LRktG0Yh49QeDRr4sIglpLvhfNsWy0wwyTzZW7o=; b=JbBvKt9wI5QLUiFgQTNxSrKhHMaiNoddvx9TsTAsvBOUUx1nkfidRjT0XlkHw8xJMEiuEl wz9RoGUN41Bf9+Cv3LKbSA+KVZiis9WHqaIvpeoLVxBQPFnbKrNaxfqxW9WEjRLQVZh0q3 IGp8RyqSR/UlHuXHRW8a0SAim/vGb0Y= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=dU4N4Rtd; spf=pass (imf11.hostedemail.com: domain of yosry.ahmed@linux.dev designates 95.215.58.176 as permitted sender) smtp.mailfrom=yosry.ahmed@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1738082734; a=rsa-sha256; cv=none; b=DcWWQGqOv66qwdGhR03GIyX2eHWGWf7JFTnJHkxen04z+gMQ29E8wVFzDP6SRfvtqW/ouo 9ixbZe147DxTUsVNKFO9ni0klk9ToN0KrE1cdB0C4A/1j6v8iPEI21vkrNpq0X2osckCw9 nQ5BP+kViZQDBJaAEBU6l2d87lJFX5o= Date: Tue, 28 Jan 2025 16:45:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1738082730; h=from:from: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=kFn2LRktG0Yh49QeDRr4sIglpLvhfNsWy0wwyTzZW7o=; b=dU4N4RtdaNXQdjsYxVWbiur5qO45uVfOc1rAYBA/k2e7UilCJWv/EKZkThc4R+Fj+NlLXx TxrCFFhqKRqApt47wQR3eRHw2rTDgDOFrFrVhdHPKOfjUCPT6E0OrzS5pc15SfK73+OHUN W7nMZ90raGJsKMl11CBoCpIcfcrc3Bo= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yosry Ahmed To: Seth Jennings Cc: Vlastimil Babka , Andrew Morton , Vitaly Wool , Miaohe Lin , Johannes Weiner , Nhat Pham , Chengming Zhou , Huacai Chen , Dan Streetman , WANG Xuerui , linux-mm@kvack.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev Subject: Re: [PATCH 1/2] mm: zbud: deprecate CONFIG_ZBUD Message-ID: References: <42b24914-719a-4ff1-9d77-f6517717344f@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 348404001C X-Stat-Signature: ar7e6o99e1sd6tfxgg3p8i4qj7ckn1uj X-HE-Tag: 1738082733-449574 X-HE-Meta: U2FsdGVkX1847S/fPUc3L4h23CjVcnCmx2xRs3Hqr0SUgqnYo8Kn/TU3D6w20p0twVLILoxzYnAz3+Og7apupVV6zVlcohEQUp0wUWQv4n24Ks54URJ2X7m8cTg4CKvp0nhdPKbl6fj+55DUXAnWHI1svuWdCDr+uEVup29ghY+gMEgS03YE1HGMFruES6zxpGfwu1PMaMJ0qUE7yv4Pmijsv3RvJyeQmsezLAJr75iDJmqLao7xnKOhpCTDm49QKjNVvAqx3MvHQUNCFD/qkSteyL3P21WEWBjMWLp9rVfTqU80VXFQOhWVb9zy9pJUQmi2dr98LnPfcxQR1899WczxMoorVasTWSJ8ANmK9I8h13GTxytb8XU+10YK5NQwo5AVnZNdBy8EvFXipY8Sk7tpshZVgugelMlWmkm/RJicHWjVm/5XWtnmiuhFKwYZtOFh9l1SjnpKZtaCFKq57SUHdEodWoiWBwKDpm/5j6X/bLmYqLvtRwO2qDpMUG2mnX6tQHjbFAf+/PPtYnbKHj44GdZ8lIavSOjI3JIn0UoHgJ8YVLoX4zUBxxVaI2wuZrXmjVTQHPSQ5JidI4q9rWsq5zoSpfY1tNYJih4gME+lw7YGN28dA08SyNAiabq1RJ1xem8KYqvCLOLh+CGDPCvzo1ICV43DupnMY9LB8zngeE/FzQdRgEH+JuaEN+1sfuvlpHaGqkQ/TgLwv437Vx5T6Lqst43CidciPxEklDP/Q544r10nOCvYf1LVeYAE1uRTeKCmTHB7z+b5qXSvB52z4Scnrqp7hfDZIe5PRq8cEMdGF/7UrZg4yvvlgVAMSSVduseY741YuLS/JOylMhyh0O5wC84TXsG0ZDv7h4ihPOXQZq6sGPDNs4CIoz/PsKYbuECp0GXHBecJAgn1sfm7lkAAo/5PP50rCEuVxZWn6f0L6DqjkaajBkCm9gYPsy2H4kJnMDCSIW/kgG1 98N82d1U gHXDAMTQoscS22g6sfYJLhRyglW1o9/xTOz1Ubmf2r0pYfmIRqXJS8rGC7uSuP38i5Hkhu/CaFKdcj5hBuMvdv7iLVcBRc3X8Tr75H3OclcbJnt5BE/g03MaS0TPNuNPsE1QYCRwrcHNrHxcngZHr8njFmMFLRqllfkMwteer9PEi2Ar6NWl9mRWsAzZ0FOswA1YnRTZka+319cymxsCiUBCQnqmIF1QvmTbkz+5/74R5rpqWgPJ7OHrzyqre1HQ931udMJVmDsmUEj5j2p59aDOu1tSVQylJV+aUshNkYrIgEqEarvJGuHDULT5YR9lmXCm1 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 Tue, Jan 28, 2025 at 10:04:27AM -0600, Seth Jennings wrote: > On Tue, Jan 28, 2025 at 9:37 AM Yosry Ahmed wrote: > > > > On Tue, Jan 28, 2025 at 11:21:10AM +0100, Vlastimil Babka wrote: > > > On 1/28/25 00:58, Yosry Ahmed wrote: > > > > The zbud compressed pages allocator is rarely used, most users use > > > > zsmalloc. zbud consumes much more memory (only stores 1 or 2 compressed > > > > pages per physical page). The only advantage of zbud is a marginal > > > > performance improvement that by no means justify the memory overhead. > > > > > > > > Historically, zsmalloc had significantly 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]. In a kernel build test on tmpfs > > > > in a limited cgroup, zbud 2-3% less time than zsmalloc, but at the cost > > > > of using ~32% more memory (1.5G vs 1.13G). The tradeoff does not make > > > > sense for zbud in any practical scenario. > > > > > > > > The only alleged advantage of zbud is not having the dependency on > > > > CONFIG_MMU, but CONFIG_SWAP already depends on CONFIG_MMU anyway, and > > > > zbud is only used by zswap. > > > > > > > > Following in the footsteps of [2], which deprecated z3fold, deprecated > > > > zbud as planned and remove it in a few cycles if no objections are > > > > raised from active users. > > > > > > > > Rename the user-visible config options so that users with CONFIG_ZBUD=y > > > > get a new prompt with explanation during make oldconfig. Also, remove > > > > CONFIG_ZBUD from defconfig. > > > > > > > > [1]https://lore.kernel.org/lkml/CAJD7tkbRF6od-2x_L8-A1QL3=2Ww13sCj4S3i4bNndqF+3+_Vg@mail.gmail.com/ > > > > [2]https://lore.kernel.org/lkml/20240904233343.933462-1-yosryahmed@google.com/ > > > > > > > > Signed-off-by: Yosry Ahmed > > > > > > Seems weird not to Cc the folks listed in MAINTAINERS for ZBUD? Unless their > > > addresses are known to bounce? > > > > Ugh I had them in the CC list, but I played around with it and probably > > lost them :/ > > > > Seth, Dan, apologies. > > I haven't contributed in this space for quite some time so I defer to > more active contributors on this. > > If it is true that zsmalloc has no/negligible deficiencies compared to > zbud, it seems reasonable. Zsmalloc has been the default allocator and is widely used, I am unaware of any zbud users in prod settings. > > but at the cost of using ~32% more memory > > I do push back here as this % could be highly variable depending on > the compressibility of the data. 100% agreed, this is just an example from this specific testing scenario. > If the average compressibility is ~50%, zbud should be very memory efficient. > > If the average compressibility is very high or very low, it is less > memory efficient. That being said, the average compression ratio hovers around 30% for workloads I am familiar with. I think I have seen similar ratios from others as well but I will let others chime in.