[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACSyD1MEM+KnNMimmbdSFXOsok9S=vN=DxzS9x90_6+pt5qjFA@mail.gmail.com>
Date: Mon, 5 Feb 2024 09:08:05 +0800
From: Zhongkun He <hezhongkun.hzk@...edance.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: akpm@...ux-foundation.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [External] Re: [PATCH] mm/z3fold: remove unneeded spinlock
On Mon, Feb 5, 2024 at 2:46 AM Matthew Wilcox <willy@...radead.org> wrote:
>
> On Sun, Feb 04, 2024 at 08:54:04PM +0800, Zhongkun He wrote:
> > There is no need to use spinlock in this section, so
> > remove it.
>
> I don't know this code at all, but the idiom is (relatively) common.
> It waits until anybody _currently_ holding the lock has released it.
>
> That would, eg, make it safe to free the 'pool' memory.
>
> > - spin_lock(&pool->lock);
> > - spin_unlock(&pool->lock);
>
no, please see the commit 'e774a7bc7f0adb'.
spin_lock(&pool->lock);
- if (!list_empty(&page->lru))
- list_del_init(&page->lru);
spin_unlock(&pool->lock);
The original purpose of this lock was to protect page->lru,
which was removed now, so the spinlock is unnecessary.
Thanks for your time.
Powered by blists - more mailing lists