On Mon, Apr 22, 2019 at 11:34:21PM -0700, Christoph Hellwig wrote: > I'm a little late to the game, sorry.. > > But: > > > + > > + spin_lock_irqsave(&ip->i_iodone_lock, flags); > > + list_replace_init(&ip->i_iodone_list, &completion_list); > > + spin_unlock_irqrestore(&ip->i_iodone_lock, flags); > > I really don't like this new per-inode lock, and the irq disabling at > all. Especially as the pattern perfectly fits the lockless lists (llists). > Can you check if these work here? They certainly look promising, though the singly-linked list nature means it can't be a direct replacement for xfs_ioend.io_list because we still need to be able to sort and merge completions. However, adding another pointer to xfs_ioend won't change the objects per slab ratio, so avoiding the spinlock heartburn might be worth it... --D