1 From f14c9bf89b1ea5e50bc7da05b26885e060f311cb Mon Sep 17 00:00:00 2001
2 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
3 Date: Mon, 17 Feb 2014 17:30:03 +0100
4 Subject: [PATCH 149/366] fs: jbd2: pull your plug when waiting for space
6 Two cps in parallel managed to stall the the ext4 fs. It seems that
7 journal code is either waiting for locks or sleeping waiting for
8 something to happen. This seems similar to what Mike observed on ext3,
9 here is his description:
11 |With an -rt kernel, and a heavy sync IO load, tasks can jam
12 |up on journal locks without unplugging, which can lead to
13 |terminal IO starvation. Unplug and schedule when waiting
16 Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
18 fs/jbd2/checkpoint.c | 2 ++
19 1 file changed, 2 insertions(+)
21 diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c
22 index 684996c..6e18a06 100644
23 --- a/fs/jbd2/checkpoint.c
24 +++ b/fs/jbd2/checkpoint.c
25 @@ -116,6 +116,8 @@ void __jbd2_log_wait_for_space(journal_t *journal)
26 nblocks = jbd2_space_needed(journal);
27 while (jbd2_log_space_left(journal) < nblocks) {
28 write_unlock(&journal->j_state_lock);
31 mutex_lock(&journal->j_checkpoint_mutex);