On Mon, Aug 05, 2019 at 04:05:01PM -0400, Jeff Layton wrote: > Instead, borrow the scheme used by nfs.ko. Buffered writes take the > i_rwsem exclusively, but buffered reads and all O_DIRECT requests > take a shared lock, allowing them to run in parallel. Note that you'll still need an exclusive lock to guard against cache invalidation for direct writes. And instead of adding a new lock you might want to look at the i_rwsem based scheme in XFS (whіch also happens to be where O_DIRECT originally came from).