Skip to content

fix ext4 deadlock on 2.6.27.y

Jayson R. King linux-ext4 lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11ext4: invalidate pages if delalloc block allocation fails.fs/ext4/inode.c+73 -120 replies
2/11percpu counter: clean up percpu_counter_sum_and_set()fs/ext4/balloc.c include/linux/percpu_counter.h lib/percpu_counter.c+7 -150 replies
3/11ext4: Make sure all the block allocation paths reserve blocksfs/ext4/balloc.c fs/ext4/ext4.h fs/ext4/inode.c +1 more+69 -300 replies
4/11ext4: Add percpu dirty block accounting.fs/ext4/balloc.c fs/ext4/ext4_sb.h fs/ext4/inode.c +2 more+73 -510 replies
5/11ext4: Retry block reservationfs/ext4/balloc.c fs/ext4/inode.c fs/ext4/mballoc.c+24 -50 replies
6/11ext4: Retry block allocation if we have free blocks leftfs/ext4/inode.c+57 -240 replies
7/11ext4: Use tag dirty lookup during mpage_da_submit_iofs/ext4/inode.c+13 -170 replies
8/11vfs: Remove the range_cont writeback mode.include/linux/writeback.h mm/page-writeback.c+0 -30 replies
9/11vfs: Add no_nrwrite_index_update writeback control flaginclude/linux/writeback.h mm/page-writeback.c+18 -50 replies
10/11ext4: Fix file fragmentation during large file write.fs/ext4/inode.c+55 -330 replies
11/11ext4: Implement range_cyclic in ext4_da_writepages instead of write_cache_pagesfs/ext4/inode.c+19 -20 replies

Reviews trailers per patch

1 of 11 patches has a Reviewed-by or Acked-by.

PatchPeter Zijlstra
1/11
2/11A-b
3/11
4/11
5/11
6/11
7/11
8/11
9/11
10/11
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [00/11] fix ext4 deadlock on 2.6.27.y

Greetings,

Using the kernel 2.6.27.45 with an ext4 filesystem, the same deadlock as was reported earlier in kernel bugzilla #12579 can occur. Simply running "dbench 500" on an ext4 filesystem can cause the deadlock in one to two minutes.

In later stable kernels, the deadlock was fixed by commit 2acf2c26 ("ext4: Implement range_cyclic in ext4_da_writepages instead of write_cache_pages"). I can confirm that the same commit fixes the deadlock on 2.6.27.y. However, as the code in ext4_da_writepages is different in 2.6.27.y than in later kernels, it was necessary to add some other mainline patches before 2acf2c26.

Alltogether, I've added 11 mainline patches including 2acf2c26 to my local 2.6.27.y kernel, and confirmed that the deadlock is fixed only when the patch 2acf2c26 is applied.

The 11 patches are:

Aneesh Kumar K.V (10):
ext4: invalidate pages if delalloc block allocation fails.
ext4: Make sure all the block allocation paths reserve blocks
ext4: Add percpu dirty block accounting.
ext4: Retry block reservation
ext4: Retry block allocation if we have free blocks left
ext4: Use tag dirty lookup during mpage_da_submit_io
vfs: Remove the range_cont writeback mode.
vfs: Add no_nrwrite_index_update writeback control flag
ext4: Fix file fragmentation during large file write.
ext4: Implement range_cyclic in ext4_da_writepages instead of write_cache_pages

Mingming Cao (1):
percpu counter: clean up percpu_counter_sum_and_set()

All will be posted in a reply to this message, in the order that they apply.

I think these patches should be committed to stable 2.6.27.y.

Most of these patches applied cleanly to 2.6.27.45 with no changes other than some context lines, but two of the patches needed some very slight modifications. I'll note the changes that I made to them above my signed-off line for each.

Jayson