diff options
author | Jan Kara <jack@suse.cz> | 2015-06-08 12:46:37 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2015-06-08 12:46:37 -0400 |
commit | de92c8caf16ca84926fa31b7a5590c0fb9c0d5ca (patch) | |
tree | 3fda30d72edf93965320abb2d3a689b04fbb9f46 /fs/jbd2/journal.c | |
parent | 8b00f400eedf91d074f831077003c0d4d9147377 (diff) | |
download | linux-stable-de92c8caf16ca84926fa31b7a5590c0fb9c0d5ca.tar.gz linux-stable-de92c8caf16ca84926fa31b7a5590c0fb9c0d5ca.tar.bz2 linux-stable-de92c8caf16ca84926fa31b7a5590c0fb9c0d5ca.zip |
jbd2: speedup jbd2_journal_get_[write|undo]_access()
jbd2_journal_get_write_access() and jbd2_journal_get_create_access() are
frequently called for buffers that are already part of the running
transaction - most frequently it is the case for bitmaps, inode table
blocks, and superblock. Since in such cases we have nothing to do, it is
unfortunate we still grab reference to journal head, lock the bh, lock
bh_state only to find out there's nothing to do.
Improving this is a bit subtle though since until we find out journal
head is attached to the running transaction, it can disappear from under
us because checkpointing / commit decided it's no longer needed. We deal
with this by protecting journal_head slab with RCU. We still have to be
careful about journal head being freed & reallocated within slab and
about exposing journal head in consistent state (in particular
b_modified and b_frozen_data must be in correct state before we allow
user to touch the buffer).
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/jbd2/journal.c')
-rw-r--r-- | fs/jbd2/journal.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 0bc333b4a594..303ccd953e95 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -2321,7 +2321,7 @@ static int jbd2_journal_init_journal_head_cache(void) jbd2_journal_head_cache = kmem_cache_create("jbd2_journal_head", sizeof(struct journal_head), 0, /* offset */ - SLAB_TEMPORARY, /* flags */ + SLAB_TEMPORARY | SLAB_DESTROY_BY_RCU, NULL); /* ctor */ retval = 0; if (!jbd2_journal_head_cache) { |