summaryrefslogtreecommitdiff
path: root/.clang-format
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2020-09-25 18:26:00 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2020-09-27 11:21:35 -0700
commitd042035eaf5f9009ad927dc4d3ce848381ccdeed (patch)
tree8285680a75032f8a6e766c5e6813ce32dfd70bba /.clang-format
parent70e806e4e645019102d0e09d4933654fb5fb58ce (diff)
mm/thp: Split huge pmds/puds if they're pinned when fork()
Pinned pages shouldn't be write-protected when fork() happens, because follow up copy-on-write on these pages could cause the pinned pages to be replaced by random newly allocated pages. For huge PMDs, we split the huge pmd if pinning is detected. So that future handling will be done by the PTE level (with our latest changes, each of the small pages will be copied). We can achieve this by let copy_huge_pmd() return -EAGAIN for pinned pages, so that we'll fallthrough in copy_pmd_range() and finally land the next copy_pte_range() call. Huge PUDs will be even more special - so far it does not support anonymous pages. But it can actually be done the same as the huge PMDs even if the split huge PUDs means to erase the PUD entries. It'll guarantee the follow up fault ins will remap the same pages in either parent/child later. This might not be the most efficient way, but it should be easy and clean enough. It should be fine, since we're tackling with a very rare case just to make sure userspaces that pinned some thps will still work even without MADV_DONTFORK and after they fork()ed. Signed-off-by: Peter Xu <peterx@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '.clang-format')
0 files changed, 0 insertions, 0 deletions