From patchwork Fri Feb 21 22:25:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Senozhatsky X-Patchwork-Id: 13986388 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 79B88C021B5 for ; Fri, 21 Feb 2025 22:31:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0CFAC28000B; Fri, 21 Feb 2025 17:31:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 07F0F280004; Fri, 21 Feb 2025 17:31:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E144828000B; Fri, 21 Feb 2025 17:31:12 -0500 (EST) 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 C290D280004 for ; Fri, 21 Feb 2025 17:31:12 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 822A71A08CD for ; Fri, 21 Feb 2025 22:31:12 +0000 (UTC) X-FDA: 83145398784.18.CBD6719 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by imf01.hostedemail.com (Postfix) with ESMTP id 784DD40015 for ; Fri, 21 Feb 2025 22:31:10 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b="aI/4GTy+"; spf=pass (imf01.hostedemail.com: domain of senozhatsky@chromium.org designates 209.85.214.182 as permitted sender) smtp.mailfrom=senozhatsky@chromium.org; dmarc=pass (policy=none) header.from=chromium.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1740177070; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=y4hieFtM2l2Z0Gze73AM0fWmJUttGTKTNzwCP28e8QQ=; b=0lBbfaDD4KQFAjYeCnoIaGw+4QVl5cSe3uDY2+rhench4Tpumj+EJXh5buOlIjWatuml9S P/N8AnWOYVNMoSj4AJ9ucRh3/MvVVP6jB5WxYKwDmXhoksFZRookwA9gryqx4ctwKE3Jpw Yx+5AWEohLAR7of6ewQF90jD2JY/97Q= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b="aI/4GTy+"; spf=pass (imf01.hostedemail.com: domain of senozhatsky@chromium.org designates 209.85.214.182 as permitted sender) smtp.mailfrom=senozhatsky@chromium.org; dmarc=pass (policy=none) header.from=chromium.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1740177070; a=rsa-sha256; cv=none; b=KUPgooyR7Z0vvyvDzCAhkW/rvScd6HlVSJFjeSyBPkHQ/CapCh6E6CWCro1qauk1nN8bOA GeQvGMF7zhVvit0nl5UBieRgb16sbcMRBraf9pMAJoRdZE0UY3ea/vjKMWPLret3J4xr1G 3jC/jTS276eZq1odLvwk/sT7dXhWd9A= Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-220f048c038so49791145ad.2 for ; Fri, 21 Feb 2025 14:31:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1740177069; x=1740781869; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=y4hieFtM2l2Z0Gze73AM0fWmJUttGTKTNzwCP28e8QQ=; b=aI/4GTy+euRefg580f3J7rHx2HMGKfFnq1oN+bIwkqivFDivWE+iWbMffi4DgVAw3a XgxcLnKo74OfJhybYCKsZ+DngnZXAQnM+v8ej7Z6vQuDHHR8+S5RmlwoKzoAleIC0aKl t2oNn2QGhEjaBLVx1zKbwPF05r3doeKxtbtOg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740177069; x=1740781869; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=y4hieFtM2l2Z0Gze73AM0fWmJUttGTKTNzwCP28e8QQ=; b=Qtpv7LfTjRFXYRXv3iLl0Qe4o7xhfWAXW5Uav6J0gHBuNnonVMiE9iBn+SFcG8k7SD UJCDOzY/LoDa2hwHq/5yjEhjALtSFpYUcd6sQ+UUtSKnmlL/GXSvIr2EL49eJyHlypif 1xz9NySQu56zw3eIAU6iBIYI9T2/ixcHdivYd0fGJoJ2ISvEDhYfI4vdcaBH1hBwGxTu t3nczkdmXmDVQVcMovSHCwnYwjfpv2x8vbDblaTZkHyWOSq1qYD5fvPTw6FxgEWtxuV6 ZwImfKuoYyqPfd88EAz5vh8dORiaQYF93qRlP0GzpeQhrKFMhtpjA8PsHHPM234SUlAR heVg== X-Forwarded-Encrypted: i=1; AJvYcCUg9bsD5JRRwg34d9CbvS1qKucHb/Xked7RFDrjYnUxicPfNxxIJQrbk2nCIAeAnL4nbz1O0NpVEw==@kvack.org X-Gm-Message-State: AOJu0Yy2Dhd7H3HGlzDIN8SwSrMK9rVtxQKjTZyYQQIlXDr4J1HtJkvq atsSmSz0e6J0Eg39QqBb4ntezF1Q9/yvHBjZ98QkgfrSlOwem1KQAEe8JuAlyg== X-Gm-Gg: ASbGnctoFtoWRBxFap+ghHNoYv1c9QRajQkK1pSo10P/7mSLN5VZM2omUGU0CleGVk8 +vwQSfcWZDKR2XuxFZNb9IAjgZ69KL9hIH6hEYXS4DxOZwNa/IHF5M4M0PFZH8n3zIChResyLkK 8gDxCNdcRrFYSEfWAkAQZohQ5qwQnnz39RsEB4VtxjX5ggn2NvMJ/6OzMhlYYGj6KR90aj3j3ow YJcL0lH5DlsMCXzoAbJ/bERVc33FXZQaOdEmNwj60DAdxvwbBc+k/lMwsvHJYyBFkKMOWU/W2v4 WeA5LeOFzDBwcgzBXYginvgvijQ= X-Google-Smtp-Source: AGHT+IFjDhSFSvfLZz11cldDF51zOwCTwD6xM3YT/eF2+EZ/8qQPdJ+e/mCN9snGHWZACIXCyeoKVQ== X-Received: by 2002:a17:902:ea11:b0:216:55a1:35a with SMTP id d9443c01a7336-2219ff61e5cmr65829295ad.30.1740177069320; Fri, 21 Feb 2025 14:31:09 -0800 (PST) Received: from localhost ([2401:fa00:8f:203:f987:e1e:3dbb:2191]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-220d545df28sm141974715ad.153.2025.02.21.14.31.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Feb 2025 14:31:09 -0800 (PST) From: Sergey Senozhatsky To: Andrew Morton Cc: Yosry Ahmed , Hillf Danton , Kairui Song , Sebastian Andrzej Siewior , Minchan Kim , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: [PATCH v8 11/17] zsmalloc: make zspage lock preemptible Date: Sat, 22 Feb 2025 07:25:42 +0900 Message-ID: <20250221222958.2225035-12-senozhatsky@chromium.org> X-Mailer: git-send-email 2.48.1.601.g30ceb7b040-goog In-Reply-To: <20250221222958.2225035-1-senozhatsky@chromium.org> References: <20250221222958.2225035-1-senozhatsky@chromium.org> MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: ohday39dcc3p95tw15ooiccdtj6uf6jz X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 784DD40015 X-HE-Tag: 1740177070-341049 X-HE-Meta: U2FsdGVkX183irLNlDbPBcRXUQNQYdRQqoLsWVqfugpulCSdosxkaQ0lMcRYAmMs1N+NqzSqqNpY3X+FAbXoDRd9IffsQ0ReMgTAbGmBuNG2o+flMSWf+kzgsRjTt+Z4tU1+MDunEUDLtkfKNPC9rI1fh6wlJlsS616Lekst9HfAixEZDHOzMcS/AAIFjDiYJu8rfsQOlxafM27w88EQBI1ovWU/nJ011SVbOxyev3J+RHIJMlkax+GH40EKMe/hUByW+nlyj4l+C8FXL6wUNwGi4sBVkmhh4AZo9kJ7ZkSwjKNGjtx5DypeB50KP97FHGdSXMB09TbR9hGVwvQeU+RGlEVbAl7/8meRGqVG/memDTEySOk0FpVhE4d/lzWAOvBQgUjGDZGV6J1ue4XsXIt0WR1J5OiC/J/20uoSMqjs2q+i8idZ8XzzD5AbYxPtpBU986TszDyLvzvmKONeM52srFUNWQCh+Roz8PN74/R9RYtlqiw1rj6uNAkYcMmDzMUynXf3BQAXdhnp0e74pW9e0HFoGYbKZaZ2TQdFLuOcYUim8dKTEnhYI2If9gADbb41NKiY1dufCXhYVff2ITqSqW8EyEejQh93LzN2gWSOFUtfYLqDtNV1+qGMfdOFqV1xCRRCFcOEmHWALdjm/p0RTyuyo83DwP4nKvVYhTlCZUp3eAL29UmsfaIUcc0fSbuxUJqxJouphaLAWG/LsypHBw9giWoI5b3pucbnW1uJhJSKcqy1KCjVEphq2DvoRCJ8OH1fmVGW6cLnJzEr8tVPadbH/5cKJ6xEp1lV5UlYS0k+MbniRYirJCRIvefVfCRXxIUF9iicJXvfN8l1BNObcu1+dJiP+v6+fGAimq76ewgYeB9FGeS65Z0e1WftO/22M9VBA9spRaZdww8rAIgwwTGoEOvphv0BO7YPRfCgF2ktMZ72TRQdzWgwLJcKEYw0f1y8Cz5ZMVZpg8/ ZAQBbpHc 6Gplu/46BJ/ewR8DJ4qZFVBwPg5tJ0c3CxSEESU+3jyOwx7PP54+Icar2DH0pQ2viVnjFeqNttqCebDHln8onMtNNawfxdVxyFOB+PyQQUMnGrIrFOb353l5QxiU54P+kVR2R1yjtnjDoMipESQisI8AF1F3v4czb6D/DWeoIo8X8eFVxo5oCsZ2Zm0+7pdPtuIJ/0HjCrdvy6Tnfc58FwwFJzeZ8AlcwaHJmr35PXLocr93bwUxLUgi/oqzccYEPZiSmBR3h+igmwvP8XYi5JjUv4bYuaCnKqrGt3A/YCYZobpRAZEi8IHPtElqSVP5KIdesCnDpAm+cno8= 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: In order to implement preemptible object mapping we need a zspage lock that satisfies several preconditions: - it should be reader-write type of a lock - it should be possible to hold it from any context, but also being preemptible if the context allows it - we never sleep while acquiring but can sleep while holding in read mode An rwsemaphore doesn't suffice, due to atomicity requirements, rwlock doesn't satisfy due to reader-preemptability requirement. It's also worth to mention, that per-zspage rwsem is a little too memory heavy (we can easily have double digits megabytes used only on rwsemaphores). Switch over from rwlock_t to a atomic_t-based implementation of a reader-writer semaphore that satisfies all of the preconditions. The spin-lock based zspage_lock is suggested by Hillf Danton. Suggested-by: Hillf Danton Signed-off-by: Sergey Senozhatsky --- mm/zsmalloc.c | 184 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 131 insertions(+), 53 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 1424ee73cbb5..03710d71d022 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -226,6 +226,9 @@ struct zs_pool { /* protect zspage migration/compaction */ rwlock_t lock; atomic_t compaction_in_progress; +#ifdef CONFIG_DEBUG_LOCK_ALLOC + struct lock_class_key lock_class; +#endif }; static inline void zpdesc_set_first(struct zpdesc *zpdesc) @@ -257,6 +260,18 @@ static inline void free_zpdesc(struct zpdesc *zpdesc) __free_page(page); } +#define ZS_PAGE_UNLOCKED 0 +#define ZS_PAGE_WRLOCKED -1 + +struct zspage_lock { + spinlock_t lock; + int cnt; + +#ifdef CONFIG_DEBUG_LOCK_ALLOC + struct lockdep_map dep_map; +#endif +}; + struct zspage { struct { unsigned int huge:HUGE_BITS; @@ -269,7 +284,7 @@ struct zspage { struct zpdesc *first_zpdesc; struct list_head list; /* fullness list */ struct zs_pool *pool; - rwlock_t lock; + struct zspage_lock zsl; }; struct mapping_area { @@ -279,6 +294,93 @@ struct mapping_area { enum zs_mapmode vm_mm; /* mapping mode */ }; +#ifdef CONFIG_DEBUG_LOCK_ALLOC +#define zsl_dep_map(zsl) (&(zsl)->dep_map) +#define zspool_lock_class(pool) (&(pool)->lock_class) +#else +#define zsl_dep_map(zsl) NULL +#define zspool_lock_class(pool) NULL +#endif + +static void zspage_lock_init(struct zspage *zspage) +{ + struct zspage_lock *zsl = &zspage->zsl; + + lockdep_init_map(zsl_dep_map(zsl), "zspage->lock", + zspool_lock_class(zspage->pool), 0); + spin_lock_init(&zsl->lock); + zsl->cnt = ZS_PAGE_UNLOCKED; +} + +/* + * The zspage lock can be held from atomic contexts, but it needs to remain + * preemptible when held for reading because it remains held outside of those + * atomic contexts, otherwise we unnecessarily lose preemptibility. + * + * To achieve this, the following rules are enforced on readers and writers: + * + * - Writers are blocked by both writers and readers, while readers are only + * blocked by writers (i.e. normal rwlock semantics). + * + * - Writers are always atomic (to allow readers to spin waiting for them). + * + * - Writers always use trylock (as the lock may be held be sleeping readers). + * + * - Readers may spin on the lock (as they can only wait for atomic writers). + * + * - Readers may sleep while holding the lock (as writes only use trylock). + */ +static void zspage_read_lock(struct zspage *zspage) +{ + struct zspage_lock *zsl = &zspage->zsl; + + rwsem_acquire_read(zsl_dep_map(zsl), 0, 0, _RET_IP_); + + spin_lock(&zsl->lock); + zsl->cnt++; + spin_unlock(&zsl->lock); + + lock_acquired(zsl_dep_map(zsl), _RET_IP_); +} + +static void zspage_read_unlock(struct zspage *zspage) +{ + struct zspage_lock *zsl = &zspage->zsl; + + rwsem_release(zsl_dep_map(zsl), _RET_IP_); + + spin_lock(&zsl->lock); + zsl->cnt--; + spin_unlock(&zsl->lock); +} + +static __must_check bool zspage_write_trylock(struct zspage *zspage) +{ + struct zspage_lock *zsl = &zspage->zsl; + + spin_lock(&zsl->lock); + if (zsl->cnt == ZS_PAGE_UNLOCKED) { + zsl->cnt = ZS_PAGE_WRLOCKED; + rwsem_acquire(zsl_dep_map(zsl), 0, 1, _RET_IP_); + lock_acquired(zsl_dep_map(zsl), _RET_IP_); + return true; + } + + lock_contended(zsl_dep_map(zsl), _RET_IP_); + spin_unlock(&zsl->lock); + return false; +} + +static void zspage_write_unlock(struct zspage *zspage) +{ + struct zspage_lock *zsl = &zspage->zsl; + + rwsem_release(zsl_dep_map(zsl), _RET_IP_); + + zsl->cnt = ZS_PAGE_UNLOCKED; + spin_unlock(&zsl->lock); +} + /* huge object: pages_per_zspage == 1 && maxobj_per_zspage == 1 */ static void SetZsHugePage(struct zspage *zspage) { @@ -290,12 +392,6 @@ static bool ZsHugePage(struct zspage *zspage) return zspage->huge; } -static void migrate_lock_init(struct zspage *zspage); -static void migrate_read_lock(struct zspage *zspage); -static void migrate_read_unlock(struct zspage *zspage); -static void migrate_write_lock(struct zspage *zspage); -static void migrate_write_unlock(struct zspage *zspage); - #ifdef CONFIG_COMPACTION static void kick_deferred_free(struct zs_pool *pool); static void init_deferred_free(struct zs_pool *pool); @@ -992,7 +1088,9 @@ static struct zspage *alloc_zspage(struct zs_pool *pool, return NULL; zspage->magic = ZSPAGE_MAGIC; - migrate_lock_init(zspage); + zspage->pool = pool; + zspage->class = class->index; + zspage_lock_init(zspage); for (i = 0; i < class->pages_per_zspage; i++) { struct zpdesc *zpdesc; @@ -1015,8 +1113,6 @@ static struct zspage *alloc_zspage(struct zs_pool *pool, create_page_chain(class, zspage, zpdescs); init_zspage(class, zspage); - zspage->pool = pool; - zspage->class = class->index; return zspage; } @@ -1217,7 +1313,7 @@ void *zs_map_object(struct zs_pool *pool, unsigned long handle, * zs_unmap_object API so delegate the locking from class to zspage * which is smaller granularity. */ - migrate_read_lock(zspage); + zspage_read_lock(zspage); read_unlock(&pool->lock); class = zspage_class(pool, zspage); @@ -1277,7 +1373,7 @@ void zs_unmap_object(struct zs_pool *pool, unsigned long handle) } local_unlock(&zs_map_area.lock); - migrate_read_unlock(zspage); + zspage_read_unlock(zspage); } EXPORT_SYMBOL_GPL(zs_unmap_object); @@ -1671,18 +1767,18 @@ static void lock_zspage(struct zspage *zspage) /* * Pages we haven't locked yet can be migrated off the list while we're * trying to lock them, so we need to be careful and only attempt to - * lock each page under migrate_read_lock(). Otherwise, the page we lock + * lock each page under zspage_read_lock(). Otherwise, the page we lock * may no longer belong to the zspage. This means that we may wait for * the wrong page to unlock, so we must take a reference to the page - * prior to waiting for it to unlock outside migrate_read_lock(). + * prior to waiting for it to unlock outside zspage_read_lock(). */ while (1) { - migrate_read_lock(zspage); + zspage_read_lock(zspage); zpdesc = get_first_zpdesc(zspage); if (zpdesc_trylock(zpdesc)) break; zpdesc_get(zpdesc); - migrate_read_unlock(zspage); + zspage_read_unlock(zspage); zpdesc_wait_locked(zpdesc); zpdesc_put(zpdesc); } @@ -1693,41 +1789,16 @@ static void lock_zspage(struct zspage *zspage) curr_zpdesc = zpdesc; } else { zpdesc_get(zpdesc); - migrate_read_unlock(zspage); + zspage_read_unlock(zspage); zpdesc_wait_locked(zpdesc); zpdesc_put(zpdesc); - migrate_read_lock(zspage); + zspage_read_lock(zspage); } } - migrate_read_unlock(zspage); + zspage_read_unlock(zspage); } #endif /* CONFIG_COMPACTION */ -static void migrate_lock_init(struct zspage *zspage) -{ - rwlock_init(&zspage->lock); -} - -static void migrate_read_lock(struct zspage *zspage) __acquires(&zspage->lock) -{ - read_lock(&zspage->lock); -} - -static void migrate_read_unlock(struct zspage *zspage) __releases(&zspage->lock) -{ - read_unlock(&zspage->lock); -} - -static void migrate_write_lock(struct zspage *zspage) -{ - write_lock(&zspage->lock); -} - -static void migrate_write_unlock(struct zspage *zspage) -{ - write_unlock(&zspage->lock); -} - #ifdef CONFIG_COMPACTION static const struct movable_operations zsmalloc_mops; @@ -1785,9 +1856,6 @@ static int zs_page_migrate(struct page *newpage, struct page *page, VM_BUG_ON_PAGE(!zpdesc_is_isolated(zpdesc), zpdesc_page(zpdesc)); - /* We're committed, tell the world that this is a Zsmalloc page. */ - __zpdesc_set_zsmalloc(newzpdesc); - /* The page is locked, so this pointer must remain valid */ zspage = get_zspage(zpdesc); pool = zspage->pool; @@ -1803,8 +1871,15 @@ static int zs_page_migrate(struct page *newpage, struct page *page, * the class lock protects zpage alloc/free in the zspage. */ spin_lock(&class->lock); - /* the migrate_write_lock protects zpage access via zs_map_object */ - migrate_write_lock(zspage); + /* the zspage write_lock protects zpage access via zs_map_object */ + if (!zspage_write_trylock(zspage)) { + spin_unlock(&class->lock); + write_unlock(&pool->lock); + return -EINVAL; + } + + /* We're committed, tell the world that this is a Zsmalloc page. */ + __zpdesc_set_zsmalloc(newzpdesc); offset = get_first_obj_offset(zpdesc); s_addr = kmap_local_zpdesc(zpdesc); @@ -1835,7 +1910,7 @@ static int zs_page_migrate(struct page *newpage, struct page *page, */ write_unlock(&pool->lock); spin_unlock(&class->lock); - migrate_write_unlock(zspage); + zspage_write_unlock(zspage); zpdesc_get(newzpdesc); if (zpdesc_zone(newzpdesc) != zpdesc_zone(zpdesc)) { @@ -1971,9 +2046,11 @@ static unsigned long __zs_compact(struct zs_pool *pool, if (!src_zspage) break; - migrate_write_lock(src_zspage); + if (!zspage_write_trylock(src_zspage)) + break; + migrate_zspage(pool, src_zspage, dst_zspage); - migrate_write_unlock(src_zspage); + zspage_write_unlock(src_zspage); fg = putback_zspage(class, src_zspage); if (fg == ZS_INUSE_RATIO_0) { @@ -2141,6 +2218,7 @@ struct zs_pool *zs_create_pool(const char *name) init_deferred_free(pool); rwlock_init(&pool->lock); atomic_set(&pool->compaction_in_progress, 0); + lockdep_register_key(zspool_lock_class(pool)); pool->name = kstrdup(name, GFP_KERNEL); if (!pool->name) @@ -2233,7 +2311,6 @@ struct zs_pool *zs_create_pool(const char *name) * trigger compaction manually. Thus, ignore return code. */ zs_register_shrinker(pool); - return pool; err: @@ -2270,6 +2347,7 @@ void zs_destroy_pool(struct zs_pool *pool) kfree(class); } + lockdep_unregister_key(zspool_lock_class(pool)); destroy_cache(pool); kfree(pool->name); kfree(pool);