xfs
[Top] [All Lists]

Re: deadlocks on ENOSPC

To: ASANO Masahiro <masano@xxxxxxxxxxxxxx>
Subject: Re: deadlocks on ENOSPC
From: Steve Lord <lord@xxxxxxx>
Date: Fri, 15 Jul 2005 07:21:25 -0500
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <20050715.150717.28782011.masano@tnes.nec.co.jp>
References: <20050715.150717.28782011.masano@tnes.nec.co.jp>
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.2-1.3.3 (X11/20050513)
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


<Prev in Thread] Current Thread [Next in Thread>