diff options
author | Theodore Ts'o <tytso@mit.edu> | 2013-02-09 09:24:14 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2013-02-09 09:24:14 -0500 |
commit | 47564bfb95bf370d73906fc4ae57c271e8ba96cd (patch) | |
tree | 5e2bdd86884e37afbb397ff509d2755cea451372 /fs/lockd/svcproc.c | |
parent | 9924a92a8c217576bd2a2b1bbbb854462f1a00ae (diff) | |
download | op-kernel-dev-47564bfb95bf370d73906fc4ae57c271e8ba96cd.zip op-kernel-dev-47564bfb95bf370d73906fc4ae57c271e8ba96cd.tar.gz |
ext4: grab page before starting transaction handle in write_begin()
The grab_cache_page_write_begin() function can potentially sleep for a
long time, since it may need to do memory allocation which can block
if the system is under significant memory pressure, and because it may
be blocked on page writeback. If it does take a long time to grab the
page, it's better that we not hold an active jbd2 handle.
So grab a handle on the page first, and _then_ start the transaction
handle.
This commit fixes the following long transaction handle hold time:
postmark-2917 [000] .... 196.435786: jbd2_handle_stats: dev 254,32
tid 570 type 2 line_no 2541 interval 311 sync 0 requested_blocks 1
dirtied_blocks 0
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/lockd/svcproc.c')
0 files changed, 0 insertions, 0 deletions