Re: [PATCH 0/2] btrfs: eliminate a deadlock when allocating system chunks and rework chunk allocation
From: Shinichiro Kawasaki <hidden>
Date: 2021-07-01 03:59:43
On Jun 29, 2021 / 14:43, fdmanana@kernel.org wrote:
From: Filipe Manana <redacted> The first patch eliminates a deadlock when multiple tasks need to allocate a system chunk. It reverts a previous fix for a problem that resulted in exhausting the system chunk array and result in a transaction abort when there are many tasks allocating chunks in parallel. Since there is not a simple and short fix for the deadlock that does not bring back the system array exhaustion problem, and the deadlock is relatively easy to trigger on zoned filesystem while the exhaustion problem is not so common, this first patch just revets that previous fix. The second patch reworks a bit of the chunk allocation code so that we don't hold onto reserved system space from phase 1 to phase 2 of chunk allocation, which is what leads to system chunk array exhaustion when there's a bunch of tasks doing chunks allocations in parallel (initially observed on PowerPC, with a 64K node size, when running the fallocate tests from stress-ng). The diff of this patch is quite big, but about half of it are just comments.
Thank you for the fix. Before applying this series, I had observed btrfs hangs during xfstests on btrfs zoned. The hangs happened at 4 test cases: generic/013, generic/113, generic/127 and generic/241. After applying the series, I repeated each of the 4 tests cases for 30 minutes, and did not observed the hang. Also I ran through my test set with the series, and no failure was observed. Looks good from testing point of view, then for the series, Tested-by: Shin'ichiro Kawasaki <redacted> -- Best Regards, Shin'ichiro Kawasaki