lkml.org 
[lkml]   [2022]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectvma_needs_copy always true for VM_HUGETLB ?
For most non-anonymous vmas, we do not copy page tables at fork time, but
rather lazily populate the tables after fork via faults. The routine
vma_needs_copy() is used to make this decision. For VM_HUGETLB vmas, it always
returns true.

Anyone know/remember why? The code was added more than 15 years ago and
my search for why hugetlb vmas were excluded came up empty.

I do not see a reason why VM_HUGETLB is in this list. Initial testing did
not reveal any problems when I removed the VM_HUGETLB check.

FYI - I am looking at the performance of fork and exec (unmap) of processes
with very large hugetlb mappings. Skipping the copy at fork time would
certainly speed things up. Of course, there could some users who would
notice if hugetlb page tables are not copied at fork time. However, this
is the behavior for 'normal' mappings. I am inclined to make hugetlb be
'more normal'.
--
Mike Kravetz

\
 
 \ /
  Last update: 2022-05-19 00:38    [W:0.049 / U:0.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site