Hi! On Wed 12-03-25 08:38:46, Amir Goldstein wrote: > This is the mmap solution proposed by Josef to solve the potential > deadlock with faulting in user pages [1]. > > I've added test coverage to mmap() pre-content events and verified > no pre-content events on page fault [2]. Yeah, sorry for a bit delayd reply but this seems like the least controversial path forward for now. I was thinking for some time about a proper solution for the deadlock but so far I didn't come up with anything clever. > After some push back on [v2] for disabling page fault pre-content hooks > while leaving their code in the kernel, this series revert the page > fault pre-content hooks. > > This leaves DAX files access without pre-content hooks, but that was > never a goal for this feature, so I think that is fine. Yes, I think we can live with that for now. I'll take the patches to my tree with a view of sending them to Linus over the weekend after some exposure in linux-next. Thanks for taking care of this! Honza > Changes since v2: > - Revert page fault pre-content hooks > - Remove mmap hook from remap_file_pages() (Lorenzo) > - Create fsnotify_mmap_perm() wrapper (Lorenzo) > > [1] https://lore.kernel.org/linux-fsdevel/20250307154614.GA59451@perftesting/ > [2] https://github.com/amir73il/ltp/commits/fan_hsm/ > [v2] https://lore.kernel.org/linux-fsdevel/20250311114153.1763176-1-amir73il@xxxxxxxxx/ > [v1] https://lore.kernel.org/linux-fsdevel/20250309115207.908112-1-amir73il@xxxxxxxxx/ > > Amir Goldstein (6): > fsnotify: add pre-content hooks on mmap() > Revert "ext4: add pre-content fsnotify hook for DAX faults" > Revert "xfs: add pre-content fsnotify hook for DAX faults" > Revert "fsnotify: generate pre-content permission event on page fault" > Revert "mm: don't allow huge faults for files with pre content > watches" > Revert "fanotify: disable readahead if we have pre-content watches" > > fs/ext4/file.c | 3 -- > fs/xfs/xfs_file.c | 13 ------ > include/linux/fsnotify.h | 21 ++++++++++ > include/linux/mm.h | 1 - > mm/filemap.c | 86 ---------------------------------------- > mm/memory.c | 19 --------- > mm/nommu.c | 7 ---- > mm/readahead.c | 14 ------- > mm/util.c | 3 ++ > 9 files changed, 24 insertions(+), 143 deletions(-) > > -- > 2.34.1 > -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR