f2fs: use spinlock for segmap_lock instead of rwlock
authorChao Yu <chao2.yu@samsung.com>
Wed, 11 Feb 2015 10:20:38 +0000 (18:20 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 12 Feb 2015 01:04:51 +0000 (17:04 -0800)
commit1a118ccfd60fc78e64c0a3ab9e85075545839d6e
treee0cbaa9c068a063c71923a9b3a2c5d6168c70a6d
parentf1a3b98e73a9f811ab4882669043c50c0e0dc7b6
f2fs: use spinlock for segmap_lock instead of rwlock

rwlock can provide better concurrency when there are much more readers than
writers because readers can hold the rwlock simultaneously.

But now, for segmap_lock rwlock in struct free_segmap_info, there is only one
reader 'mount' from below call path:
->f2fs_fill_super
  ->build_segment_manager
    ->build_dirty_segmap
      ->init_dirty_segmap
        ->find_next_inuse
          read_lock
          ...
          read_unlock

Now that our concurrency can not be improved since there is no other reader for
this lock, we do not need to use rwlock_t type for segmap_lock, let's replace it
with spinlock_t type.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/segment.c
fs/f2fs/segment.h
This page took 0.03659 seconds and 5 git commands to generate.