diff options
author | Theodore Ts'o <tytso@mit.edu> | 2009-03-04 19:09:10 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-03-04 19:09:10 -0500 |
commit | 9f24e4208f7ee2748f157368b63287dc903fcf60 (patch) | |
tree | 255989fe69ebfb2b031dc7cf6dbe975df67c711a /fs/ext4/balloc.c | |
parent | b713a5ec55bf73c833f9883cdd761b20ee61a1ab (diff) |
ext4: Use atomic_t's in struct flex_groups
Reduce pressure on the sb_bgl_lock family of locks by using atomic_t's
to track the number of free blocks and inodes in each flex_group.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/balloc.c')
-rw-r--r-- | fs/ext4/balloc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index b37b12875582..53c72ad85877 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c | |||
@@ -470,9 +470,8 @@ void ext4_add_groupblocks(handle_t *handle, struct super_block *sb, | |||
470 | 470 | ||
471 | if (sbi->s_log_groups_per_flex) { | 471 | if (sbi->s_log_groups_per_flex) { |
472 | ext4_group_t flex_group = ext4_flex_group(sbi, block_group); | 472 | ext4_group_t flex_group = ext4_flex_group(sbi, block_group); |
473 | spin_lock(sb_bgl_lock(sbi, flex_group)); | 473 | atomic_add(blocks_freed, |
474 | sbi->s_flex_groups[flex_group].free_blocks += blocks_freed; | 474 | &sbi->s_flex_groups[flex_group].free_blocks); |
475 | spin_unlock(sb_bgl_lock(sbi, flex_group)); | ||
476 | } | 475 | } |
477 | /* | 476 | /* |
478 | * request to reload the buddy with the | 477 | * request to reload the buddy with the |