Re: Terrible performance of sequential O_DIRECT 4k writes in SAN environment. ~3 times slower then Solars 10 with the same HBA/Storage.

Christoph Hellwig
2014-01-08T14:03:43Z

On Wed, Jan 08, 2014 at 02:17:13AM +0100, Jan Kara wrote:
> Well, I was specifically worried about i_mutex locking. In particular:
> Before we report appending IO completion we need to update i_size.
> To update i_size we need to grab i_mutex.
>
> Now this is unpleasant because inode_dio_wait() happens under i_mutex so
> the above would create lock inversion. And we cannot really do
> inode_dio_done() before grabbing i_mutex as that would open interesting
> races between truncate decreasing i_size and DIO increasing it.

Yeah, XFS splits this between the ilock and iolock, which just makes
life in this area a whole lot easier.