1. 28 1月, 2013 1 次提交
  2. 25 1月, 2013 8 次提交
  3. 23 1月, 2013 1 次提交
  4. 22 1月, 2013 9 次提交
  5. 21 1月, 2013 1 次提交
  6. 20 1月, 2013 5 次提交
  7. 17 1月, 2013 12 次提交
  8. 15 1月, 2013 3 次提交
    • N
      f2fs: fix the debugfs entry creation path · 4589d25d
      Namjae Jeon 提交于
      As the "status" debugfs entry will be maintained for entire F2FS filesystem
      irrespective of the number of partitions.
      So, we can move the initialization to the init part of the f2fs and destroy will
      be done from exit part. After making changes, for individual partition mount -
      entry creation code will not be executed.
      Signed-off-by: NJianpeng Ma <majianpeng@gmail.com>
      Signed-off-by: NNamjae Jeon <namjae.jeon@samsung.com>
      Signed-off-by: NAmit Sahrawat <a.sahrawat@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      4589d25d
    • M
      f2fs: add global mutex_lock to protect f2fs_stat_list · 66af62ce
      majianpeng 提交于
      There is an race condition between umounting f2fs and reading f2fs/status, which
      results in oops.
      
      Fox example:
      Thread A			Thread B
      umount f2fs 			cat f2fs/status
      
      f2fs_destroy_stats() {		stat_show() {
      				 list_for_each_entry_safe(&f2fs_stat_list)
       list_del(&si->stat_list);
       mutex_lock(&si->stat_lock);
       si->sbi = NULL;
       mutex_unlock(&si->stat_lock);
       kfree(sbi->stat_info);
      } 				 mutex_lock(&si->stat_lock) <- si is gone.
      				 ...
      				}
      
      Solution with a global lock: f2fs_stat_mutex:
      Thread A			Thread B
      umount f2fs 			cat f2fs/status
      
      f2fs_destroy_stats() {		stat_show() {
       mutex_lock(&f2fs_stat_mutex);
       list_del(&si->stat_list);
       mutex_unlock(&f2fs_stat_mutex);
       kfree(sbi->stat_info);		 mutex_lock(&f2fs_stat_mutex);
      }				 list_for_each_entry_safe(&f2fs_stat_list)
      				 ...
      				 mutex_unlock(&f2fs_stat_mutex);
      				}
      Signed-off-by: NJianpeng Ma <majianpeng@gmail.com>
      [jaegeuk.kim@samsung.com: fix typos, description, and remove the existing lock]
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      66af62ce
    • N
      f2fs: remove the blk_plug usage in f2fs_write_data_pages · fa9150a8
      Namjae Jeon 提交于
      Let's consider the usage of blk_plug in f2fs_write_data_pages().
      We can come up with the two issues: lock contention and task awareness.
      
      1. Merging bios prior to grabing "queue lock"
       The f2fs merges consecutive IOs in the file system level before
       submitting any bios, which is similar with the back merge by the
       plugging mechanism in attempt_plug_merge(). Both of them need to acquire
       no queue lock.
      
      2. Merging policy with respect to tasks
       The f2fs merges IOs as much as possible regardless of tasks, while
       blk-plugging is conducted on a basis of tasks. As we can understand
       there are trade-offs, f2fs tries to maximize the write performance with
       well-merged bios.
      
      As a result, if f2fs produces many consecutive but separated bios in
      writepages(), it would be good to use blk-plugging since f2fs would be
      able to avoid queue lock contention in the block layer by merging them.
      But, f2fs merges IOs and submit one bio, which means that there are not
      much chances to merge bios by attempt_plug_merge().
      
      However, f2fs has already been used blk_plug by triggering generic_writepages()
      in f2fs_write_data_pages().
      So to make the overall code consistency, I'd like to remove blk_plug there.
      Signed-off-by: NNamjae Jeon <namjae.jeon@samsung.com>
      Signed-off-by: NAmit Sahrawat <a.sahrawat@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      fa9150a8