]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
fs: jbd2: pull your plug when waiting for space
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Mon, 17 Feb 2014 16:30:03 +0000 (17:30 +0100)
committerMichal Sojka <sojka@merica.cz>
Sun, 13 Sep 2015 07:47:27 +0000 (09:47 +0200)
Two cps in parallel managed to stall the the ext4 fs. It seems that
journal code is either waiting for locks or sleeping waiting for
something to happen. This seems similar to what Mike observed on ext3,
here is his description:

|With an -rt kernel, and a heavy sync IO load, tasks can jam
|up on journal locks without unplugging, which can lead to
|terminal IO starvation.  Unplug and schedule when waiting
|for space.

Cc: stable-rt@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
fs/jbd2/checkpoint.c

index 988b32ed4c8737db045b517714ee8bcc5698405f..6f691c289c7144a5d9e107d2f5f0e34055cd8389 100644 (file)
@@ -116,6 +116,8 @@ void __jbd2_log_wait_for_space(journal_t *journal)
        nblocks = jbd2_space_needed(journal);
        while (jbd2_log_space_left(journal) < nblocks) {
                write_unlock(&journal->j_state_lock);
+               if (current->plug)
+                       io_schedule();
                mutex_lock(&journal->j_checkpoint_mutex);
 
                /*