From nobody Tue Dec 2 01:27:24 2025 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 862D7299A84 for ; Sat, 22 Nov 2025 07:40:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763797253; cv=none; b=MTd/n6WE3/VUqU+OjhR6l9WZZGcz5SEyeGB4xHRJPTvuzQDRfxJ7h+E1zM0isig6C3e5nDFkk4eJLiAs4i4nq3KdGgJkBN40IPh4Dt0Zn3qBLrMEpnIbJ811R9IYi7Vgl7K7LOC/77p/0C5VYAn6JnG9eNtV5vavE/8mjiYmn8M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763797253; c=relaxed/simple; bh=0IGd9pECmyyazBtuzTUy3wd9EY0I+2QhQWM58mapvyQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=h9G1onNWpiP5oQsAaKFS8/gyeh12StwXOtc9RJPCWE5IkOXNQSkXWYA1lf85jEmMtCH9bTqmwdaXn+cbv7S1YApfiGa6ZN976cC96n8mI6Vj0NgbsXRKdjM0qWlVyHu2AO96lmlGNHHxsLgLbWo+7RXktbedQ12VzG4ZY25e3m4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=LXJlCDLE; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="LXJlCDLE" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-297ef378069so25397145ad.3 for ; Fri, 21 Nov 2025 23:40:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1763797251; x=1764402051; darn=vger.kernel.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=+CcYw/MVsIvV8b2h3Sq9n03D/rQEvwWc9LbzmpgrKxs=; b=LXJlCDLEfAo82LQsnuXOfSj93vf4kZqUMHsYtQweyOPxluwfsO4SWimJbdyZFeE55y L9qFNUO+u4fE/D2ad5eWlYF5T1QQ2w0Iw0tVsbMMnIKjL4t4ZMjS4NxOyCMFcs5lhXOU pPzfNaC3nOhtTVWT+ysUglEXHoaBeQFd7aL88= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763797251; x=1764402051; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=+CcYw/MVsIvV8b2h3Sq9n03D/rQEvwWc9LbzmpgrKxs=; b=nvJFgLSiGtKJe95kbIWH8Gj88oI5BrSdYddY9FcCuk8kSMfUWA3CiF0sAjxLIF2MCk /bUa4hXMI+QZosSI2UVJX/c3hnIEbQFgzjCyUg6Ax3WXy9Ffl/LUHTanQIpvVI+TChW2 Ii7Uk0mjeTFVDHkfM5qgWyjsrjibjwtZ58aXzxTDrGzZ/SCn4pdsKKS7G5LcXoPhpJdj 2WFuMOJk+XZxtykhJvoEPTAEjugDi1r0LqmyIOPBeyiaxLo8CjBzv+QJpSap79/cZEoW svrAyg9UN/V2yH5miUdn1IExX1kDqT27xsbU4JarIwbV47knSKNTUfCAVm7kfnKxVSiP pN5w== X-Forwarded-Encrypted: i=1; AJvYcCX14oPtieR32u1Vxb9gsS2Wv4H0dA9D7+KACtzlg+PbI3icqcFJOPFTtPUZo6IVYGMu5HOuMGRkhC8hUN4=@vger.kernel.org X-Gm-Message-State: AOJu0YxmIV7gSXsoxofFU17t6N7lpLYblIWgv96etj7GWujSwLLcVRjT jaggGgByi07GO0HcNXB2aA2csZVn0e7IUzAWBlGUZf9hRsU/QI0+K9IgCDAjEZTYug== X-Gm-Gg: ASbGncuRvg22tAgXT9J//MU9ZSgqP0AgWfPuVDyazusOCO2ldrM5gi06Hoq+5ZiQlWE LSv3cQavc1CxkF+9RJ1EYzKx+kltyksAmVRO/GSbRECaH4aZb+u+ob/DEHFkVoMvP+g37sAE8l9 Dum5woDButwGp74cbRXcuQDVppsQmZrc/y/iL2AlNxsb77uuLnsl41Q9mRFH/Sg7+6yHPUxZ/nH GcTYr+mdafKWnlZMVSf5FH3TCqwsdxL8fULTfwqwuRaMKtVFWEAmkXQEqOdve8L4oa9YJg/hWBz ufR6dFqczJrqChF8zlRv+ph2bm8CcwTi5Nr7kbW9kp+2QLGC7EuVObLV5DUfHK+rJWxLsRvqta+ TlkAtcOBrBarJoDyD3N2s6q6tTOOPAL9it5GgKXSvIgLxdEnKpGvdBXpN82TlIcr8Vzbg1fS7CN gl9uNi6ILXxhJ9oMtIIz1uJj/XtW+/oHOBOMk0obqC2QqrEJynhNsc4VxpQPJWDG59l/TMJ6EaC g== X-Google-Smtp-Source: AGHT+IFaSB7EbqaBfaqnc96XqHJ3nI/Cc67lkuc7fRADR0xDZSv+4CDROktulCgD73hI6bhlKxOYWg== X-Received: by 2002:a17:902:e809:b0:295:738f:73fe with SMTP id d9443c01a7336-29b6bf385e6mr72914675ad.30.1763797250758; Fri, 21 Nov 2025 23:40:50 -0800 (PST) Received: from tigerii.tok.corp.google.com ([2a00:79e0:2031:6:948e:149d:963b:f660]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-29b5b138628sm77771555ad.31.2025.11.21.23.40.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Nov 2025 23:40:50 -0800 (PST) From: Sergey Senozhatsky To: Andrew Morton , Minchan Kim , Yuwen Chen , Richard Chang Cc: Brian Geffon , Fengyu Lian , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-block@vger.kernel.org, Sergey Senozhatsky , Minchan Kim Subject: [PATCHv6 1/6] zram: introduce writeback bio batching Date: Sat, 22 Nov 2025 16:40:24 +0900 Message-ID: <20251122074029.3948921-2-senozhatsky@chromium.org> X-Mailer: git-send-email 2.52.0.460.gd25c4c69ec-goog In-Reply-To: <20251122074029.3948921-1-senozhatsky@chromium.org> References: <20251122074029.3948921-1-senozhatsky@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" As was stated in a comment [1] a single page writeback IO is not efficient, but it works. It's time to address this throughput limitation as writeback becomes used more often. Introduce batched (multiple) bio writeback support to take advantage of parallel requests processing and better requests scheduling. Approach used in this patch doesn't use a dedicated kthread like in [2], or blk-plug like in [3]. Dedicated kthread adds complexity, which can be avoided. Apart from that not all zram setups use writeback, so having numerous per-device kthreads (on systems that create multiple zram devices) hanging around is not the most optimal thing to do. blk-plug, on the other hand, works best when request are sequential, which doesn't particularly fit zram writebck IO patterns: zram writeback IO patterns are expected to be random, due to how bdev block reservation/release are handled. blk-plug approach also works in cycles: idle IO, when zram sets up requests in a batch, is followed by bursts of IO, when zram submits the entire batch. Instead we use a batch of requests and submit new bio as soon as one of the in-flight requests completes. For the time being the writeback batch size (maximum number of in-flight bio requests) is set to 32 for all devices. A follow up patch adds a writeback_batch_size device attribute, so the batch size becomes run-time configurable. [1] https://lore.kernel.org/all/20181203024045.153534-6-minchan@kernel.org/ [2] https://lore.kernel.org/all/20250731064949.1690732-1-richardycc@google.= com/ [3] https://lore.kernel.org/all/tencent_78FC2C4FE16BA1EBAF0897DB60FCD675ED0= 5@qq.com/ Signed-off-by: Sergey Senozhatsky Co-developed-by: Yuwen Chen Co-developed-by: Richard Chang Suggested-by: Minchan Kim --- drivers/block/zram/zram_drv.c | 369 +++++++++++++++++++++++++++------- 1 file changed, 301 insertions(+), 68 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index a43074657531..06ea56f0a00f 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -500,6 +500,26 @@ static ssize_t idle_store(struct device *dev, } =20 #ifdef CONFIG_ZRAM_WRITEBACK +struct zram_wb_ctl { + /* idle list is accessed only by the writeback task, no concurency */ + struct list_head idle_reqs; + /* done list is accessed concurrently, protect by done_lock */ + struct list_head done_reqs; + wait_queue_head_t done_wait; + spinlock_t done_lock; + atomic_t num_inflight; +}; + +struct zram_wb_req { + unsigned long blk_idx; + struct page *page; + struct zram_pp_slot *pps; + struct bio_vec bio_vec; + struct bio bio; + + struct list_head entry; +}; + static ssize_t writeback_limit_enable_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) { @@ -734,19 +754,221 @@ static void read_from_bdev_async(struct zram *zram, = struct page *page, submit_bio(bio); } =20 -static int zram_writeback_slots(struct zram *zram, struct zram_pp_ctl *ctl) +static void release_wb_req(struct zram_wb_req *req) { - unsigned long blk_idx =3D 0; - struct page *page =3D NULL; - struct zram_pp_slot *pps; - struct bio_vec bio_vec; - struct bio bio; + __free_page(req->page); + kfree(req); +} + +static void release_wb_ctl(struct zram_wb_ctl *wb_ctl) +{ + if (!wb_ctl) + return; + + /* We should never have inflight requests at this point */ + WARN_ON(atomic_read(&wb_ctl->num_inflight)); + WARN_ON(!list_empty(&wb_ctl->done_reqs)); + + while (!list_empty(&wb_ctl->idle_reqs)) { + struct zram_wb_req *req; + + req =3D list_first_entry(&wb_ctl->idle_reqs, + struct zram_wb_req, entry); + list_del(&req->entry); + release_wb_req(req); + } + + kfree(wb_ctl); +} + +/* XXX: should be a per-device sysfs attr */ +#define ZRAM_WB_REQ_CNT 32 + +static struct zram_wb_ctl *init_wb_ctl(void) +{ + struct zram_wb_ctl *wb_ctl; + int i; + + wb_ctl =3D kmalloc(sizeof(*wb_ctl), GFP_KERNEL); + if (!wb_ctl) + return NULL; + + INIT_LIST_HEAD(&wb_ctl->idle_reqs); + INIT_LIST_HEAD(&wb_ctl->done_reqs); + atomic_set(&wb_ctl->num_inflight, 0); + init_waitqueue_head(&wb_ctl->done_wait); + spin_lock_init(&wb_ctl->done_lock); + + for (i =3D 0; i < ZRAM_WB_REQ_CNT; i++) { + struct zram_wb_req *req; + + /* + * This is fatal condition only if we couldn't allocate + * any requests at all. Otherwise we just work with the + * requests that we have successfully allocated, so that + * writeback can still proceed, even if there is only one + * request on the idle list. + */ + req =3D kzalloc(sizeof(*req), GFP_KERNEL | __GFP_NOWARN); + if (!req) + break; + + req->page =3D alloc_page(GFP_KERNEL | __GFP_NOWARN); + if (!req->page) { + kfree(req); + break; + } + + list_add(&req->entry, &wb_ctl->idle_reqs); + } + + /* We couldn't allocate any requests, so writeabck is not possible */ + if (list_empty(&wb_ctl->idle_reqs)) + goto release_wb_ctl; + + return wb_ctl; + +release_wb_ctl: + release_wb_ctl(wb_ctl); + return NULL; +} + +static void zram_account_writeback_rollback(struct zram *zram) +{ + spin_lock(&zram->wb_limit_lock); + if (zram->wb_limit_enable) + zram->bd_wb_limit +=3D 1UL << (PAGE_SHIFT - 12); + spin_unlock(&zram->wb_limit_lock); +} + +static void zram_account_writeback_submit(struct zram *zram) +{ + spin_lock(&zram->wb_limit_lock); + if (zram->wb_limit_enable && zram->bd_wb_limit > 0) + zram->bd_wb_limit -=3D 1UL << (PAGE_SHIFT - 12); + spin_unlock(&zram->wb_limit_lock); +} + +static int zram_writeback_complete(struct zram *zram, struct zram_wb_req *= req) +{ + u32 index =3D req->pps->index; + int err; + + err =3D blk_status_to_errno(req->bio.bi_status); + if (err) { + /* + * Failed wb requests should not be accounted in wb_limit + * (if enabled). + */ + zram_account_writeback_rollback(zram); + free_block_bdev(zram, req->blk_idx); + return err; + } + + atomic64_inc(&zram->stats.bd_writes); + zram_slot_lock(zram, index); + /* + * We release slot lock during writeback so slot can change under us: + * slot_free() or slot_free() and zram_write_page(). In both cases + * slot loses ZRAM_PP_SLOT flag. No concurrent post-processing can + * set ZRAM_PP_SLOT on such slots until current post-processing + * finishes. + */ + if (!zram_test_flag(zram, index, ZRAM_PP_SLOT)) { + free_block_bdev(zram, req->blk_idx); + goto out; + } + + zram_free_page(zram, index); + zram_set_flag(zram, index, ZRAM_WB); + zram_set_handle(zram, index, req->blk_idx); + atomic64_inc(&zram->stats.pages_stored); + +out: + zram_slot_unlock(zram, index); + return 0; +} + +static void zram_writeback_endio(struct bio *bio) +{ + struct zram_wb_req *req =3D container_of(bio, struct zram_wb_req, bio); + struct zram_wb_ctl *wb_ctl =3D bio->bi_private; + unsigned long flags; + + spin_lock_irqsave(&wb_ctl->done_lock, flags); + list_add(&req->entry, &wb_ctl->done_reqs); + spin_unlock_irqrestore(&wb_ctl->done_lock, flags); + + wake_up(&wb_ctl->done_wait); +} + +static void zram_submit_wb_request(struct zram *zram, + struct zram_wb_ctl *wb_ctl, + struct zram_wb_req *req) +{ + /* + * wb_limit (if enabled) should be adjusted before submission, + * so that we don't over-submit. + */ + zram_account_writeback_submit(zram); + atomic_inc(&wb_ctl->num_inflight); + req->bio.bi_private =3D wb_ctl; + submit_bio(&req->bio); +} + +static int zram_complete_done_reqs(struct zram *zram, + struct zram_wb_ctl *wb_ctl) +{ + struct zram_wb_req *req; + unsigned long flags; int ret =3D 0, err; - u32 index; =20 - page =3D alloc_page(GFP_KERNEL); - if (!page) - return -ENOMEM; + while (atomic_read(&wb_ctl->num_inflight) > 0) { + spin_lock_irqsave(&wb_ctl->done_lock, flags); + req =3D list_first_entry_or_null(&wb_ctl->done_reqs, + struct zram_wb_req, entry); + if (req) + list_del(&req->entry); + spin_unlock_irqrestore(&wb_ctl->done_lock, flags); + + /* ->num_inflight > 0 doesn't mean we have done requests */ + if (!req) + break; + + err =3D zram_writeback_complete(zram, req); + if (err) + ret =3D err; + + atomic_dec(&wb_ctl->num_inflight); + release_pp_slot(zram, req->pps); + req->pps =3D NULL; + + list_add(&req->entry, &wb_ctl->idle_reqs); + } + + return ret; +} + +static struct zram_wb_req *zram_select_idle_req(struct zram_wb_ctl *wb_ctl) +{ + struct zram_wb_req *req; + + req =3D list_first_entry_or_null(&wb_ctl->idle_reqs, + struct zram_wb_req, entry); + if (req) + list_del(&req->entry); + return req; +} + +static int zram_writeback_slots(struct zram *zram, + struct zram_pp_ctl *ctl, + struct zram_wb_ctl *wb_ctl) +{ + struct zram_wb_req *req =3D NULL; + unsigned long blk_idx =3D 0; + struct zram_pp_slot *pps; + int ret =3D 0, err =3D 0; + u32 index =3D 0; =20 while ((pps =3D select_pp_slot(ctl))) { spin_lock(&zram->wb_limit_lock); @@ -757,6 +979,27 @@ static int zram_writeback_slots(struct zram *zram, str= uct zram_pp_ctl *ctl) } spin_unlock(&zram->wb_limit_lock); =20 + while (!req) { + req =3D zram_select_idle_req(wb_ctl); + if (req) + break; + + wait_event(wb_ctl->done_wait, + !list_empty(&wb_ctl->done_reqs)); + + err =3D zram_complete_done_reqs(zram, wb_ctl); + /* + * BIO errors are not fatal, we continue and simply + * attempt to writeback the remaining objects (pages). + * At the same time we need to signal user-space that + * some writes (at least one, but also could be all of + * them) were not successful and we do so by returning + * the most recent BIO error. + */ + if (err) + ret =3D err; + } + if (!blk_idx) { blk_idx =3D alloc_block_bdev(zram); if (!blk_idx) { @@ -775,67 +1018,47 @@ static int zram_writeback_slots(struct zram *zram, s= truct zram_pp_ctl *ctl) */ if (!zram_test_flag(zram, index, ZRAM_PP_SLOT)) goto next; - if (zram_read_from_zspool(zram, page, index)) + if (zram_read_from_zspool(zram, req->page, index)) goto next; zram_slot_unlock(zram, index); =20 - bio_init(&bio, zram->bdev, &bio_vec, 1, - REQ_OP_WRITE | REQ_SYNC); - bio.bi_iter.bi_sector =3D blk_idx * (PAGE_SIZE >> 9); - __bio_add_page(&bio, page, PAGE_SIZE, 0); - /* - * XXX: A single page IO would be inefficient for write - * but it would be not bad as starter. + * From now on pp-slot is owned by the req, remove it from + * its pp bucket. */ - err =3D submit_bio_wait(&bio); - if (err) { - release_pp_slot(zram, pps); - /* - * BIO errors are not fatal, we continue and simply - * attempt to writeback the remaining objects (pages). - * At the same time we need to signal user-space that - * some writes (at least one, but also could be all of - * them) were not successful and we do so by returning - * the most recent BIO error. - */ - ret =3D err; - continue; - } + list_del_init(&pps->entry); =20 - atomic64_inc(&zram->stats.bd_writes); - zram_slot_lock(zram, index); - /* - * Same as above, we release slot lock during writeback so - * slot can change under us: slot_free() or slot_free() and - * reallocation (zram_write_page()). In both cases slot loses - * ZRAM_PP_SLOT flag. No concurrent post-processing can set - * ZRAM_PP_SLOT on such slots until current post-processing - * finishes. - */ - if (!zram_test_flag(zram, index, ZRAM_PP_SLOT)) - goto next; + req->blk_idx =3D blk_idx; + req->pps =3D pps; + bio_init(&req->bio, zram->bdev, &req->bio_vec, 1, REQ_OP_WRITE); + req->bio.bi_iter.bi_sector =3D req->blk_idx * (PAGE_SIZE >> 9); + req->bio.bi_end_io =3D zram_writeback_endio; + __bio_add_page(&req->bio, req->page, PAGE_SIZE, 0); =20 - zram_free_page(zram, index); - zram_set_flag(zram, index, ZRAM_WB); - zram_set_handle(zram, index, blk_idx); + zram_submit_wb_request(zram, wb_ctl, req); blk_idx =3D 0; - atomic64_inc(&zram->stats.pages_stored); - spin_lock(&zram->wb_limit_lock); - if (zram->wb_limit_enable && zram->bd_wb_limit > 0) - zram->bd_wb_limit -=3D 1UL << (PAGE_SHIFT - 12); - spin_unlock(&zram->wb_limit_lock); + req =3D NULL; + cond_resched(); + continue; + next: zram_slot_unlock(zram, index); release_pp_slot(zram, pps); - - cond_resched(); } =20 - if (blk_idx) - free_block_bdev(zram, blk_idx); - if (page) - __free_page(page); + /* + * Selected idle req, but never submitted it due to some error or + * wb limit. + */ + if (req) + release_wb_req(req); + + while (atomic_read(&wb_ctl->num_inflight) > 0) { + wait_event(wb_ctl->done_wait, !list_empty(&wb_ctl->done_reqs)); + err =3D zram_complete_done_reqs(zram, wb_ctl); + if (err) + ret =3D err; + } =20 return ret; } @@ -948,7 +1171,8 @@ static ssize_t writeback_store(struct device *dev, struct zram *zram =3D dev_to_zram(dev); u64 nr_pages =3D zram->disksize >> PAGE_SHIFT; unsigned long lo =3D 0, hi =3D nr_pages; - struct zram_pp_ctl *ctl =3D NULL; + struct zram_pp_ctl *pp_ctl =3D NULL; + struct zram_wb_ctl *wb_ctl =3D NULL; char *args, *param, *val; ssize_t ret =3D len; int err, mode =3D 0; @@ -970,8 +1194,14 @@ static ssize_t writeback_store(struct device *dev, goto release_init_lock; } =20 - ctl =3D init_pp_ctl(); - if (!ctl) { + pp_ctl =3D init_pp_ctl(); + if (!pp_ctl) { + ret =3D -ENOMEM; + goto release_init_lock; + } + + wb_ctl =3D init_wb_ctl(); + if (!wb_ctl) { ret =3D -ENOMEM; goto release_init_lock; } @@ -1000,7 +1230,7 @@ static ssize_t writeback_store(struct device *dev, goto release_init_lock; } =20 - scan_slots_for_writeback(zram, mode, lo, hi, ctl); + scan_slots_for_writeback(zram, mode, lo, hi, pp_ctl); break; } =20 @@ -1011,7 +1241,7 @@ static ssize_t writeback_store(struct device *dev, goto release_init_lock; } =20 - scan_slots_for_writeback(zram, mode, lo, hi, ctl); + scan_slots_for_writeback(zram, mode, lo, hi, pp_ctl); break; } =20 @@ -1022,7 +1252,7 @@ static ssize_t writeback_store(struct device *dev, goto release_init_lock; } =20 - scan_slots_for_writeback(zram, mode, lo, hi, ctl); + scan_slots_for_writeback(zram, mode, lo, hi, pp_ctl); continue; } =20 @@ -1033,17 +1263,18 @@ static ssize_t writeback_store(struct device *dev, goto release_init_lock; } =20 - scan_slots_for_writeback(zram, mode, lo, hi, ctl); + scan_slots_for_writeback(zram, mode, lo, hi, pp_ctl); continue; } } =20 - err =3D zram_writeback_slots(zram, ctl); + err =3D zram_writeback_slots(zram, pp_ctl, wb_ctl); if (err) ret =3D err; =20 release_init_lock: - release_pp_ctl(zram, ctl); + release_pp_ctl(zram, pp_ctl); + release_wb_ctl(wb_ctl); atomic_set(&zram->pp_in_progress, 0); up_read(&zram->init_lock); =20 @@ -1112,7 +1343,9 @@ static int read_from_bdev(struct zram *zram, struct p= age *page, return -EIO; } =20 -static void free_block_bdev(struct zram *zram, unsigned long blk_idx) {}; +static void free_block_bdev(struct zram *zram, unsigned long blk_idx) +{ +} #endif =20 #ifdef CONFIG_ZRAM_MEMORY_TRACKING --=20 2.52.0.460.gd25c4c69ec-goog