Patch "f2fs: remove percpu_count due to performance regression" has been added to the 4.9-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
f2fs: remove percpu_count due to performance regression
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
f2fs-remove-percpu_count-due-to-performance-regression.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
35782b233f37e48ecc469d9c7232f3f6a7fad41aMon Sep 17 00:00:00 2001
From: Jaegeuk Kim <[email protected]>
Date: Thu, 20 Oct 2016 19:09:57 -0700
Subject: f2fs: remove percpu_count due to performance regression
From: Jaegeuk Kim <[email protected]>
commit 35782b233f37e48ecc469d9c7232f3f6a7fad41a upstream.
This patch removes percpu_count usage due to performance regression in iozone.
--- fs/f2fs/debug.c | 12 ++++++------ fs/f2fs/f2fs.h | 12 ++++++------ fs/f2fs/super.c | 16 +++++----------- 3 files changed, 17 insertions(+), 23 deletions(-)
fs/f2fs/debug.c +6 -6
@@ -310,17 +310,17 @@ static int stat_show(struct seq_file *s,seq_printf (s," - Inner Struct Count: tree: %d(%d), node: %d\n" , si->ext_tree, si->zombie_tree, si->ext_node);seq_puts (s,"\nBalancing F2FS Async:\n" ); -seq_printf (s," - inmem: %4lld, wb_bios: %4d\n" , +seq_printf (s," - inmem: %4d, wb_bios: %4d\n" , si->inmem_pages, si->wb_bios); -seq_printf (s," - nodes: %4lld in %4d\n" , +seq_printf (s," - nodes: %4d in %4d\n" , si->ndirty_node, si->node_pages); -seq_printf (s," - dents: %4lld in dirs:%4d (%4d)\n" , +seq_printf (s," - dents: %4d in dirs:%4d (%4d)\n" , si->ndirty_dent, si->ndirty_dirs, si->ndirty_all); -seq_printf (s," - datas: %4lld in files:%4d\n" , +seq_printf (s," - datas: %4d in files:%4d\n" , si->ndirty_data, si->ndirty_files); -seq_printf (s," - meta: %4lld in %4d\n" , +seq_printf (s," - meta: %4d in %4d\n" , si->ndirty_meta, si->meta_pages); -seq_printf (s," - imeta: %4lld\n" , +seq_printf (s," - imeta: %4d\n" , si->ndirty_imeta);seq_printf (s," - NATs: %9d/%9d\n - SITs: %9d/%9d\n" , si->dirty_nats, si->nats, si->dirty_sits, si->sits);
fs/f2fs/f2fs.h +6 -6
@@ -819,7 +819,7 @@ struct f2fs_sb_info {atomic_t nr_wb_bios;/* # of writeback bios */ /* # of pages, see count_type */ -struct percpu_counter nr_pages[NR_COUNT_TYPE ]; +atomic_t nr_pages[NR_COUNT_TYPE ];/* # of allocated blocks */ struct percpu_counter alloc_valid_block_count;
@@ -1233,7 +1233,7 @@ static inline void dec_valid_block_countstatic inline void inc_page_count (struct f2fs_sb_info *sbi,int count_type) { -percpu_counter_inc (&sbi->nr_pages[count_type]); +atomic_inc (&sbi->nr_pages[count_type]);if (count_type ==F2FS_DIRTY_DATA || count_type ==F2FS_INMEM_PAGES )return ;
@@ -1250,7 +1250,7 @@ static inline void inode_inc_dirty_pagesstatic inline void dec_page_count (struct f2fs_sb_info *sbi,int count_type) { -percpu_counter_dec (&sbi->nr_pages[count_type]); +atomic_dec (&sbi->nr_pages[count_type]); }static inline void inode_dec_dirty_pages (struct inode *inode)
@@ -1266,7 +1266,7 @@ static inline void inode_dec_dirty_pagesstatic inline s64 get_pages (struct f2fs_sb_info *sbi,int count_type) { -return percpu_counter_sum_positive (&sbi->nr_pages[count_type]); +return atomic_read (&sbi->nr_pages[count_type]); }static inline int get_dirty_pages (struct inode *inode)
@@ -2187,8 +2187,8 @@ struct f2fs_stat_info {unsigned long long hit_largest, hit_cached, hit_rbtree;unsigned long long hit_total, total_ext;int ext_tree, zombie_tree, ext_node; -s64 ndirty_node, ndirty_dent, ndirty_meta, ndirty_data, ndirty_imeta; -s64 inmem_pages; +int ndirty_node, ndirty_dent, ndirty_meta, ndirty_data, ndirty_imeta; +int inmem_pages;unsigned int ndirty_dirs, ndirty_files, ndirty_all;int nats, dirty_nats, sits, dirty_sits, fnids;int total_count, utilization;
fs/f2fs/super.c +5 -11
@@ -688,10 +688,6 @@ static void f2fs_destroy_inode(struct instatic void destroy_percpu_info (struct f2fs_sb_info *sbi) { -int i; - -for (i =0 ; i <NR_COUNT_TYPE ; i++) -percpu_counter_destroy (&sbi->nr_pages[i]);percpu_counter_destroy (&sbi->alloc_valid_block_count);percpu_counter_destroy (&sbi->total_valid_inode_count); }
@@ -1442,6 +1438,7 @@ int sanity_check_ckpt(struct f2fs_sb_infstatic void init_sb_info (struct f2fs_sb_info *sbi) {struct f2fs_super_block *raw_super = sbi->raw_super; +int i; sbi->log_sectors_per_block =le32_to_cpu (raw_super->log_sectors_per_block);
@@ -1466,6 +1463,9 @@ static void init_sb_info(struct f2fs_sb_ sbi->interval_time[REQ_TIME ] =DEF_IDLE_INTERVAL ;clear_sbi_flag (sbi,SBI_NEED_FSCK ); +for (i =0 ; i <NR_COUNT_TYPE ; i++) +atomic_set (&sbi->nr_pages[i],0 ); +INIT_LIST_HEAD (&sbi->s_list);mutex_init (&sbi->umount_mutex);mutex_init (&sbi->wio_mutex[NODE ]);
@@ -1481,13 +1481,7 @@ static void init_sb_info(struct f2fs_sb_static int init_percpu_info (struct f2fs_sb_info *sbi) { -int i, err; - -for (i =0 ; i <NR_COUNT_TYPE ; i++) { - err =percpu_counter_init (&sbi->nr_pages[i],0 ,GFP_KERNEL ); -if (err) -return err; - } +int err; err =percpu_counter_init (&sbi->alloc_valid_block_count,0 ,GFP_KERNEL );if (err)
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/f2fs-remove-percpu_count-due-to-performance-regression.patch queue-4.9/f2fs-hide-a-maybe-uninitialized-warning.patch