linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Miaohe Lin <linmiaohe@huawei.com>
To: <akpm@linux-foundation.org>, <vitaly.wool@konsulko.com>
Cc: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
	<linmiaohe@huawei.com>
Subject: [PATCH v2 3/8] mm/z3fold: minor clean up for z3fold_free
Date: Tue, 8 Mar 2022 21:43:06 +0800	[thread overview]
Message-ID: <20220308134311.59086-4-linmiaohe@huawei.com> (raw)
In-Reply-To: <20220308134311.59086-1-linmiaohe@huawei.com>

Use put_z3fold_header() to pair with get_z3fold_header. Also fix the wrong
comments. Minor readability improvement.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Vitaly Wool <vitaly.wool@konsulko.com>
---
 mm/z3fold.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/mm/z3fold.c b/mm/z3fold.c
index 87689f50f709..eb89271aea83 100644
--- a/mm/z3fold.c
+++ b/mm/z3fold.c
@@ -1187,9 +1187,9 @@ static int z3fold_alloc(struct z3fold_pool *pool, size_t size, gfp_t gfp,
  * @handle:	handle associated with the allocation returned by z3fold_alloc()
  *
  * In the case that the z3fold page in which the allocation resides is under
- * reclaim, as indicated by the PG_reclaim flag being set, this function
- * only sets the first|last_chunks to 0.  The page is actually freed
- * once both buddies are evicted (see z3fold_reclaim_page() below).
+ * reclaim, as indicated by the PAGE_CLAIMED flag being set, this function
+ * only sets the first|middle|last_chunks to 0.  The page is actually freed
+ * once all buddies are evicted (see z3fold_reclaim_page() below).
  */
 static void z3fold_free(struct z3fold_pool *pool, unsigned long handle)
 {
@@ -1247,7 +1247,7 @@ static void z3fold_free(struct z3fold_pool *pool, unsigned long handle)
 	}
 	if (page_claimed) {
 		/* the page has not been claimed by us */
-		z3fold_page_unlock(zhdr);
+		put_z3fold_header(zhdr);
 		return;
 	}
 	if (test_and_set_bit(NEEDS_COMPACTING, &page->private)) {
-- 
2.23.0



  parent reply	other threads:[~2022-03-08 13:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-08 13:43 [PATCH v2 0/8] A few cleanup patches for z3fold Miaohe Lin
2022-03-08 13:43 ` [PATCH v2 1/8] mm/z3fold: declare z3fold_mount with __init Miaohe Lin
2022-03-08 13:43 ` [PATCH v2 2/8] mm/z3fold: remove obsolete comment in z3fold_alloc Miaohe Lin
2022-03-08 13:43 ` Miaohe Lin [this message]
2022-03-08 13:43 ` [PATCH v2 4/8] mm/z3fold: remove unneeded page_mapcount_reset and ClearPagePrivate Miaohe Lin
2022-03-08 13:43 ` [PATCH v2 5/8] mm/z3fold: remove confusing local variable l reassignment Miaohe Lin
2022-03-08 13:43 ` [PATCH v2 6/8] mm/z3fold: move decrement of pool->pages_nr into __release_z3fold_page() Miaohe Lin
2022-03-08 13:43 ` [PATCH v2 7/8] mm/z3fold: remove redundant list_del_init of zhdr->buddy in z3fold_free Miaohe Lin
2022-03-08 13:43 ` [PATCH v2 8/8] mm/z3fold: remove unneeded PAGE_HEADLESS check in free_handle() Miaohe Lin

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=20220308134311.59086-4-linmiaohe@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=akpm@linux-foundation.org \
    --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