[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <a7ccd8b2-c659-44c9-cb18-1496f99aa5a8@oracle.com>
Date: Wed, 18 May 2022 15:36:30 -0700
From: Mike Kravetz <mike.kravetz@...cle.com>
To: "linux-mm@...ck.org" <linux-mm@...ck.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Cc: Michal Hocko <mhocko@...e.com>, Oscar Salvador <osalvador@...e.de>,
David Hildenbrand <david@...hat.com>,
Naoya Horiguchi <naoya.horiguchi@...ux.dev>,
Hugh Dickins <hughd@...gle.com>, Peter Xu <peterx@...hat.com>
Subject: vma_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
Powered by blists - more mailing lists