Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fanotify: Avoid softlockups when reading many events
When user provides large buffer for events and there are lots of events available, we can try to copy them all to userspace without scheduling which can softlockup the kernel (furthermore exacerbated by the contention on notification_lock). Add a scheduling point after copying each event. Note that usually the real underlying problem is the cost of fanotify event merging and the resulting contention on notification_lock but this is a cheap way to somewhat reduce the problem until we can properly address that. Reported-by: Francesco Ruggeri <[email protected]> Link: https://lore.kernel.org/lkml/[email protected] Reviewed-by: Amir Goldstein <[email protected]> Signed-off-by: Jan Kara <[email protected]>
- Loading branch information