From patchwork Tue Jun 20 19:46:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yosry Ahmed X-Patchwork-Id: 13286416 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 D8DB3EB64D8 for ; Tue, 20 Jun 2023 19:46:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 249BB8D0002; Tue, 20 Jun 2023 15:46:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1D2C68D0001; Tue, 20 Jun 2023 15:46:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 09AB28D0002; Tue, 20 Jun 2023 15:46:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id EE4608D0001 for ; Tue, 20 Jun 2023 15:46:51 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id BB039160294 for ; Tue, 20 Jun 2023 19:46:51 +0000 (UTC) X-FDA: 80924159022.01.C53FC83 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) by imf17.hostedemail.com (Postfix) with ESMTP id DD2414001F for ; Tue, 20 Jun 2023 19:46:48 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b="pap/Vep9"; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf17.hostedemail.com: domain of 3JwKSZAoKCJ4WMQPW8FKCBEMMEJC.AMKJGLSV-KKIT8AI.MPE@flex--yosryahmed.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=3JwKSZAoKCJ4WMQPW8FKCBEMMEJC.AMKJGLSV-KKIT8AI.MPE@flex--yosryahmed.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1687290409; 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: references:dkim-signature; bh=e8e/gV6Ny17QnNph6JSaPejJmkR8uPNsGl7TybykgrQ=; b=rPuzgiy3At7G6IkOivGcWs9C/n7VRy+bG3CfbTL2JlgYv4T5Zn49Ptt2bv3m83AGToC+jr zd+BptyhytsLMO9lbUt2QJKKM2ug4DZOeLfExFNHsqqsJD2HN0qjO+rY6MoOy3D3KHqB6u KqUwWviHrUop5070c/Id2uBQuEmqUvM= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b="pap/Vep9"; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf17.hostedemail.com: domain of 3JwKSZAoKCJ4WMQPW8FKCBEMMEJC.AMKJGLSV-KKIT8AI.MPE@flex--yosryahmed.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=3JwKSZAoKCJ4WMQPW8FKCBEMMEJC.AMKJGLSV-KKIT8AI.MPE@flex--yosryahmed.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687290409; a=rsa-sha256; cv=none; b=Az/b/Ya14onhiYUcshoi00YtcrzCxvfI0JSSAOMFTf0JrdN0llUKMHv6u9Atsmxi7GGahQ kNJ5bFef1f1hIOTLtff50LmMrGBrDm0I2KsCTTqiqv1L1NSDqC1maE0JZmuvo9daZvkMU0 JRyc/NHTOVKRiLXHJrJBF9gK4dPYUfc= Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-1b5277e57d6so40155555ad.0 for ; Tue, 20 Jun 2023 12:46:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1687290407; x=1689882407; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=e8e/gV6Ny17QnNph6JSaPejJmkR8uPNsGl7TybykgrQ=; b=pap/Vep95TcKYRt7RN39zXtGOPI9M/9cgLzA0WC6HrCL1AGOnPAQmfSNG1LBsBxnmC s30PF/3nnx+kxDpbnWpMwhodxr5AzrIm3SmJnHmvB1GnrpL8Td9bPlciJBYwCD01kHis DF/Rug8W4scSK/7L2sp7Y61Z4I++fTBifJwp/t4M7PyD547PyCfuDWBhObbqboAhX1Cd mWLw8z4nVGdtTuOloJTlvAQK9Aoqj4t66jRvRk5qDsnlBhwZ34xpukJgAewBt9IWWyhB Zx9LyFDOkARWwxT2mMVTJgY+mELmMM3/jl5i01WCf2XkDwntZPhuWfATiStIjjVbWSiu P8ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687290407; x=1689882407; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=e8e/gV6Ny17QnNph6JSaPejJmkR8uPNsGl7TybykgrQ=; b=F2naTkwEvTGeXXq58A7x3AG40XxhKyCdUGBdYLU5ioDqciw4jL2aXvvalPMLoZFuYC wx3bqviUyNU6NTAM890AjDF3SxTvEbILGhFXAZKqx8ri9n9RkQiUIqh0guA26u8e2EpA BE4cTaMzLK2WvjV7xzrVNNWAt8gBjj37rVHa+32qpWucWlnE0haI/RyzfZs5R8KJg2Ha zH5AHajwG37JWYByYLAlOBtm+Cx/Hy+oqOv9C1lWzQj/9tcJzspIz7dLI2lgTI2SD3pe z5lBz0TMfRsOF5hKP2VFPArCXS7y6iXuD3ARM37+1uahVtDxLlYji6940sg1asBza9ES UTqA== X-Gm-Message-State: AC+VfDzHTbmUyGJmD5gMCHJvDxMOIOjkM4++XwySSqvJF0Yh4FK98z/n //6ue7FBOlQPkLkfJm/nmElBevhf/0jQ7VC3 X-Google-Smtp-Source: ACHHUZ6FoE0jd8KPaT8+WeSftXc3Jnt4nNdvn+DOWQIe3j15VPfVvB1QYOATlSumBWRjQ9fbEeWMvh2+NMkwRvjd X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2327]) (user=yosryahmed job=sendgmr) by 2002:a17:902:c109:b0:1b5:3912:5c13 with SMTP id 9-20020a170902c10900b001b539125c13mr1670157pli.1.1687290407453; Tue, 20 Jun 2023 12:46:47 -0700 (PDT) Date: Tue, 20 Jun 2023 19:46:44 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog Message-ID: <20230620194644.3142384-1-yosryahmed@google.com> Subject: [PATCH v3] mm: zswap: multiple zpools support From: Yosry Ahmed To: Andrew Morton , Konrad Rzeszutek Wilk , Seth Jennings , Dan Streetman , Vitaly Wool Cc: Johannes Weiner , Nhat Pham , Domenico Cerasuolo , Yu Zhao , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yosry Ahmed X-Rspam-User: X-Stat-Signature: bizzh4mty43sb81j1f4u9g5x1n67yf88 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: DD2414001F X-HE-Tag: 1687290408-741209 X-HE-Meta: U2FsdGVkX1+u2rUB49h25THWI7+DdGv0/WowZ3Ypw6bH7okM4Mk9qIKvpYbhSS/mczQeDne4RyEpWTDMHYWMUETH6iiqOOInDaW4GJdmfZ7vUdMFbEstKDXoZI7XYW4ulWTWgBUmk98VBDvLjYRoSLBZoaMKLu6NFY+5ySJ++nd8e/YXKP50by/QRadfe2F8V9HOF0Nvml4O0GYzn7DCtaSKod8B6PeLaUcoXWqF0UBJgLhMAIw9R1dvy+VQl7cycBV7j8LkzcnF+4yS8YUg/3YO61SyhoYZb09ZVv2bToIIVrYo5yM2oKgURtC6QMA/gGD53KTgsEvPrUvNTyT1XDQnSw+zLHyWtr/EtJy34J6xxqlr31o9feaRLwWemIlm/7/Jhk9f9lo9itOojLOaunMlfbh8O68HG/Q+Y1PzUVbCKobuqfhHIldu9a0XjCQHtcq/ywB+fg6+/KQcXUR5bPKDeVogHgvZ1u4M7EhxvNdWnuJEQdmOoQFevlQ1bkIw9U0p/IOSfBupCy7QHCH2JtzQlHua+pn1dKun5UspjxW/QAQo/8axKAu971EZulKQ2zIKmX2cCN1xvA+TQ76LJje51k5qRDEuGMaoI2iIuv5lcD1JVD+th5nmcActrg4GLse/RIHmaVV3Lgo/LdhVyk4fADFInFS25azJIsDeRcK/Rue8dFA3eYv+7FbGN6LElq39ezOWmJmhd5VG7hwzcvH25JEOX4yo8vW5WiaDtn4oVeEb6SLvZ82XsU8rMrRA3xEfMyumcwd2CXEUIsAxaKhqWsn6Vu436GvTifdYu/tKk9BI2ujLZLfIEgEJXRcQ3ljYj+cCSP4K44/qtfvs87Fr61Fi+rsECQOhwOur1s4p+4K4cyQzzYTjgVkmQr0UpLwm7rgjtVsWC1WNItO5vp6wQwa2WsO9Zi+lszZ8PjEbWaOViZV3rYWoJwnRHhh5egCZPhQMeu3zvGl5Owc eSJCgaYV SKy2f+uJ5YxSqGLuwO/oCW7aa3bAP0CZIrUTinFB2pI1SQu2dGfqbHJNxOs3T5teYFNc2loDMt6/uMxXs4p7k5ktr+MRb64Vqe/9lE8N3gmu977R5A+T5buFIwh+Aa5lI2P4RN1yyworxiqoskIzSmOWbqTjONuHU5w+yvP3JBYgWQjZjPBU8xeliWVNl0hFdlvHz2DtA5D2fmnSbPFPdSL/LOcwN4uGgdlOburkvesXPDI3GO6T3Y0Invs7mtZV2Ol2pgH1OoeUe1ThC/uu37tKGgMu9jDqGfCvDV4YGPAkbsufn0GBOwUPX0sCCd/X6EduY3Anbr9EH7+jpHttaixbJ3b8XB+4VjbrPYLANHYmtt7s8+IZCaujQqkn/I28WQh1VOuPUDcsY5BAZc4b9sg1tOwvqTrEJZt//4c9gWt+NC/KMOe9sWVNa4dShTn0T+RH79JTeCLHuTtBE89tDwNaI10gZVcpS+3GhR+T/GbbMnu9p+d6r3l0WkM871yKA+y5qfB4NjOlIo8Gew2T0pgHJr2Tn9LvMzeDt4VQK5aL5UNPL7gLc8toaJm/3jwsBO3j/QvP1J00wvMpMrf8gA6AnEFpQvpkwcOGLrRNDIvheeNI06ieipkSttiFDE+ok87DHRGkz5nuuHsc= 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: Support using multiple zpools of the same type in zswap, for concurrency purposes. A fixed number of 32 zpools is suggested by this commit, which was determined empirically. It can be later changed or made into a config option if needed. On a setup with zswap and zsmalloc, comparing a single zpool to 32 zpools shows improvements in the zsmalloc lock contention, especially on the swap out path. The following shows the perf analysis of the swapout path when 10 workloads are simultaneously reclaiming and refaulting tmpfs pages. There are some improvements on the swap in path as well, but less significant. 1 zpool: |--28.99%--zswap_frontswap_store | | |--8.98%--zpool_map_handle | | | --8.98%--zs_zpool_map | | | --8.95%--zs_map_object | | | --8.38%--_raw_spin_lock | | | --7.39%--queued_spin_lock_slowpath | |--8.82%--zpool_malloc | | | --8.82%--zs_zpool_malloc | | | --8.80%--zs_malloc | | | |--7.21%--_raw_spin_lock | | | | | --6.81%--queued_spin_lock_slowpath 32 zpools: |--16.73%--zswap_frontswap_store | | |--1.81%--zpool_malloc | | | --1.81%--zs_zpool_malloc | | | --1.79%--zs_malloc | | | --0.73%--obj_malloc | |--1.06%--zswap_update_total_size | |--0.59%--zpool_map_handle | | | --0.59%--zs_zpool_map | | | --0.57%--zs_map_object | | | --0.51%--_raw_spin_lock Suggested-by: Yu Zhao Signed-off-by: Yosry Ahmed Reviewed-by: Nhat Pham Tested-by: Nhat Pham --- v2 -> v3: - Removed config option (Johannes Weiner). Now it's a constant. - Fixed spelling typos (Yu Zhao). v1 -> v2: - Prettified perf graph in commit log. - Changed zswap_nr_zpools to a macro, changed zswap_pool->zpools to a fixed size array instead of a flex array. - Removed stale comment. --- mm/zswap.c | 81 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 54 insertions(+), 27 deletions(-) diff --git a/mm/zswap.c b/mm/zswap.c index 87b204233115..6ee7028497b8 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -142,6 +142,9 @@ static bool zswap_exclusive_loads_enabled = IS_ENABLED( CONFIG_ZSWAP_EXCLUSIVE_LOADS_DEFAULT_ON); module_param_named(exclusive_loads, zswap_exclusive_loads_enabled, bool, 0644); +/* Number of zpools in zswap_pool (empirically determined for scalability) */ +#define ZSWAP_NR_ZPOOLS 32 + /********************************* * data structures **********************************/ @@ -161,7 +164,7 @@ struct crypto_acomp_ctx { * needs to be verified that it's still valid in the tree. */ struct zswap_pool { - struct zpool *zpool; + struct zpool *zpools[ZSWAP_NR_ZPOOLS]; struct crypto_acomp_ctx __percpu *acomp_ctx; struct kref kref; struct list_head list; @@ -248,7 +251,7 @@ static bool zswap_has_pool; #define zswap_pool_debug(msg, p) \ pr_debug("%s pool %s/%s\n", msg, (p)->tfm_name, \ - zpool_get_type((p)->zpool)) + zpool_get_type((p)->zpools[0])) static int zswap_writeback_entry(struct zswap_entry *entry, struct zswap_tree *tree); @@ -272,11 +275,13 @@ static void zswap_update_total_size(void) { struct zswap_pool *pool; u64 total = 0; + int i; rcu_read_lock(); list_for_each_entry_rcu(pool, &zswap_pools, list) - total += zpool_get_total_size(pool->zpool); + for (i = 0; i < ZSWAP_NR_ZPOOLS; i++) + total += zpool_get_total_size(pool->zpools[i]); rcu_read_unlock(); @@ -363,6 +368,16 @@ static void zswap_rb_erase(struct rb_root *root, struct zswap_entry *entry) } } +static struct zpool *zswap_find_zpool(struct zswap_entry *entry) +{ + int i = 0; + + if (ZSWAP_NR_ZPOOLS > 1) + i = hash_ptr(entry, ilog2(ZSWAP_NR_ZPOOLS)); + + return entry->pool->zpools[i]; +} + /* * Carries out the common pattern of freeing and entry's zpool allocation, * freeing the entry itself, and decrementing the number of stored pages. @@ -379,7 +394,7 @@ static void zswap_free_entry(struct zswap_entry *entry) spin_lock(&entry->pool->lru_lock); list_del(&entry->lru); spin_unlock(&entry->pool->lru_lock); - zpool_free(entry->pool->zpool, entry->handle); + zpool_free(zswap_find_zpool(entry), entry->handle); zswap_pool_put(entry->pool); } zswap_entry_cache_free(entry); @@ -588,7 +603,8 @@ static struct zswap_pool *zswap_pool_find_get(char *type, char *compressor) list_for_each_entry_rcu(pool, &zswap_pools, list) { if (strcmp(pool->tfm_name, compressor)) continue; - if (strcmp(zpool_get_type(pool->zpool), type)) + /* all zpools share the same type */ + if (strcmp(zpool_get_type(pool->zpools[0]), type)) continue; /* if we can't get it, it's about to be destroyed */ if (!zswap_pool_get(pool)) @@ -692,6 +708,7 @@ static void shrink_worker(struct work_struct *w) static struct zswap_pool *zswap_pool_create(char *type, char *compressor) { + int i; struct zswap_pool *pool; char name[38]; /* 'zswap' + 32 char (max) num + \0 */ gfp_t gfp = __GFP_NORETRY | __GFP_NOWARN | __GFP_KSWAPD_RECLAIM; @@ -712,15 +729,18 @@ static struct zswap_pool *zswap_pool_create(char *type, char *compressor) if (!pool) return NULL; - /* unique name for each pool specifically required by zsmalloc */ - snprintf(name, 38, "zswap%x", atomic_inc_return(&zswap_pools_count)); + for (i = 0; i < ZSWAP_NR_ZPOOLS; i++) { + /* unique name for each pool specifically required by zsmalloc */ + snprintf(name, 38, "zswap%x", + atomic_inc_return(&zswap_pools_count)); - pool->zpool = zpool_create_pool(type, name, gfp); - if (!pool->zpool) { - pr_err("%s zpool not available\n", type); - goto error; + pool->zpools[i] = zpool_create_pool(type, name, gfp); + if (!pool->zpools[i]) { + pr_err("%s zpool not available\n", type); + goto error; + } } - pr_debug("using %s zpool\n", zpool_get_type(pool->zpool)); + pr_debug("using %s zpool\n", zpool_get_type(pool->zpools[0])); strscpy(pool->tfm_name, compressor, sizeof(pool->tfm_name)); @@ -752,8 +772,8 @@ static struct zswap_pool *zswap_pool_create(char *type, char *compressor) error: if (pool->acomp_ctx) free_percpu(pool->acomp_ctx); - if (pool->zpool) - zpool_destroy_pool(pool->zpool); + while (i--) + zpool_destroy_pool(pool->zpools[i]); kfree(pool); return NULL; } @@ -802,11 +822,14 @@ static struct zswap_pool *__zswap_pool_create_fallback(void) static void zswap_pool_destroy(struct zswap_pool *pool) { + int i; + zswap_pool_debug("destroying", pool); cpuhp_state_remove_instance(CPUHP_MM_ZSWP_POOL_PREPARE, &pool->node); free_percpu(pool->acomp_ctx); - zpool_destroy_pool(pool->zpool); + for (i = 0; i < ZSWAP_NR_ZPOOLS; i++) + zpool_destroy_pool(pool->zpools[i]); kfree(pool); } @@ -1070,7 +1093,7 @@ static int zswap_writeback_entry(struct zswap_entry *entry, struct page *page; struct scatterlist input, output; struct crypto_acomp_ctx *acomp_ctx; - struct zpool *pool = entry->pool->zpool; + struct zpool *pool = zswap_find_zpool(entry); u8 *src, *tmp = NULL; unsigned int dlen; @@ -1211,6 +1234,7 @@ static int zswap_frontswap_store(unsigned type, pgoff_t offset, struct crypto_acomp_ctx *acomp_ctx; struct obj_cgroup *objcg = NULL; struct zswap_pool *pool; + struct zpool *zpool; int ret; unsigned int dlen = PAGE_SIZE; unsigned long handle, value; @@ -1321,10 +1345,11 @@ static int zswap_frontswap_store(unsigned type, pgoff_t offset, } /* store */ + zpool = zswap_find_zpool(entry); gfp = __GFP_NORETRY | __GFP_NOWARN | __GFP_KSWAPD_RECLAIM; - if (zpool_malloc_support_movable(entry->pool->zpool)) + if (zpool_malloc_support_movable(zpool)) gfp |= __GFP_HIGHMEM | __GFP_MOVABLE; - ret = zpool_malloc(entry->pool->zpool, dlen, gfp, &handle); + ret = zpool_malloc(zpool, dlen, gfp, &handle); if (ret == -ENOSPC) { zswap_reject_compress_poor++; goto put_dstmem; @@ -1333,9 +1358,9 @@ static int zswap_frontswap_store(unsigned type, pgoff_t offset, zswap_reject_alloc_fail++; goto put_dstmem; } - buf = zpool_map_handle(entry->pool->zpool, handle, ZPOOL_MM_WO); + buf = zpool_map_handle(zpool, handle, ZPOOL_MM_WO); memcpy(buf, dst, dlen); - zpool_unmap_handle(entry->pool->zpool, handle); + zpool_unmap_handle(zpool, handle); mutex_unlock(acomp_ctx->mutex); /* populate entry */ @@ -1406,6 +1431,7 @@ static int zswap_frontswap_load(unsigned type, pgoff_t offset, struct scatterlist input, output; struct crypto_acomp_ctx *acomp_ctx; u8 *src, *dst, *tmp; + struct zpool *zpool; unsigned int dlen; int ret; @@ -1427,7 +1453,8 @@ static int zswap_frontswap_load(unsigned type, pgoff_t offset, goto stats; } - if (!zpool_can_sleep_mapped(entry->pool->zpool)) { + zpool = zswap_find_zpool(entry); + if (!zpool_can_sleep_mapped(zpool)) { tmp = kmalloc(entry->length, GFP_KERNEL); if (!tmp) { ret = -ENOMEM; @@ -1437,12 +1464,12 @@ static int zswap_frontswap_load(unsigned type, pgoff_t offset, /* decompress */ dlen = PAGE_SIZE; - src = zpool_map_handle(entry->pool->zpool, entry->handle, ZPOOL_MM_RO); + src = zpool_map_handle(zpool, entry->handle, ZPOOL_MM_RO); - if (!zpool_can_sleep_mapped(entry->pool->zpool)) { + if (!zpool_can_sleep_mapped(zpool)) { memcpy(tmp, src, entry->length); src = tmp; - zpool_unmap_handle(entry->pool->zpool, entry->handle); + zpool_unmap_handle(zpool, entry->handle); } acomp_ctx = raw_cpu_ptr(entry->pool->acomp_ctx); @@ -1454,8 +1481,8 @@ static int zswap_frontswap_load(unsigned type, pgoff_t offset, ret = crypto_wait_req(crypto_acomp_decompress(acomp_ctx->req), &acomp_ctx->wait); mutex_unlock(acomp_ctx->mutex); - if (zpool_can_sleep_mapped(entry->pool->zpool)) - zpool_unmap_handle(entry->pool->zpool, entry->handle); + if (zpool_can_sleep_mapped(zpool)) + zpool_unmap_handle(zpool, entry->handle); else kfree(tmp); @@ -1616,7 +1643,7 @@ static int zswap_setup(void) pool = __zswap_pool_create_fallback(); if (pool) { pr_info("loaded using pool %s/%s\n", pool->tfm_name, - zpool_get_type(pool->zpool)); + zpool_get_type(pool->zpools[0])); list_add(&pool->list, &zswap_pools); zswap_has_pool = true; } else {