Skip to content

Commit 4f4dc3a

Browse files
amir73iljankara
authored andcommitted
Revert "mm: don't allow huge faults for files with pre content watches"
This reverts commit 20bf82a. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz> Link: https://patch.msgid.link/20250312073852.2123409-6-amir73il@gmail.com
1 parent 955fbe0 commit 4f4dc3a

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

mm/memory.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
#include <linux/ptrace.h>
7777
#include <linux/vmalloc.h>
7878
#include <linux/sched/sysctl.h>
79-
#include <linux/fsnotify.h>
8079

8180
#include <trace/events/kmem.h>
8281

@@ -5750,17 +5749,8 @@ static vm_fault_t do_numa_page(struct vm_fault *vmf)
57505749
static inline vm_fault_t create_huge_pmd(struct vm_fault *vmf)
57515750
{
57525751
struct vm_area_struct *vma = vmf->vma;
5753-
57545752
if (vma_is_anonymous(vma))
57555753
return do_huge_pmd_anonymous_page(vmf);
5756-
/*
5757-
* Currently we just emit PAGE_SIZE for our fault events, so don't allow
5758-
* a huge fault if we have a pre content watch on this file. This would
5759-
* be trivial to support, but there would need to be tests to ensure
5760-
* this works properly and those don't exist currently.
5761-
*/
5762-
if (unlikely(FMODE_FSNOTIFY_HSM(vma->vm_file->f_mode)))
5763-
return VM_FAULT_FALLBACK;
57645754
if (vma->vm_ops->huge_fault)
57655755
return vma->vm_ops->huge_fault(vmf, PMD_ORDER);
57665756
return VM_FAULT_FALLBACK;
@@ -5784,9 +5774,6 @@ static inline vm_fault_t wp_huge_pmd(struct vm_fault *vmf)
57845774
}
57855775

57865776
if (vma->vm_flags & (VM_SHARED | VM_MAYSHARE)) {
5787-
/* See comment in create_huge_pmd. */
5788-
if (unlikely(FMODE_FSNOTIFY_HSM(vma->vm_file->f_mode)))
5789-
goto split;
57905777
if (vma->vm_ops->huge_fault) {
57915778
ret = vma->vm_ops->huge_fault(vmf, PMD_ORDER);
57925779
if (!(ret & VM_FAULT_FALLBACK))
@@ -5809,9 +5796,6 @@ static vm_fault_t create_huge_pud(struct vm_fault *vmf)
58095796
/* No support for anonymous transparent PUD pages yet */
58105797
if (vma_is_anonymous(vma))
58115798
return VM_FAULT_FALLBACK;
5812-
/* See comment in create_huge_pmd. */
5813-
if (unlikely(FMODE_FSNOTIFY_HSM(vma->vm_file->f_mode)))
5814-
return VM_FAULT_FALLBACK;
58155799
if (vma->vm_ops->huge_fault)
58165800
return vma->vm_ops->huge_fault(vmf, PUD_ORDER);
58175801
#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
@@ -5829,9 +5813,6 @@ static vm_fault_t wp_huge_pud(struct vm_fault *vmf, pud_t orig_pud)
58295813
if (vma_is_anonymous(vma))
58305814
goto split;
58315815
if (vma->vm_flags & (VM_SHARED | VM_MAYSHARE)) {
5832-
/* See comment in create_huge_pmd. */
5833-
if (unlikely(FMODE_FSNOTIFY_HSM(vma->vm_file->f_mode)))
5834-
goto split;
58355816
if (vma->vm_ops->huge_fault) {
58365817
ret = vma->vm_ops->huge_fault(vmf, PUD_ORDER);
58375818
if (!(ret & VM_FAULT_FALLBACK))

0 commit comments

Comments
 (0)