[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YpYQ937N8Daad6u/@casper.infradead.org>
Date: Tue, 31 May 2022 13:58:31 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Miaohe Lin <linmiaohe@...wei.com>
Cc: akpm@...ux-foundation.org, naoya.horiguchi@....com,
peterx@...hat.com, apopple@...dia.com, ying.huang@...el.com,
osalvador@...e.de, mike.kravetz@...cle.com,
songmuchun@...edance.com, hch@....de, dhowells@...hat.com,
cl@...ux.com, linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 1/4] mm: reduce the rcu lock duration
On Mon, May 30, 2022 at 07:30:13PM +0800, Miaohe Lin wrote:
> Commit 3268c63eded4 ("mm: fix move/migrate_pages() race on task struct")
> extends the period of the rcu_read_lock until after the permissions checks
> are done to prevent the task pointed to from changing from under us. But
> the task_struct refcount is also taken at that time, the reference to task
> is guaranteed to be stable. So it's unnecessary to extend the period of
> the rcu_read_lock. Release the rcu lock after task refcount is successfully
> grabbed to reduce the rcu holding time.
But why bother? You know the RCU read lock isn't a "real" lock, right?
Powered by blists - more mailing lists