From patchwork Mon Nov 4 17:52:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kairui Song X-Patchwork-Id: 13861762 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 1BA40D1BDD5 for ; Mon, 4 Nov 2024 17:55:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A16766B009D; Mon, 4 Nov 2024 12:55:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9A0106B009E; Mon, 4 Nov 2024 12:55:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8406E6B009F; Mon, 4 Nov 2024 12:55:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 5A56C6B009D for ; Mon, 4 Nov 2024 12:55:27 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 0A4741205BE for ; Mon, 4 Nov 2024 17:55:27 +0000 (UTC) X-FDA: 82749163728.24.BDE8867 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by imf23.hostedemail.com (Postfix) with ESMTP id 1034D140004 for ; Mon, 4 Nov 2024 17:55:03 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Ti8JuirC; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf23.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.210.175 as permitted sender) smtp.mailfrom=ryncsn@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730742758; a=rsa-sha256; cv=none; b=SDQGQD2eH15p0JY2rYIJwgQZdN+kfGcAYybBbCdcfNrIwa7Ck0K+58xkAnDebZEoUPT/mu W7+Ik0kX92FlU6SHpXDKI16+8z70kPDRKmFax9Ms2o8dGf8O42jMS+oxQRjlP0d4Kbvtvi fkEpZ8vvqK8vYV5XEUvfslTL1UbFeQk= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Ti8JuirC; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf23.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.210.175 as permitted sender) smtp.mailfrom=ryncsn@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1730742758; h=from:from:sender:reply-to: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=EnhhoKxkODIhYY9nEI9AbHmj0CiiAcnFinSSL27vrKc=; b=hk95ZxElmzmOBSKhHRgYBB+8E3ErOWUTSi7my5NeLLo8VupOcee9z+Oofned7nT/Kaypu7 qXsjjIaB3F+lnP+Qk6j163Xl0nPpBxgTaZuQSMSvNWP1zZfEv+vio/N0H4pScIhU1H82R3 vLD/PgZNnD3K+leRpUTgc7wLcHLLLtQ= Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-72097a5ca74so4298182b3a.3 for ; Mon, 04 Nov 2024 09:55:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730742923; x=1731347723; darn=kvack.org; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=EnhhoKxkODIhYY9nEI9AbHmj0CiiAcnFinSSL27vrKc=; b=Ti8JuirCYnZ0Ssb2dz0L+P4Adnl89q5gLCS06ZTpKLLnksgWCMTdzlfgCnCp1DU5cz xRn9djG8Lv5Vfct41hR/9PeqiUEA1VgDt6B1dA1t7U882V4B2d9L337jh80zAwOSua44 kpfHYeydSWg1S6QYbTlhdtMzW4/PMi06Z66mjMrnS2P4CNhc3upGHRNff+wD1g8+AbkW tl+r2U93VblmRzhBQJ/ODVk0i2zISmyKIeFA7DPFFkAlB6T4VEQel9v2mVZnWxh0Uj+/ UmRUz1DR7msvBQxblU9g87ptlnTIKlTdJ3cy3o3oWx89g8wOrh6zG5NSio4g4IDTqb1J lbsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730742923; x=1731347723; h=content-transfer-encoding:mime-version:reply-to: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=EnhhoKxkODIhYY9nEI9AbHmj0CiiAcnFinSSL27vrKc=; b=looK5K2biBEcKdMHJUXIsK9sjKa5fXUypbgh/y0HEuBO1E30+gZJpseN/hEpgvb9Cn 5ISSfL05TTc6ypV6teMla9GqdlPdX4j6V4YsquPSRJFSEN0Kkt1Tph0aYRD8ikxU+PBk 8/qYBynwXyRZHX+AuDoX2D49/giM+rFCAIV8d3aAVUr34VF+GzvtoT+GorVxLvLG7Tt9 eCYBVm3AT0liHojHYVIPP0hZuuO8zIQkKv8zjI7z4jPlkCnAPR1+crZ47vmqZhBeHDlh mA+nxpcZeRvcruBCyNfgdwv7mtkGCTszDWM1FTXCzAlojrdS8Fhyly/GPCUejB2kFXOR P+BQ== X-Gm-Message-State: AOJu0YybCzuV8Q8vxhn2Dktr4vYRJ21CgSZYQekmTUaDU/jbZ/ST+ipC grfjpeE5rFTXesvOOUo858sEccuB6/dIKsJAuok3t2m1DhgVWyWnEfhAsOOceuM= X-Google-Smtp-Source: AGHT+IEXhVUoQHVQ9mj0BiltiQonsY9Pm1Uh5kuFjg7mCL6RFv4KpU1NPGiVjmgKBw1fK7XGmymJqw== X-Received: by 2002:a05:6a21:3386:b0:1db:ed17:dd7e with SMTP id adf61e73a8af0-1dbed17deb9mr1166678637.16.1730742921721; Mon, 04 Nov 2024 09:55:21 -0800 (PST) Received: from KASONG-MC4.tencent.com ([106.37.121.39]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-720bc1e5f5bsm7777039b3a.55.2024.11.04.09.55.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 04 Nov 2024 09:55:21 -0800 (PST) From: Kairui Song To: linux-mm@kvack.org Cc: Andrew Morton , Matthew Wilcox , Johannes Weiner , Roman Gushchin , Waiman Long , Shakeel Butt , Michal Hocko , Chengming Zhou , Qi Zheng , Muchun Song , Kairui Song Subject: [PATCH v3 6/6] mm/list_lru: Simplify the list_lru walk callback function Date: Tue, 5 Nov 2024 01:52:57 +0800 Message-ID: <20241104175257.60853-7-ryncsn@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241104175257.60853-1-ryncsn@gmail.com> References: <20241104175257.60853-1-ryncsn@gmail.com> Reply-To: Kairui Song MIME-Version: 1.0 X-Stat-Signature: s6yckkxoddesg57zjqox6uwweasomksx X-Rspamd-Queue-Id: 1034D140004 X-Rspamd-Server: rspam08 X-Rspam-User: X-HE-Tag: 1730742903-28061 X-HE-Meta: U2FsdGVkX18XIR1whs/wLxC5ZWi3yFv0d70+yK4W+Nl3gP4gCCXYBp2A1c56RNMH9F9IS1nd7LX5ZWdqjbJyKYmJV/rQ8rUI1YCA+9QxdC0SYktheNRwL/U+hh7AoohegLX5f6WDyvrAxJGJQNNkb9nDTp7EqmuJmkXHKJY1O46/RlZhkBQ9AFYRsqf2tQ4kJvaNkDdf75qQOkQYuqobPLAGbxdvvqsHl7c4yDJVjSVAxCYiUIr35DjK27Ji4HYG4VdNFH87Aj/QQuUYGfWDnrgRczXgQ6Kl29uHHYAow4AoBVSn/KmuLs+crrR3QNK7ll/Y2g3xWUG1JBTGGYpkGtHh147xpm6gz256wrjxsZ5J/u3w4adZXksFhcF1vlj45CPLTqDA6XeE0KoCHhw71AlHUCt+ADkp7U5xzuSjSmLablm4dwlqlj8L5eJuq3Hx7ivifSbYQbye0/tNHFx4x9vu4BrghNFzIy2+uR5HwLW4M3DbxkixybDo43NEq2MOcf5dA9dzDuGVKpVPUeliieQviw9iCcjn+yOYx/JD+fOvHeBtxuDMEaGSRIUg51GWgIElkoxUmBVHNsprJt5u0RSp261Ro/R4sDI4hWUwi1AnBX4G4J3s1mlBSWP4/rEWPHVRAiZSk7YRqKpPH/nDEhkxnmrBGuJFxLGx9uwT8RxRIzkRIGxN2e8MUMQO9J5Y/FaK1Jeh0aStW9bdThhI/T1gCdkwLSSN8el1/g3Lc5ixf6HR0mK2GJTD1IvYSWHDZrCly4tZWqwjUdle5BBvIor/GmvLEJAQYOgdrMNscE9+S1w5sg+oZ/Ay2Y+mWCap7mhnxFGKq1PSob1qymzx2PcrTrqIMrB1NeWUnFemcp7/HdrBmZQZTM8xCWyJyi0IwKO/Ewre1jy6dnxAEK9id1eCrwB0QlJsyxM4SmJkNIoNjzR3au8j8xnPZ5CNEg5EWFgbasI8BZYsQ8NlGtY mHLFgEbE PZsu2aMZpU8iN969+fwLDXw5Fbva8ZoBkq/pBki23RUxvsVBlb7GXvrtkoG5pk7pkN2JWKKcKAqVrsx848CMN6s9NaukIZ9pkmfqjnSLYnridQIMsgfNQkzxJVSzKa50RSkeNq/+tnXF2/+P6a56qT+2Vvi+jm2WN1ItpLNGmM4wjQkAdAoz8MxKPf2b7WxrZQLyzGFSxixJvjX2f2TwHshTOOx4LGQFMm9avKFc7fXtsVRzO0zikoCRnAcQ9hpi8e1qn/awK0A63ZEMHfXnXfcYD+PPbRNsfifRouFXZYi6DVw8J+8HlO1bKzOhsLsJ+oZcpzkQKGxXriVYMAl3o/hX3MmA6L+XPBs6iyC10fIrOiJ4z+EjppP4iplX8qKQ/sqwWd+KnYt96KXQOkMjDiTRo4PONO2FiPdmVmV+2vmFzS0/JfPQWer/rgGL3C6P+L3k0Lx5MDUz0toXb1aAuL6nsClvxyHQ+/n6atq11IJi8S/XqEhtTjKmxe47pBzUOWkknNNUML6saMD7OKMHjpJ/IGmWGZKJo5yct7v58Ijljxp1S13/wCkF/gL8Yq//4WZss 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: From: Kairui Song Now isolation no longer takes the list_lru global node lock, only use the per-cgroup lock instead. And this lock is inside the list_lru_one being walked, no longer needed to pass the lock explicitly. Signed-off-by: Kairui Song --- drivers/android/binder_alloc.c | 7 +++---- drivers/android/binder_alloc.h | 2 +- fs/dcache.c | 4 ++-- fs/gfs2/quota.c | 2 +- fs/inode.c | 4 ++-- fs/nfs/nfs42xattr.c | 4 ++-- fs/nfsd/filecache.c | 5 +---- fs/xfs/xfs_buf.c | 2 -- fs/xfs/xfs_qm.c | 5 ++--- include/linux/list_lru.h | 2 +- mm/list_lru.c | 2 +- mm/workingset.c | 15 +++++++-------- mm/zswap.c | 4 ++-- 13 files changed, 25 insertions(+), 33 deletions(-) diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c index 86bbe40f4bcd..a738e7745865 100644 --- a/drivers/android/binder_alloc.c +++ b/drivers/android/binder_alloc.c @@ -1047,7 +1047,7 @@ void binder_alloc_vma_close(struct binder_alloc *alloc) /** * binder_alloc_free_page() - shrinker callback to free pages * @item: item to free - * @lock: lock protecting the item + * @lru: list_lru instance of the item * @cb_arg: callback argument * * Called from list_lru_walk() in binder_shrink_scan() to free @@ -1055,9 +1055,8 @@ void binder_alloc_vma_close(struct binder_alloc *alloc) */ enum lru_status binder_alloc_free_page(struct list_head *item, struct list_lru_one *lru, - spinlock_t *lock, void *cb_arg) - __must_hold(lock) + __must_hold(&lru->lock) { struct binder_lru_page *page = container_of(item, typeof(*page), lru); struct binder_alloc *alloc = page->alloc; @@ -1092,7 +1091,7 @@ enum lru_status binder_alloc_free_page(struct list_head *item, list_lru_isolate(lru, item); spin_unlock(&alloc->lock); - spin_unlock(lock); + spin_unlock(&lru->lock); if (vma) { trace_binder_unmap_user_start(alloc, index); diff --git a/drivers/android/binder_alloc.h b/drivers/android/binder_alloc.h index 70387234477e..c02c8ebcb466 100644 --- a/drivers/android/binder_alloc.h +++ b/drivers/android/binder_alloc.h @@ -118,7 +118,7 @@ static inline void binder_selftest_alloc(struct binder_alloc *alloc) {} #endif enum lru_status binder_alloc_free_page(struct list_head *item, struct list_lru_one *lru, - spinlock_t *lock, void *cb_arg); + void *cb_arg); struct binder_buffer *binder_alloc_new_buf(struct binder_alloc *alloc, size_t data_size, size_t offsets_size, diff --git a/fs/dcache.c b/fs/dcache.c index 0f6b16ba30d0..d7f6866f5f52 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1089,7 +1089,7 @@ void shrink_dentry_list(struct list_head *list) } static enum lru_status dentry_lru_isolate(struct list_head *item, - struct list_lru_one *lru, spinlock_t *lru_lock, void *arg) + struct list_lru_one *lru, void *arg) { struct list_head *freeable = arg; struct dentry *dentry = container_of(item, struct dentry, d_lru); @@ -1170,7 +1170,7 @@ long prune_dcache_sb(struct super_block *sb, struct shrink_control *sc) } static enum lru_status dentry_lru_isolate_shrink(struct list_head *item, - struct list_lru_one *lru, spinlock_t *lru_lock, void *arg) + struct list_lru_one *lru, void *arg) { struct list_head *freeable = arg; struct dentry *dentry = container_of(item, struct dentry, d_lru); diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 2e6bc77f4f81..72b48f6f5561 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -149,7 +149,7 @@ static void gfs2_qd_list_dispose(struct list_head *list) static enum lru_status gfs2_qd_isolate(struct list_head *item, - struct list_lru_one *lru, spinlock_t *lru_lock, void *arg) + struct list_lru_one *lru, void *arg) { struct list_head *dispose = arg; struct gfs2_quota_data *qd = diff --git a/fs/inode.c b/fs/inode.c index 442cb4fc09b2..46fbd5b23482 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -881,7 +881,7 @@ void invalidate_inodes(struct super_block *sb) * with this flag set because they are the inodes that are out of order. */ static enum lru_status inode_lru_isolate(struct list_head *item, - struct list_lru_one *lru, spinlock_t *lru_lock, void *arg) + struct list_lru_one *lru, void *arg) { struct list_head *freeable = arg; struct inode *inode = container_of(item, struct inode, i_lru); @@ -923,7 +923,7 @@ static enum lru_status inode_lru_isolate(struct list_head *item, if (inode_has_buffers(inode) || !mapping_empty(&inode->i_data)) { inode_pin_lru_isolating(inode); spin_unlock(&inode->i_lock); - spin_unlock(lru_lock); + spin_unlock(&lru->lock); if (remove_inode_buffers(inode)) { unsigned long reap; reap = invalidate_mapping_pages(&inode->i_data, 0, -1); diff --git a/fs/nfs/nfs42xattr.c b/fs/nfs/nfs42xattr.c index b6e3d8f77b91..37d79400e5f4 100644 --- a/fs/nfs/nfs42xattr.c +++ b/fs/nfs/nfs42xattr.c @@ -802,7 +802,7 @@ static struct shrinker *nfs4_xattr_large_entry_shrinker; static enum lru_status cache_lru_isolate(struct list_head *item, - struct list_lru_one *lru, spinlock_t *lru_lock, void *arg) + struct list_lru_one *lru, void *arg) { struct list_head *dispose = arg; struct inode *inode; @@ -867,7 +867,7 @@ nfs4_xattr_cache_count(struct shrinker *shrink, struct shrink_control *sc) static enum lru_status entry_lru_isolate(struct list_head *item, - struct list_lru_one *lru, spinlock_t *lru_lock, void *arg) + struct list_lru_one *lru, void *arg) { struct list_head *dispose = arg; struct nfs4_xattr_bucket *bucket; diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c index 2e6783f63712..09c444eb944f 100644 --- a/fs/nfsd/filecache.c +++ b/fs/nfsd/filecache.c @@ -487,7 +487,6 @@ void nfsd_file_net_dispose(struct nfsd_net *nn) * nfsd_file_lru_cb - Examine an entry on the LRU list * @item: LRU entry to examine * @lru: controlling LRU - * @lock: LRU list lock (unused) * @arg: dispose list * * Return values: @@ -497,9 +496,7 @@ void nfsd_file_net_dispose(struct nfsd_net *nn) */ static enum lru_status nfsd_file_lru_cb(struct list_head *item, struct list_lru_one *lru, - spinlock_t *lock, void *arg) - __releases(lock) - __acquires(lock) + void *arg) { struct list_head *head = arg; struct nfsd_file *nf = list_entry(item, struct nfsd_file, nf_lru); diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index aa4dbda7b536..43b914c1f621 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -1857,7 +1857,6 @@ static enum lru_status xfs_buftarg_drain_rele( struct list_head *item, struct list_lru_one *lru, - spinlock_t *lru_lock, void *arg) { @@ -1956,7 +1955,6 @@ static enum lru_status xfs_buftarg_isolate( struct list_head *item, struct list_lru_one *lru, - spinlock_t *lru_lock, void *arg) { struct xfs_buf *bp = container_of(item, struct xfs_buf, b_lru); diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c index 665d26990b78..8413ac368042 100644 --- a/fs/xfs/xfs_qm.c +++ b/fs/xfs/xfs_qm.c @@ -412,9 +412,8 @@ static enum lru_status xfs_qm_dquot_isolate( struct list_head *item, struct list_lru_one *lru, - spinlock_t *lru_lock, void *arg) - __releases(lru_lock) __acquires(lru_lock) + __releases(&lru->lock) __acquires(&lru->lock) { struct xfs_dquot *dqp = container_of(item, struct xfs_dquot, q_lru); @@ -460,7 +459,7 @@ xfs_qm_dquot_isolate( trace_xfs_dqreclaim_dirty(dqp); /* we have to drop the LRU lock to flush the dquot */ - spin_unlock(lru_lock); + spin_unlock(&lru->lock); error = xfs_qm_dqflush(dqp, &bp); if (error) diff --git a/include/linux/list_lru.h b/include/linux/list_lru.h index 10ba9a54d42c..05c166811f6b 100644 --- a/include/linux/list_lru.h +++ b/include/linux/list_lru.h @@ -184,7 +184,7 @@ void list_lru_isolate_move(struct list_lru_one *list, struct list_head *item, struct list_head *head); typedef enum lru_status (*list_lru_walk_cb)(struct list_head *item, - struct list_lru_one *list, spinlock_t *lock, void *cb_arg); + struct list_lru_one *list, void *cb_arg); /** * list_lru_walk_one: walk a @lru, isolating and disposing freeable items. diff --git a/mm/list_lru.c b/mm/list_lru.c index c139202e27f7..f93ada6a207b 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -298,7 +298,7 @@ __list_lru_walk_one(struct list_lru *lru, int nid, struct mem_cgroup *memcg, break; --*nr_to_walk; - ret = isolate(item, l, &l->lock, cb_arg); + ret = isolate(item, l, cb_arg); switch (ret) { /* * LRU_RETRY, LRU_REMOVED_RETRY and LRU_STOP will drop the lru diff --git a/mm/workingset.c b/mm/workingset.c index 8c4b6738dcad..4b58ef535a17 100644 --- a/mm/workingset.c +++ b/mm/workingset.c @@ -712,8 +712,7 @@ static unsigned long count_shadow_nodes(struct shrinker *shrinker, static enum lru_status shadow_lru_isolate(struct list_head *item, struct list_lru_one *lru, - spinlock_t *lru_lock, - void *arg) __must_hold(lru_lock) + void *arg) __must_hold(lru->lock) { struct xa_node *node = container_of(item, struct xa_node, private_list); struct address_space *mapping; @@ -722,20 +721,20 @@ static enum lru_status shadow_lru_isolate(struct list_head *item, /* * Page cache insertions and deletions synchronously maintain * the shadow node LRU under the i_pages lock and the - * lru_lock. Because the page cache tree is emptied before - * the inode can be destroyed, holding the lru_lock pins any + * &lru->lock. Because the page cache tree is emptied before + * the inode can be destroyed, holding the &lru->lock pins any * address_space that has nodes on the LRU. * * We can then safely transition to the i_pages lock to * pin only the address_space of the particular node we want - * to reclaim, take the node off-LRU, and drop the lru_lock. + * to reclaim, take the node off-LRU, and drop the &lru->lock. */ mapping = container_of(node->array, struct address_space, i_pages); /* Coming from the list, invert the lock order */ if (!xa_trylock(&mapping->i_pages)) { - spin_unlock_irq(lru_lock); + spin_unlock_irq(&lru->lock); ret = LRU_RETRY; goto out; } @@ -744,7 +743,7 @@ static enum lru_status shadow_lru_isolate(struct list_head *item, if (mapping->host != NULL) { if (!spin_trylock(&mapping->host->i_lock)) { xa_unlock(&mapping->i_pages); - spin_unlock_irq(lru_lock); + spin_unlock_irq(&lru->lock); ret = LRU_RETRY; goto out; } @@ -753,7 +752,7 @@ static enum lru_status shadow_lru_isolate(struct list_head *item, list_lru_isolate(lru, item); __dec_node_page_state(virt_to_page(node), WORKINGSET_NODES); - spin_unlock(lru_lock); + spin_unlock(&lru->lock); /* * The nodes should only contain one or more shadow entries, diff --git a/mm/zswap.c b/mm/zswap.c index 63bcd94dc2cb..0e29a0b0db71 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -1095,7 +1095,7 @@ static int zswap_writeback_entry(struct zswap_entry *entry, * for reclaim by this ratio. */ static enum lru_status shrink_memcg_cb(struct list_head *item, struct list_lru_one *l, - spinlock_t *lock, void *arg) + void *arg) { struct zswap_entry *entry = container_of(item, struct zswap_entry, lru); bool *encountered_page_in_swapcache = (bool *)arg; @@ -1151,7 +1151,7 @@ static enum lru_status shrink_memcg_cb(struct list_head *item, struct list_lru_o * It's safe to drop the lock here because we return either * LRU_REMOVED_RETRY or LRU_RETRY. */ - spin_unlock(lock); + spin_unlock(&l->lock); writeback_result = zswap_writeback_entry(entry, swpentry);