--- a/mm/shmem.c~shmem-mapping_set_exiting-to-help-mapped-resilience +++ a/mm/shmem.c @@ -1129,6 +1129,7 @@ static void shmem_evict_inode(struct ino if (shmem_mapping(inode->i_mapping)) { shmem_unacct_size(info->flags, inode->i_size); inode->i_size = 0; + mapping_set_exiting(inode->i_mapping); shmem_truncate_range(inode, 0, (loff_t)-1); if (!list_empty(&info->shrinklist)) { spin_lock(&sbinfo->shrinklist_lock);