ASANO Masahiro wrote:
After some investigation, I've found in this case:
xfssyncd: allocating extents; locking AG#15 AGF, waiting AG#10 AGF.
Because XFS could not allocate all of the delayed blocks
in a single AG.
dd: freeing extents; locking AG#10 AGF, waiting AGF15 AGF.
Because the file is made from multiple AGs and XFS defines
XFS_ITRUNC_MAX_EXTENTS as 2.
Both processes are in a transaction region (PF_FSTRANS) and operating
2 AGs. It looks like AB-BA deadlock.
So, I have a question. Is multiple AGs in a single transaction safe?
IMHO, multiple AGs in a single transaction is easy to be deadlocked,
because XFS must keep the xfs_buf busy(semaphore down) until it is
committed to in-core log.
--
masano
Hi Masano,
That is definitely a bug, the extent logic is not supposed to lock
allocation groups out of order. Multiple allocation groups are OK,
but wrapping past the last allocation group back to the first again
is not.
Try changing the definition of XFS_STRAT_WRITE_IMAPS from 2 to 1 in
xfs_iomap.c as a workaround for now.
Steve
Steve
|