lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon,  6 Jul 2020 13:26:12 -0700
From:   Mike Kravetz <>
Cc:     Michal Hocko <>, Hugh Dickins <>,
        Naoya Horiguchi <>,
        "Aneesh Kumar K . V" <>,
        Andrea Arcangeli <>,
        "Kirill A . Shutemov" <>,
        Davidlohr Bueso <>,
        Prakash Sangappa <>,
        Andrew Morton <>,
        Linus Torvalds <>,
        Mike Kravetz <>
Subject: [RFC PATCH 0/3] hugetlbfs: address fault time regression

Commits c0d0381ade79 and 87bf91d39bb5 changed the way huegtlb locking
was performed to address BUGs.  One specific change was to always take
the i_mmap_rwsem in read mode during fault processing.  One result of
this change was a 33% regression for anon non-shared page faults [1].

Technically, i_mmap_rwsem only needs to be taken during page faults
if the pmd can potentially be shared.  pmd sharing is not possible for
anon non-shared mappings (as in the reported regression), therefore the
code can be modified to not acquire the semaphore in this case.

Unfortunately, commit 87bf91d39bb5 depends on i_mmap_rwsem always being
taken in the fault path to prevent fault/truncation races.  So, that
approach is no longer appropriate.  Rather, the code now detects races
and backs out operations.

This code "works" in that it only takes i_mmap_rwsem when necessary and
addresses the original BUGs.  However, I am sending as an RFC because:
- I am unsure if the added complexity is worth performance benefit.
- There needs to be a better way/location to make a decison about taking
  the semaphore.  See FIXME's in the code.

Comments and suggestions would be appreciated.


Mike Kravetz (3):
  Revert: "hugetlbfs: Use i_mmap_rwsem to address page fault/truncate
  hugetlbfs: Only take i_mmap_rwsem when sharing is possible
  huegtlbfs: handle page fault/truncate races

 fs/hugetlbfs/inode.c |  69 +++++++++-----------
 mm/hugetlb.c         | 150 ++++++++++++++++++++++++++++++-------------
 2 files changed, 137 insertions(+), 82 deletions(-)


Powered by blists - more mailing lists