lkml.org 
[lkml]   [2022]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH v4 8/8] hugetlb: use new vma_lock for pmd sharing synchronization
From
Date
On 2022/7/29 1:47, Mike Kravetz wrote:
> On 07/28/22 14:51, Miaohe Lin wrote:
snip
>>
>> Do we need to check &mm->mm_users == 0 here in case the address_space of corresponding process
>> has exited? In this case, mmdrop will drop the last reference and free the skipped_mm. So we will
>> use skipped_mm below after it's freed?
>>
>
> Good point!
> I think we need to wait to drop since we want to hold the read lock.
> Will update.
>
>>> + vma = find_vma(skipped_mm, skipped_vm_start);
>>> + if (!vma || vma->vm_file->f_mapping != mapping ||
>>
>> If skipped_vm_start is unmapped and remapped as a anon vma before we taking the mmap_read_lock,
>> vma->vm_file will be NULL?
>>
>
> IIUC, vma->vm_file will always be set even for an anon vma. The fault
> code depends on this. See beginning of hugetlb_fault() where we
> unconditionally do:
>
> mapping = vma->vm_file->f_mapping;

What if vma is non-hugetlb anon vma?

Thanks.

\
 
 \ /
  Last update: 2022-07-29 03:43    [W:0.058 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site