linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3 0/5] ext4: get discard out of jbd2 commit context
@ 2021-07-24  7:41 Wang Jianchao
  2021-07-24  7:41 ` [PATCH V3 1/5] ext4: remove the 'group' parameter of ext4_trim_extent Wang Jianchao
                   ` (4 more replies)
  0 siblings, 5 replies; 23+ messages in thread
From: Wang Jianchao @ 2021-07-24  7:41 UTC (permalink / raw)
  To: linux-ext4, linux-kernel; +Cc: tytso, adilger.kernel

Hi all

This is the version 3 patch set that attempts to get discard out of the jbd2
commit kthread. When the user delete a lot data and cause discard flooding,
the jbd2 commit kthread can be blocked for very long time and then all of
the metadata operations are blocked due to no journal space.

The xfstest with following parameters,
MODULAR=0
TEST_DIR=/mnt/test
TEST_DEV=/dev/nbd37p1
SCRATCH_MNT=/mnt/scratch
SCRATCH_DEV=/dev/nbd37p2
MOUNT_OPTIONS="-o discard"
has passed. The result is consistent w/ or w/o this patch set.

There are 5 patches,

Patch 1 ~ 3, there are no functional changes in them, but just some preparation
for following patches

Patch 4 introduces a async kworker to do discard in fstrim fation which implements
the core idea of this patch set.

Patch 5 let the fallocate retry when err is ENOSPC. This fix the generic/371

Any comments are welcome ;)

V2 -> V3
 - Get rid of the per block group rb tree which carries freed entry. It is not neccesary
   because we have done aggregation when wait for journal commit. Just use a list
   to carry the free entries.

V1 -> V2
 - free the blocks back to mb buddy after commit and then do ftrim fashion discard

 fs/ext4/ext4.h    |   2 +
 fs/ext4/extents.c |   6 ++-
 fs/ext4/mballoc.c | 223 ++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------
 3 files changed, 151 insertions(+), 80 deletions(-)


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

end of thread, other threads:[~2021-08-26 11:42 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-24  7:41 [PATCH V3 0/5] ext4: get discard out of jbd2 commit context Wang Jianchao
2021-07-24  7:41 ` [PATCH V3 1/5] ext4: remove the 'group' parameter of ext4_trim_extent Wang Jianchao
2021-07-26  3:42   ` Guoqing Jiang
2021-08-04 15:26   ` Jan Kara
2021-07-24  7:41 ` [PATCH V3 2/5] ext4: add new helper interface ext4_try_to_trim_range() Wang Jianchao
2021-08-04 15:29   ` Jan Kara
2021-08-12 17:44   ` Theodore Ts'o
2021-08-26  7:19     ` Wang Jianchao
2021-07-24  7:41 ` [PATCH V3 3/5] ext4: remove the repeated comment of ext4_trim_all_free Wang Jianchao
2021-08-04 15:27   ` Jan Kara
2021-07-24  7:41 ` [PATCH V3 4/5] ext4: get discard out of jbd2 commit kthread contex Wang Jianchao
2021-08-04 15:45   ` Jan Kara
2021-08-26  7:15     ` Wang Jianchao
2021-08-12 19:46   ` Theodore Ts'o
2021-08-26  7:51     ` Wang Jianchao
2021-08-26  8:58       ` Wang Jianchao
2021-07-24  7:41 ` [PATCH V3 5/5] ext4: make fallocate retry when err is ENOSPC Wang Jianchao
2021-07-26  3:40   ` Guoqing Jiang
2021-07-26  7:05     ` Wang Jianchao
2021-08-04 15:52       ` Jan Kara
2021-08-26 11:42         ` Wang Jianchao
2021-08-04 15:32   ` Jan Kara
2021-08-04 15:46     ` Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).