Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1252380

[PATCH v2 0/4] hugetlbfs fallocate hole punch race with page faults

From Mike Kravetz <mike.kravetz@oracle.com>
Newsgroups linux.kernel
Subject [PATCH v2 0/4] hugetlbfs fallocate hole punch race with page faults
Date 2015-10-21 02:00 +0200
Message-ID <qlOYV-2mY-5@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


The hugetlbfs fallocate hole punch code can race with page faults.  The
result is that after a hole punch operation, pages may remain within the
hole.  No other side effects of this race were observed.

In preparation for adding userfaultfd support to hugetlbfs, it is desirable
to close the window of this race.  This patch set starts by using the same
mechanism employed in shmem (see commit f00cdc6df7).  This greatly reduces
the race window.  However, it is still possible for the race to occur.

The current hugetlbfs code to remove pages did not deal with pages that
were mapped (because of such a race).  This patch set also adds code to
unmap pages in this rare case.  This unmapping of a single page happens
under the hugetlb_fault_mutex, so it can not be faulted again until the
end of the operation.

v2:
  Incorporated Andrew Morton's cleanups and added suggested comments
  Added patch 4/4 to unmap single pages in remove_inode_hugepages

Mike Kravetz (4):
  mm/hugetlb: Define hugetlb_falloc structure for hole punch race
  mm/hugetlb: Setup hugetlb_falloc during fallocate hole punch
  mm/hugetlb: page faults check for fallocate hole punch in progress and
    wait
  mm/hugetlb: Unmap pages to remove if page fault raced with hole punch

 fs/hugetlbfs/inode.c    | 155 ++++++++++++++++++++++++++++--------------------
 include/linux/hugetlb.h |  10 ++++
 mm/hugetlb.c            |  39 ++++++++++++
 3 files changed, 141 insertions(+), 63 deletions(-)

-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/4] hugetlbfs fallocate hole punch race with page faults Mike Kravetz <mike.kravetz@oracle.com> - 2015-10-21 02:00 +0200
  [PATCH v2 2/4] mm/hugetlb: Setup hugetlb_falloc during fallocate hole punch Mike Kravetz <mike.kravetz@oracle.com> - 2015-10-21 02:00 +0200
    Re: [PATCH v2 2/4] mm/hugetlb: Setup hugetlb_falloc during fallocate  hole punch Dave Hansen <dave.hansen@intel.com> - 2015-10-21 02:20 +0200
      Re: [PATCH v2 2/4] mm/hugetlb: Setup hugetlb_falloc during fallocate  hole punch Mike Kravetz <mike.kravetz@oracle.com> - 2015-10-21 03:10 +0200
  Re: [PATCH v2 0/4] hugetlbfs fallocate hole punch race with page  faults Hugh Dickins <hughd@google.com> - 2015-10-28 04:40 +0100
    Re: [PATCH v2 0/4] hugetlbfs fallocate hole punch race with page  faults Mike Kravetz <mike.kravetz@oracle.com> - 2015-10-28 17:10 +0100
      Re: [PATCH v2 0/4] hugetlbfs fallocate hole punch race with page  faults Hugh Dickins <hughd@google.com> - 2015-10-28 22:10 +0100
        Re: [PATCH v2 0/4] hugetlbfs fallocate hole punch race with page  faults Mike Kravetz <mike.kravetz@oracle.com> - 2015-10-28 22:20 +0100
          Re: [PATCH v2 0/4] hugetlbfs fallocate hole punch race with page  faults Mike Kravetz <mike.kravetz@oracle.com> - 2015-10-29 01:30 +0100

csiph-web