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

From: Mike Kravetz
Date: Fri Oct 16 2015 - 18:09:18 EST


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 plug or significantly shrink this hole. This patch set uses the same
mechanism employed in shmem (see commit f00cdc6df7).

hugetlb_fault_mutex_table is already used in hugetlbfs for fault
synchronization, and there is no swap for hugetlbfs. So, this code is
simpler than in shmem. In fact, the hugetlb_fault_mutex_table could be
used for races with small hole punch operations. However, we need something
that will work for large holes as well.

Mike Kravetz (3):
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

fs/hugetlbfs/inode.c | 26 +++++++++++++++++++++++---
include/linux/hugetlb.h | 10 ++++++++++
mm/hugetlb.c | 37 +++++++++++++++++++++++++++++++++++++
3 files changed, 70 insertions(+), 3 deletions(-)

--
2.4.3

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