Jan, This is the alternative solution proposed by Josef to solve the deadlock. I've added test coverage to mmap() pre-content events and verified no pre-content events on page fault [1]. I went back and forward about allowing pre-content events on page fault for __FMODE_EXEC and I have actually tested this variant, but because I do not have test coverage for Josef's large executables use case and because it is late in the rc cycle, I decided to disable pre-content hooks in page faults temporarily, but leave the code in to allow Josef the opportunity to re-enable the hooks for __FMODE_EXEC with a separate patch after more testing. Thanks, Amir. [1] https://github.com/amir73il/ltp/commits/fan_hsm/ Amir Goldstein (2): fsnotify: add pre-content hooks on mmap() fsnotify: avoid pre-content events when faulting in user pages include/linux/fsnotify.h | 11 ++++++++--- mm/filemap.c | 3 +-- mm/mmap.c | 12 ++++++++++++ mm/util.c | 7 +++++++ 4 files changed, 28 insertions(+), 5 deletions(-) -- 2.34.1