linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miaohe Lin <linmiaohe@huawei.com>
To: Hillf Danton <hdanton@sina.com>
Cc: <akpm@linux-foundation.org>, <vitalywool@gmail.com>,
	<linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>,
	Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Subject: Re: [PATCH 6/6] mm/z3fold: use release_z3fold_page_locked() to release locked z3fold page
Date: Tue, 22 Jun 2021 21:49:36 +0800	[thread overview]
Message-ID: <ef4e77a6-4c30-d92c-bd7a-35fa27290401@huawei.com> (raw)
In-Reply-To: <20210620002604.1575-1-hdanton@sina.com>

On 2021/6/20 8:26, Hillf Danton wrote:
> On Sat, 19 Jun 2021 17:31:51 +0800 Miaohe Lin wrote:
>> We should use release_z3fold_page_locked() to release z3fold page when it's
>> locked, although it looks harmless to use release_z3fold_page() now.
>>
>> Fixes: dcf5aedb24f8 ("z3fold: stricter locking and more careful reclaim")
>> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
>> ---
>>  mm/z3fold.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/mm/z3fold.c b/mm/z3fold.c
>> index 196d886a3436..b3c0577b8095 100644
>> --- a/mm/z3fold.c
>> +++ b/mm/z3fold.c
>> @@ -1372,7 +1372,7 @@ static int z3fold_reclaim_page(struct z3fold_pool *pool, unsigned int retries)
>>  			if (zhdr->foreign_handles ||
>>  			    test_and_set_bit(PAGE_CLAIMED, &page->private)) {
>>  				if (kref_put(&zhdr->refcount,
>> -						release_z3fold_page))
>> +						release_z3fold_page_locked))
>>  					atomic64_dec(&pool->pages_nr);
> 
> LGTM. JFYI other issue in z3fold was reported [1] and if the fix proposed there
> makes any sense to you feel free to pick it up and ask Mike for his tests.
> 

Thank you for review and reply.

I browsed [1] several times but I failed to figure out what's the root cause. And I found
some bugs and possible race windows from previous code inspection. I think we can try fix
these first and see whether [1] is (hopefully) fixed. :)
Thanks again.

> [1] https://lore.kernel.org/linux-mm/20210316061351.1649-1-hdanton@sina.com/
> .
>

      parent reply	other threads:[~2021-06-22 13:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-19  9:31 [PATCH 0/6] Cleanup and fixup for z3fold Miaohe Lin
2021-06-19  9:31 ` [PATCH 1/6] mm/z3fold: define macro NCHUNKS as TOTAL_CHUNKS - ZHDR_CHUNKS Miaohe Lin
2021-06-19  9:31 ` [PATCH 2/6] mm/z3fold: avoid possible underflow in z3fold_alloc() Miaohe Lin
2021-06-19  9:31 ` [PATCH 3/6] mm/z3fold: remove magic number in z3fold_create_pool() Miaohe Lin
2021-06-19  9:31 ` [PATCH 4/6] mm/z3fold: remove unused function handle_to_z3fold_header() Miaohe Lin
2021-06-19  9:31 ` [PATCH 5/6] mm/z3fold: fix potential memory leak in z3fold_destroy_pool() Miaohe Lin
2021-06-19  9:31 ` [PATCH 6/6] mm/z3fold: use release_z3fold_page_locked() to release locked z3fold page Miaohe Lin
     [not found] ` <20210620002604.1575-1-hdanton@sina.com>
2021-06-22 13:49   ` Miaohe Lin [this message]

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=ef4e77a6-4c30-d92c-bd7a-35fa27290401@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mikhail.v.gavrilov@gmail.com \
    --cc=vitalywool@gmail.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;
as well as URLs for NNTP newsgroup(s).