Commit 62a66bec authored by Ross Zwisler's avatar Ross Zwisler Committed by Zhihong Yu
Browse files

FROMLIST: jbd2: introduce jbd2_inode dirty range scoping



Currently both journal_submit_inode_data_buffers() and
journal_finish_inode_data_buffers() operate on the entire address space
of each of the inodes associated with a given journal entry.  The
consequence of this is that if we have an inode where we are constantly
appending dirty pages we can end up waiting for an indefinite amount of
time in journal_finish_inode_data_buffers() while we wait for all the
pages under writeback to be written out.

The easiest way to cause this type of workload is do just dd from
/dev/zero to a file until it fills the entire filesystem.  This can
cause journal_finish_inode_data_buffers() to wait for the duration of
the entire dd operation.

We can improve this situation by scoping each of the inode dirty ranges
associated with a given transaction.  We do this via the jbd2_inode
structure so that the scoping is contained within jbd2 and so that it
follows the lifetime and locking rules for that structure.

This allows us to limit the writeback & wait in
journal_submit_inode_data_buffers() and
journal_finish_inode_data_buffers() respectively to the dirty range for
a given struct jdb2_inode, keeping us from waiting forever if the inode
in question is still being appended to.

Signed-off-by: default avatarRoss Zwisler <zwisler@google.com>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Cc: stable@vger.kernel.org

BUG=b:130521177, chromium:959968, b:133470926, b:65528573
TEST=Multiple iteration of dd from /dev/zero to /mnt/stateful_partition,
filling the disk.  Also, copied multi-GiB files from USB sticks to the
Downloads folder via the GUI.  I did this on bobba, sarien and
samus-kernelnext.

(am from https://patchwork.kernel.org/patch/11007139/)
Change-Id: I4f0b9b8524ad966ae929c1e76e645e08ecdb4623
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/1669280


Tested-by: default avatarRoss Zwisler <zwisler@google.com>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: default avatarSean Paul <seanpaul@chromium.org>
Reviewed-by: default avatarGuenter Roeck <groeck@chromium.org>
(cherry picked from commit 9767fdd3814a8fe0a53ae5760b1f2bb0237a8221)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/1775620


Reviewed-by: default avatarZhihong Yu <zhihongyu@chromium.org>
Commit-Queue: Zhihong Yu <zhihongyu@chromium.org>
Tested-by: default avatarZhihong Yu <zhihongyu@chromium.org>
parent 47b817ce
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment