[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9e6af9e5-025c-8674-63bb-139e441eba74@huawei.com>
Date: Sat, 15 Oct 2022 09:40:18 +0800
From: Miaohe Lin <linmiaohe@...wei.com>
To: Mike Kravetz <mike.kravetz@...cle.com>, <linux-mm@...ck.org>,
<linux-kernel@...r.kernel.org>
CC: Muchun Song <songmuchun@...edance.com>,
David Hildenbrand <david@...hat.com>,
Sven Schnelle <svens@...ux.ibm.com>,
Michal Hocko <mhocko@...e.com>, Peter Xu <peterx@...hat.com>,
Naoya Horiguchi <naoya.horiguchi@...ux.dev>,
"Aneesh Kumar K . V" <aneesh.kumar@...ux.vnet.ibm.com>,
Andrea Arcangeli <aarcange@...hat.com>,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
Davidlohr Bueso <dave@...olabs.net>,
Prakash Sangappa <prakash.sangappa@...cle.com>,
James Houghton <jthoughton@...gle.com>,
Mina Almasry <almasrymina@...gle.com>,
Pasha Tatashin <pasha.tatashin@...een.com>,
Axel Rasmussen <axelrasmussen@...gle.com>,
Ray Fucillo <Ray.Fucillo@...ersystems.com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 3/3] hugetlb: allocate vma lock for all sharable vmas
On 2022/10/5 9:17, Mike Kravetz wrote:
> The hugetlb vma lock was originally designed to synchronize pmd sharing.
> As such, it was only necessary to allocate the lock for vmas that were
> capable of pmd sharing. Later in the development cycle, it was discovered
> that it could also be used to simplify fault/truncation races as described
> in [1]. However, a subsequent change to allocate the lock for all vmas
> that use the page cache was never made. A fault/truncation race could
> leave pages in a file past i_size until the file is removed.
>
> Remove the previous restriction and allocate lock for all VM_MAYSHARE
> vmas. Warn in the unlikely event of allocation failure.
>
> Fixes: "hugetlb: clean up code checking for fault/truncation races"
> Signed-off-by: Mike Kravetz <mike.kravetz@...cle.com>
I believe this is a feasible solution. Thanks.
Reviewed-by: Miaohe Lin <linmiaohe@...wei.com>
Thanks,
Miaohe Lin
Powered by blists - more mailing lists