lkml.org 
[lkml]   [2022]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/3] hugetlb: allocate vma lock for all sharable vmas
From
Date
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@oracle.com>

I believe this is a feasible solution. Thanks.

Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>

Thanks,
Miaohe Lin


\
 
 \ /
  Last update: 2022-10-15 03:40    [W:0.195 / U:0.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site