linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Miaohe Lin <linmiaohe@huawei.com>
To: Vitaly Wool <vitaly.wool@konsulko.com>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	David Laight <David.Laight@aculab.com>
Subject: Re: [PATCH 6/9] mm/z3fold: move decrement of pool->pages_nr into __release_z3fold_page()
Date: Thu, 3 Mar 2022 10:27:14 +0800	[thread overview]
Message-ID: <7fab39f6-1a65-9577-4ddf-f3e984474844@huawei.com> (raw)
In-Reply-To: <CAM4kBB+oHqn=AAqKrxgN=e7iyRiZs0HDx8J585Vugf4kyWfF5Q@mail.gmail.com>

On 2022/3/2 18:19, Vitaly Wool wrote:
> On Wed, Mar 2, 2022 at 10:12 AM David Laight <David.Laight@aculab.com> wrote:
>>
>>>> Atomic operations aren't magic.
>>>> Atomic operations are (at best) one slow locked bus cycle.
>>>> Acquiring a lock is the same.
>>>> Releasing a lock might be cheaper, but is probably a locked bus cycle.
>>>>
>>>> So if you use state_lock to protect pages_nr then you lose an atomic
>>>> operation for the decrement and gain one (for the unlock) in the increment.
>>>> That is even or maybe a slight gain.
>>>> OTOH a 64bit atomic is a PITA on some 32bit systems.
>>>> (In fact any atomic is a PITA on sparc32.)
>>>
>>> It's actually *stale_lock* and it's very misleading to use it for this.
>>> I would actually like to keep atomics but I have no problem with
>>> making it 32-bit for 32-bit systems. Would that work for you guys?
>>
>> It would be better to rename the lock.
> 
> No it would not because that lock is protecting the list of entries
> that could not be immediately freed.
> 

Or could we use pool->lock to do this ?

> ~Vitaly

Vitaly, is the patch itself worth a Reviewed-by tag and go to the mm-tree ? Could this
enhance discussed here be sent as another separate patch or am I supposed to make this
change into the current patch?

Many thanks for comment.

> .
> 



  reply	other threads:[~2022-03-03  2:27 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-19  9:25 [PATCH 0/9] A few cleanup patches for z3fold Miaohe Lin
2022-02-19  9:25 ` [PATCH 1/9] mm/z3fold: declare z3fold_mount with __init Miaohe Lin
2022-03-02  8:17   ` Vitaly Wool
2022-02-19  9:25 ` [PATCH 2/9] mm/z3fold: remove obsolete comment in z3fold_alloc Miaohe Lin
2022-03-02  8:18   ` Vitaly Wool
2022-02-19  9:25 ` [PATCH 3/9] mm/z3fold: minor clean up for z3fold_free Miaohe Lin
2022-03-02  8:21   ` Vitaly Wool
2022-02-19  9:25 ` [PATCH 4/9] mm/z3fold: remove unneeded page_mapcount_reset and ClearPagePrivate Miaohe Lin
2022-03-02  8:22   ` Vitaly Wool
2022-02-19  9:25 ` [PATCH 5/9] mm/z3fold: remove confusing local variable l reassignment Miaohe Lin
2022-03-02  8:24   ` Vitaly Wool
2022-02-19  9:25 ` [PATCH 6/9] mm/z3fold: move decrement of pool->pages_nr into __release_z3fold_page() Miaohe Lin
2022-02-19 16:33   ` David Laight
2022-02-21  2:53     ` Miaohe Lin
2022-02-21  5:17       ` David Laight
2022-02-21 11:37         ` Miaohe Lin
2022-03-02  8:31         ` Vitaly Wool
     [not found]           ` <bd5c8187c4034016a22977c9ca54c1b0@AcuMS.aculab.com>
2022-03-02 10:19             ` Vitaly Wool
2022-03-03  2:27               ` Miaohe Lin [this message]
2022-02-19  9:25 ` [PATCH 7/9] mm/z3fold: remove redundant list_del_init of zhdr->buddy in z3fold_free Miaohe Lin
2022-03-02  8:38   ` Vitaly Wool
2022-02-19  9:25 ` [PATCH 8/9] mm/z3fold: remove unneeded PAGE_HEADLESS check in free_handle() Miaohe Lin
2022-02-19  9:25 ` [PATCH 9/9] mm/z3fold: remove unneeded return value of z3fold_compact_page() Miaohe Lin
2022-02-19 20:37   ` Souptick Joarder
2022-03-02  8:40   ` Vitaly Wool
2022-03-02  8:56     ` Miaohe Lin
2022-03-01 13:03 ` [PATCH 0/9] A few cleanup patches for z3fold Miaohe Lin
2022-03-01 17:36   ` Andrew Morton
2022-03-02  1:54     ` 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=7fab39f6-1a65-9577-4ddf-f3e984474844@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=David.Laight@aculab.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