All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] btrfs: eliminate a deadlock when allocating system chunks and rework chunk allocation
@ 2021-06-29 13:43 fdmanana
  2021-06-29 13:43 ` [PATCH 1/2] btrfs: fix deadlock with concurrent chunk allocations involving system chunks fdmanana
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: fdmanana @ 2021-06-29 13:43 UTC (permalink / raw)
  To: linux-btrfs; +Cc: naohiro.aota, Filipe Manana

From: Filipe Manana <fdmanana@suse.com>

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.

Filipe Manana (2):
  btrfs: fix deadlock with concurrent chunk allocations involving system
    chunks
  btrfs: rework chunk allocation to avoid exhaustion of the system chunk
    array

 fs/btrfs/block-group.c | 343 ++++++++++++++++++++++++++++-----------
 fs/btrfs/block-group.h |   6 +-
 fs/btrfs/ctree.c       |  67 ++------
 fs/btrfs/transaction.c |  15 +-
 fs/btrfs/transaction.h |   9 +-
 fs/btrfs/volumes.c     | 355 +++++++++++++++++++++++++++++++----------
 fs/btrfs/volumes.h     |   5 +-
 7 files changed, 547 insertions(+), 253 deletions(-)

-- 
2.28.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-07-02  9:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-29 13:43 [PATCH 0/2] btrfs: eliminate a deadlock when allocating system chunks and rework chunk allocation fdmanana
2021-06-29 13:43 ` [PATCH 1/2] btrfs: fix deadlock with concurrent chunk allocations involving system chunks fdmanana
2021-06-29 13:43 ` [PATCH 2/2] btrfs: rework chunk allocation to avoid exhaustion of the system chunk array fdmanana
2021-07-02  8:52   ` Nikolay Borisov
2021-07-02  9:22     ` Filipe Manana
2021-06-30 13:10 ` [PATCH 0/2] btrfs: eliminate a deadlock when allocating system chunks and rework chunk allocation David Sterba
2021-06-30 14:50   ` Johannes Thumshirn
2021-06-30 18:33     ` David Sterba
2021-07-01  3:59 ` Shinichiro Kawasaki
2021-07-01  7:15 ` Naohiro Aota

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.