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 384D7C48BEB for ; Thu, 22 Feb 2024 06:46:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2EB126B006E; Thu, 22 Feb 2024 01:46:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 29B796B0071; Thu, 22 Feb 2024 01:46:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 13C736B0072; Thu, 22 Feb 2024 01:46:24 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 025E16B006E for ; Thu, 22 Feb 2024 01:46:23 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 9770A1A0C85 for ; Thu, 22 Feb 2024 06:46:23 +0000 (UTC) X-FDA: 81818505846.05.C41585B Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) by imf09.hostedemail.com (Postfix) with ESMTP id 3B3AE140008 for ; Thu, 22 Feb 2024 06:46:20 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=Gl5V7Acl; dmarc=pass (policy=quarantine) header.from=bytedance.com; spf=pass (imf09.hostedemail.com: domain of hezhongkun.hzk@bytedance.com designates 209.85.167.53 as permitted sender) smtp.mailfrom=hezhongkun.hzk@bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708584382; 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=3cSyGKG6RJTtrUN3YM2qk3bT/yMnWF63aXnhhLxjivo=; b=ZN2LlIKEwsvV7JdWWxO0IsXZXAMhWe9Ajj9av4ceYAWbR+FA8ezxTWRsbl/GiWscyLu1ag zgVGptvZKPHd5DgA14B0sKCFfj/6wPiKzkNZn/zeZbMpQh1XyUcdawkX22WBKltasOlQxw P6gc6t6Rvty+ebLjisnae0Dnp0fRHY0= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=Gl5V7Acl; dmarc=pass (policy=quarantine) header.from=bytedance.com; spf=pass (imf09.hostedemail.com: domain of hezhongkun.hzk@bytedance.com designates 209.85.167.53 as permitted sender) smtp.mailfrom=hezhongkun.hzk@bytedance.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708584382; a=rsa-sha256; cv=none; b=xMUP6FWXqYqxP1Q/SsqxMDDLAV7oyk+SfuoTVQaz9TBeRYIVyYd5Bf7L6Z1ANg/RVif0Ej axf4+u6dHiH9OZWHNt37RRx3RnOq/KBAAK9S/IhQUfOK3YDzimV8rO1l0rwAr4NgePa8LW OzhLuTAXwgKYiZqn9ZUYauEe98H3c1U= Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-512ab55fde6so6444728e87.2 for ; Wed, 21 Feb 2024 22:46:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1708584379; x=1709189179; 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=3cSyGKG6RJTtrUN3YM2qk3bT/yMnWF63aXnhhLxjivo=; b=Gl5V7AclercF1skttdcUy26akzr6tUznBp66F1ug/HbHO6vPhvjg3uGjP98m5wZ3yg jJK2BZUxrjo0TBcbIFG2CRXf5xWNVUAhJzxbCyURcmts70fOb0rJJ5fkYwmYy2GQy3u2 O00OCm6k+r9mirTmHn5DVn+RtsAy0qzcVyNRAvwRg3KkHgdd9V8ytDSO411D+7HLMvU0 ZGTg/4TECEe0gYPkwMDWd0BS1KKUdZek/7rhtArRVC1RTRrn7r4whPJGZp8jQw0X3u2t clA7XJgEcIupO6PdeZR2Ihvup9xGzptuAZrUjdSnUfqfbBs1Ajygj0brRxSdiecZmRMs 6Ivw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708584379; x=1709189179; 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=3cSyGKG6RJTtrUN3YM2qk3bT/yMnWF63aXnhhLxjivo=; b=T37GJv4bQywLRGyYtkUCFhH2Qy/qn+1mNgLvcmZr4fxBQLTvk1exJgaC0B1TEMHJWS TxiSVz0kj1hnRDCQiPYHi9chZG8hOfLcO9t0qB8uJBc9bFf2d58h70SUeek1M9SyKiBt jMBXrNHj63tKn/rJoXklCPLHIND4qhI0i+STfJr0cuA0n8lFMdmcMsfdHwnQs/AyoLRE hj8oOl5lqkTdokBsr/u4zcPOd5mGRcXQ83MdCfiTy7s/RclqjP4DVeoNMVvNa8zWSAJC B+9HYKprtBjy0UZ22L5nCUoCszRwajZpWatNKu+wezXDbUC5LIgJc7bzEs+/StUXoitq Um+Q== X-Forwarded-Encrypted: i=1; AJvYcCX6SmZWqMXQK7ZkksVLtoQf6Cluv9uWLeDRvhjw7OrONCFP6QTel6WXUmyPuJ7h5RWuWUs8IT2tXo3Cif/h3gx/dCM= X-Gm-Message-State: AOJu0YyISQj9dB/g3NqYn/tb9ORZZOIFRLLZ53zbVZwNgSkRDlVfACEI DRgcHPUcvbeKvBW9SgaCYdazL1VxEEtC0Lg1EoqaLfD9D8AwdgKXV3ZDj5DFW7eSMY8HQfKjSsM oJhaIBvbZWDc2Wvb0WvfFYEHeHz9SlkqdzzpPlw== X-Google-Smtp-Source: AGHT+IFCazBVkU5oQbjM3Ki6AJPYszSsGcPNPfqmeQOdrLMxPk6jIMY5qCqWqmBJrkuyccOjhwc+4Chyu0I5OnWCdq4= X-Received: by 2002:a05:6512:3d01:b0:512:daac:d9bc with SMTP id d1-20020a0565123d0100b00512daacd9bcmr917855lfv.15.1708584378934; Wed, 21 Feb 2024 22:46:18 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Zhongkun He Date: Thu, 22 Feb 2024 14:46:07 +0800 Message-ID: Subject: Re: [External] [RFC] Analyzing zpool allocators / Removing zbud and z3fold To: Yosry Ahmed Cc: Andrew Morton , Vitaly Wool , Miaohe Lin , Johannes Weiner , Nhat Pham , Linux-MM , Linux Kernel Mailing List , Christoph Hellwig , Sergey Senozhatsky , Minchan Kim , Chris Down , Seth Jennings , Dan Streetman , Chris Li Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 3B3AE140008 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 1w6f5mhqe1s6ggezjuszp7cjoqahreor X-HE-Tag: 1708584380-254090 X-HE-Meta: U2FsdGVkX18SBBFpGbugL96acqeTZKiEIJmh/bYMBKXLVb6wDHTAZ38/fWb2p68Bpw3/MLw7rF6A2YO6/uRb5ys5FHUeZF6MWk8BSs/qiHyl8pZgasJq8FOoLqE9KMlT+cW+1TD0vaLuTMFxS3u0Q+CZlO/Z2oqr+qtFrjpcjBkLohWkC58AWTvXstSGvsJDli0LxDneBKY/oXe6XULA6AoUKMqXVma4v6m8aTeMAWrnoR0QTtEFbdKYIZ9dTVg6CAooeLpRM8s1m/Eip6vUZ12Mr2ZpeKOF/FGlowYXz7QMXFILm5BzUXNg2xmuolO6lt7Q0acqS4/fBcrJfPLTh5LCwyhTWJ1t2wKFgalyZK2eSTZcb/gyEdAVun6wzbpLujoAh4+joQLhn3SJJ82F4F6BKKAhR6R+541VTrOYhg1VNer5K0NRZvj4PzTV3g5fzWmmD71IQnED8ckBfX0D3wXmF80sgcC5ExD+4m/DQgn0Szi7ePix4IPSLVU63DQ9cicu+uKIAOWkUMajdrebsrLw82QQZhaDqyfkCQSKD7IEvowrjqyibfi9aLI6xRLlKa8jkBXrYQcAJQB1qvxTsFwpqqXHqOQW2f928GAiuCxxIfS7FlCF/VmOV2q7b4FObeLUgJpXmpR591Y8O0nuuMprMtgDw4HBK/ny/I+Dc8p0Ga4Hiv/agMqOk7K4gL/Xddh3KIYna7uZ10ht6ZV9QwDZlqYZdVvwrCU6T/avyD3v9nLkPZM1taeQmC/kKVVPqwgfFp/NWMV7T35pRkqY6ovzKg1Kt+su0vfv0GvHxAE9IIn6nNWOCyEwkKfjWmaGcug4Vg4PaJn4zzAPwDpednaxY+Ul0FYpXYsdnYNwM4wBPlmcOhQz+EDh8FtokYTTGyuCNO3T3puOCUp9+4LtrMya68Hax84ECuhJrVJ6PfN44OnV92qJ2WjhaZMrC7Lkb8h49414OxUzt/59oo0 SB77p6Fv lTmLZa5j5IpufmCI= 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 Fri, Feb 9, 2024 at 11:28=E2=80=AFAM Yosry Ahmed = wrote: > > Hey folks, > > This is a follow up on my previously sent RFC patch to deprecate > z3fold [1]. This is an RFC without code, I thought I could get some > discussion going before writing (or rather deleting) more code. I went > back to do some analysis on the 3 zpool allocators: zbud, zsmalloc, > and z3fold. > > [1]https://lore.kernel.org/linux-mm/20240112193103.3798287-1-yosryahmed@g= oogle.com/ > > In this analysis, for each of the allocators I ran a kernel build test > on tmpfs in a limit cgroup 5 times and captured: > (a) The build times. > (b) zswap_load() and zswap_store() latencies using bpftrace. > (c) The maximum size of the zswap pool from /proc/meminfo::Zswapped. > > Here are the results I have. I am using zsmalloc as the base for all > comparisons. > > -------------------------------- ------------------------------= -- > > (a) Build times > > *** zsmalloc *** > =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80 > LABEL =E2=94=82 MIN =E2=94=82 MAX =E2=94=82 MEAN =E2=94= =82 MEDIAN =E2=94=82 STDDEV > =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80 > real =E2=94=82 108.890 =E2=94=82 116.160 =E2=94=82 111.304 =E2=94= =82 110.310 =E2=94=82 2.719 > sys =E2=94=82 6838.860 =E2=94=82 7137.830 =E2=94=82 6936.414 =E2=94= =82 6862.160 =E2=94=82 114.860 > user =E2=94=82 2838.270 =E2=94=82 2859.050 =E2=94=82 2850.116 =E2=94= =82 2852.590 =E2=94=82 7.388 > =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80 > > *** zbud *** > =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80 > LABEL =E2=94=82 MIN =E2=94=82 MAX =E2=94=82 MEAN =E2=94= =82 MEDIAN =E2=94=82 STDDEV > =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80 > real =E2=94=82 105.540 =E2=94=82 114.430 =E2=94=82 108.738 =E2=94= =82 108.140 =E2=94=82 3.027 > sys =E2=94=82 6553.680 =E2=94=82 6794.330 =E2=94=82 6688.184 =E2=94= =82 6661.840 =E2=94=82 86.471 > user =E2=94=82 2836.390 =E2=94=82 2847.850 =E2=94=82 2842.952 =E2=94= =82 2843.450 =E2=94=82 3.721 > =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80 > > *** z3fold *** > =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80 > LABEL =E2=94=82 MIN =E2=94=82 MAX =E2=94=82 MEAN =E2=94= =82 MEDIAN =E2=94=82 STDDEV > =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80 > real =E2=94=82 113.020 =E2=94=82 118.110 =E2=94=82 114.642 =E2=94= =82 114.010 =E2=94=82 1.803 > sys =E2=94=82 7168.860 =E2=94=82 7284.900 =E2=94=82 7243.930 =E2=94= =82 7265.290 =E2=94=82 42.254 > user =E2=94=82 2865.630 =E2=94=82 2869.840 =E2=94=82 2868.208 =E2=94= =82 2868.710 =E2=94=82 1.625 > =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80 > > Comparing the means, zbud is 2.3% faster, and z3fold is 3% slower. > > (b) zswap_load() and zswap_store() latencies > > *** zsmalloc *** > > @load_ns: > [128, 256) 377 | = | > [256, 512) 772 | = | > [512, 1K) 923 | = | > [1K, 2K) 22141 | = | > [2K, 4K) 88297 | = | > [4K, 8K) 1685833 |@@@@@ = | > [8K, 16K) 17087712 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@= @@@@@| > [16K, 32K) 10875077 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ = | > [32K, 64K) 777656 |@@ = | > [64K, 128K) 127239 | = | > [128K, 256K) 50301 | = | > [256K, 512K) 1669 | = | > [512K, 1M) 37 | = | > [1M, 2M) 3 | = | > > @store_ns: > [512, 1K) 279 | = | > [1K, 2K) 15969 | = | > [2K, 4K) 193446 | = | > [4K, 8K) 823283 | = | > [8K, 16K) 14209844 |@@@@@@@@@@@ = | > [16K, 32K) 62040863 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@= @@@@@| > [32K, 64K) 9737713 |@@@@@@@@ = | > [64K, 128K) 1278302 |@ = | > [128K, 256K) 487285 | = | > [256K, 512K) 4406 | = | > [512K, 1M) 117 | = | > [1M, 2M) 24 | = | > > *** zbud *** > > @load_ns: > [128, 256) 452 | = | > [256, 512) 834 | = | > [512, 1K) 998 | = | > [1K, 2K) 22708 | = | > [2K, 4K) 171247 | = | > [4K, 8K) 2853227 |@@@@@@@@ = | > [8K, 16K) 17727445 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@= @@@@@| > [16K, 32K) 9523050 |@@@@@@@@@@@@@@@@@@@@@@@@@@@ = | > [32K, 64K) 752423 |@@ = | > [64K, 128K) 135560 | = | > [128K, 256K) 52360 | = | > [256K, 512K) 4071 | = | > [512K, 1M) 57 | = | > > @store_ns: > [512, 1K) 518 | = | > [1K, 2K) 13337 | = | > [2K, 4K) 193043 | = | > [4K, 8K) 846118 | = | > [8K, 16K) 15240682 |@@@@@@@@@@@@@ = | > [16K, 32K) 60945786 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@= @@@@@| > [32K, 64K) 10230719 |@@@@@@@@ = | > [64K, 128K) 1612647 |@ = | > [128K, 256K) 498344 | = | > [256K, 512K) 8550 | = | > [512K, 1M) 199 | = | > [1M, 2M) 1 | = | > > *** z3fold *** > > @load_ns: > [128, 256) 344 | = | > [256, 512) 999 | = | > [512, 1K) 859 | = | > [1K, 2K) 21069 | = | > [2K, 4K) 53704 | = | > [4K, 8K) 1351571 |@@@@ = | > [8K, 16K) 14142680 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@= @@@@@| > [16K, 32K) 11788684 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ = | > [32K, 64K) 1133377 |@@@@ = | > [64K, 128K) 121670 | = | > [128K, 256K) 68663 | = | > [256K, 512K) 120 | = | > [512K, 1M) 21 | = | > > [512, 1K) 257 | = | > [1K, 2K) 10162 | = | > [2K, 4K) 149599 | = | > [4K, 8K) 648121 | = | > [8K, 16K) 9115497 |@@@@@@@@ = | > [16K, 32K) 56467456 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@= @@@@@| > [32K, 64K) 16235236 |@@@@@@@@@@@@@@ = | > [64K, 128K) 1397437 |@ = | > [128K, 256K) 705916 | = | > [256K, 512K) 3087 | = | > [512K, 1M) 62 | = | > [1M, 2M) 1 | = | > > I did not perform any sophisticated analysis on these histograms, but > eyeballing them makes it clear that all allocators have somewhat > similar latencies. zbud is slightly better than zsmalloc, and z3fold > is slightly worse than zsmalloc. This corresponds naturally to the > build times in (a). > > (c) Maximum size of the zswap pool > > *** zsmalloc *** > 1,137,659,904 bytes =3D ~1.13G > > *** zbud *** > 1,535,741,952 bytes =3D ~1.5G > > *** z3fold *** > 1,151,303,680 bytes =3D ~1.15G > > zbud consumes ~32.7% more memory, and z3fold consumes ~1.8% more > memory. This makes sense because zbud only stores a maximum of two > compressed pages on each order-0 page, regardless of the compression > ratio, so it is bound to consume more memory. > > -------------------------------- -----------------------------= --- > > According to those results, it seems like zsmalloc is superior to > z3fold in both efficiency and latency. Zbud has a small latency > advantage, but that comes with a huge cost in terms of memory > consumption. Moreover, most known users of zswap are currently using > zsmalloc. Perhaps some folks are using zbud because it was the default > allocator up until recently. The only known disadvantage of zsmalloc > is the dependency on MMU. > > Based on that, I think it doesn't make sense to keep all 3 allocators > going forward. I believe we should start with removing either zbud or > z3fold, leaving only one allocator supporting MMU. Once zsmalloc > supports !MMU (if possible), we can keep zsmalloc as the only > allocator. Hi Yosry, that sounds greate to me. I was reviewing the code for allocators recently and couldn't find the advantages of z3fold even without doing performance testing. It would be better if there was only one allocator which would simplify the code and interface. > > Thoughts and feedback are highly appreciated. I tried to CC all the > interested folks, but others feel free to chime in. >