linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: zengjx95@gmail.com
To: vitaly.wool@konsulko.com, linmiaohe@huawei.com,
	akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Zeng Jingxiang <linuszeng@tencent.com>
Subject: [PATCH] mm/z3fold: do not unlock in z3fold_page_putback()
Date: Wed, 20 Jul 2022 14:57:44 +0800	[thread overview]
Message-ID: <20220720065744.1006305-1-zengjx95@gmail.com> (raw)

From: Zeng Jingxiang <linuszeng@tencent.com>

z3fold_page_lock() will lock zhdr->page_lock
1630	z3fold_page_lock(zhdr);

return without unlocking zhdr->page_lock
1634	if (kref_put(&zhdr->refcount, release_z3fold_page_locked))
1635		return;

Signed-off-by: Zeng Jingxiang <linuszeng@tencent.com>
---
 mm/z3fold.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/z3fold.c b/mm/z3fold.c
index f41f8b0d9e9a..03785832ad47 100644
--- a/mm/z3fold.c
+++ b/mm/z3fold.c
@@ -1632,13 +1632,14 @@ static void z3fold_page_putback(struct page *page)
 		list_del_init(&zhdr->buddy);
 	INIT_LIST_HEAD(&page->lru);
 	if (kref_put(&zhdr->refcount, release_z3fold_page_locked))
-		return;
+		goto ret;
 	spin_lock(&pool->lock);
 	list_add(&page->lru, &pool->lru);
 	spin_unlock(&pool->lock);
 	if (list_empty(&zhdr->buddy))
 		add_to_unbuddied(pool, zhdr);
 	clear_bit(PAGE_CLAIMED, &page->private);
+ret:
 	z3fold_page_unlock(zhdr);
 }
 
-- 
2.27.0



             reply	other threads:[~2022-07-20  6:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-20  6:57 zengjx95 [this message]
2022-07-20  7:05 ` jingxiang zeng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220720065744.1006305-1-zengjx95@gmail.com \
    --to=zengjx95@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linmiaohe@huawei.com \
    --cc=linuszeng@tencent.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=vitaly.wool@konsulko.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox