[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220623031401.wdyt5ylin4aijzhh@box.shutemov.name>
Date: Thu, 23 Jun 2022 06:14:01 +0300
From: "Kirill A. Shutemov" <kirill@...temov.name>
To: Miaohe Lin <linmiaohe@...wei.com>
Cc: akpm@...ux-foundation.org, shy828301@...il.com,
willy@...radead.org, zokeefe@...gle.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 02/16] mm/huge_memory: access vm_page_prot with READ_ONCE
in remove_migration_pmd
On Thu, Jun 23, 2022 at 01:06:13AM +0800, Miaohe Lin wrote:
> vma->vm_page_prot is read lockless from the rmap_walk, it may be updated
> concurrently. Using READ_ONCE to prevent the risk of reading intermediate
> values.
Have you checked all other vm_page_prot reads that they hold mmap_lock?
I think the right fix would be to provide a helper to read vm_page_prot
which does READ_ONCE() and use it everywhere. This seems more sustainable.
--
Kirill A. Shutemov
Powered by blists - more mailing lists