linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs: add block count by in-place-update in stat info
@ 2014-12-22 23:30 Changman Lee
  2014-12-23  7:03 ` [f2fs-dev] " Chao Yu
  0 siblings, 1 reply; 4+ messages in thread
From: Changman Lee @ 2014-12-22 23:30 UTC (permalink / raw)
  To: linux-fsdevel, linux-f2fs-devel; +Cc: Changman Lee

This patch adds block count by in-place-update in stat.

Signed-off-by: Changman Lee <cm224.lee@samsung.com>
---
 fs/f2fs/debug.c   | 3 +++
 fs/f2fs/f2fs.h    | 5 ++++-
 fs/f2fs/segment.c | 1 +
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c
index 91e8f69..46bef86 100644
--- a/fs/f2fs/debug.c
+++ b/fs/f2fs/debug.c
@@ -79,6 +79,8 @@ static void update_general_status(struct f2fs_sb_info *sbi)
 		si->segment_count[i] = sbi->segment_count[i];
 		si->block_count[i] = sbi->block_count[i];
 	}
+
+	si->inplace_count = sbi->inplace_count;
 }
 
 /*
@@ -277,6 +279,7 @@ static int stat_show(struct seq_file *s, void *v)
 		for (j = 0; j < si->util_free; j++)
 			seq_putc(s, '-');
 		seq_puts(s, "]\n\n");
+		seq_printf(s, "IPU: %u blocks\n", si->inplace_count);
 		seq_printf(s, "SSR: %u blocks in %u segments\n",
 			   si->block_count[SSR], si->segment_count[SSR]);
 		seq_printf(s, "LFS: %u blocks in %u segments\n",
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index ec58bb2..ae6dfb6 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -589,6 +589,7 @@ struct f2fs_sb_info {
 	struct f2fs_stat_info *stat_info;	/* FS status information */
 	unsigned int segment_count[2];		/* # of allocated segments */
 	unsigned int block_count[2];		/* # of allocated blocks */
+	unsigned int inplace_count;		/* # of inplace update */
 	int total_hit_ext, read_hit_ext;	/* extent cache hit ratio */
 	atomic_t inline_inode;			/* # of inline_data inodes */
 	atomic_t inline_dir;			/* # of inline_dentry inodes */
@@ -1514,6 +1515,7 @@ struct f2fs_stat_info {
 
 	unsigned int segment_count[2];
 	unsigned int block_count[2];
+	unsigned int inplace_count;
 	unsigned base_mem, cache_mem;
 };
 
@@ -1553,7 +1555,8 @@ static inline struct f2fs_stat_info *F2FS_STAT(struct f2fs_sb_info *sbi)
 		((sbi)->segment_count[(curseg)->alloc_type]++)
 #define stat_inc_block_count(sbi, curseg)				\
 		((sbi)->block_count[(curseg)->alloc_type]++)
-
+#define stat_inc_inplace_blocks(sbi)					\
+		((sbi)->inplace_count++)
 #define stat_inc_seg_count(sbi, type)					\
 	do {								\
 		struct f2fs_stat_info *si = F2FS_STAT(sbi);		\
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 42607a6..fd9bc96 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1235,6 +1235,7 @@ void write_data_page(struct page *page, struct dnode_of_data *dn,
 void rewrite_data_page(struct page *page, block_t old_blkaddr,
 					struct f2fs_io_info *fio)
 {
+	stat_inc_inplace_blocks(F2FS_P_SB(page));
 	f2fs_submit_page_mbio(F2FS_P_SB(page), page, old_blkaddr, fio);
 }
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [f2fs-dev] [PATCH] f2fs: add block count by in-place-update in stat info
  2014-12-22 23:30 [PATCH] f2fs: add block count by in-place-update in stat info Changman Lee
@ 2014-12-23  7:03 ` Chao Yu
  2014-12-23  8:22   ` [f2fs-dev] [PATCH v2] " Changman Lee
  0 siblings, 1 reply; 4+ messages in thread
From: Chao Yu @ 2014-12-23  7:03 UTC (permalink / raw)
  To: 'Changman Lee', linux-fsdevel, linux-f2fs-devel

Hi Changman,

> -----Original Message-----
> From: Changman Lee [mailto:cm224.lee@samsung.com]
> Sent: Tuesday, December 23, 2014 7:31 AM
> To: linux-fsdevel@vger.kernel.org; linux-f2fs-devel@lists.sourceforge.net
> Subject: [f2fs-dev] [PATCH] f2fs: add block count by in-place-update in stat info
> 
> This patch adds block count by in-place-update in stat.
> 
> Signed-off-by: Changman Lee <cm224.lee@samsung.com>
> ---
>  fs/f2fs/debug.c   | 3 +++
>  fs/f2fs/f2fs.h    | 5 ++++-
>  fs/f2fs/segment.c | 1 +
>  3 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c
> index 91e8f69..46bef86 100644
> --- a/fs/f2fs/debug.c
> +++ b/fs/f2fs/debug.c
> @@ -79,6 +79,8 @@ static void update_general_status(struct f2fs_sb_info *sbi)
>  		si->segment_count[i] = sbi->segment_count[i];
>  		si->block_count[i] = sbi->block_count[i];
>  	}
> +
> +	si->inplace_count = sbi->inplace_count;
>  }
> 
>  /*
> @@ -277,6 +279,7 @@ static int stat_show(struct seq_file *s, void *v)
>  		for (j = 0; j < si->util_free; j++)
>  			seq_putc(s, '-');
>  		seq_puts(s, "]\n\n");
> +		seq_printf(s, "IPU: %u blocks\n", si->inplace_count);
>  		seq_printf(s, "SSR: %u blocks in %u segments\n",
>  			   si->block_count[SSR], si->segment_count[SSR]);
>  		seq_printf(s, "LFS: %u blocks in %u segments\n",
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index ec58bb2..ae6dfb6 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -589,6 +589,7 @@ struct f2fs_sb_info {
>  	struct f2fs_stat_info *stat_info;	/* FS status information */
>  	unsigned int segment_count[2];		/* # of allocated segments */
>  	unsigned int block_count[2];		/* # of allocated blocks */
> +	unsigned int inplace_count;		/* # of inplace update */

Shouldn't we use atomic type for more accurate?

Thanks

>  	int total_hit_ext, read_hit_ext;	/* extent cache hit ratio */
>  	atomic_t inline_inode;			/* # of inline_data inodes */
>  	atomic_t inline_dir;			/* # of inline_dentry inodes */
> @@ -1514,6 +1515,7 @@ struct f2fs_stat_info {
> 
>  	unsigned int segment_count[2];
>  	unsigned int block_count[2];
> +	unsigned int inplace_count;
>  	unsigned base_mem, cache_mem;
>  };
> 
> @@ -1553,7 +1555,8 @@ static inline struct f2fs_stat_info *F2FS_STAT(struct f2fs_sb_info *sbi)
>  		((sbi)->segment_count[(curseg)->alloc_type]++)
>  #define stat_inc_block_count(sbi, curseg)				\
>  		((sbi)->block_count[(curseg)->alloc_type]++)
> -
> +#define stat_inc_inplace_blocks(sbi)					\
> +		((sbi)->inplace_count++)
>  #define stat_inc_seg_count(sbi, type)					\
>  	do {								\
>  		struct f2fs_stat_info *si = F2FS_STAT(sbi);		\
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index 42607a6..fd9bc96 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -1235,6 +1235,7 @@ void write_data_page(struct page *page, struct dnode_of_data *dn,
>  void rewrite_data_page(struct page *page, block_t old_blkaddr,
>  					struct f2fs_io_info *fio)
>  {
> +	stat_inc_inplace_blocks(F2FS_P_SB(page));
>  	f2fs_submit_page_mbio(F2FS_P_SB(page), page, old_blkaddr, fio);
>  }
> 
> --
> 1.9.1
> 
> 
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming! The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [f2fs-dev] [PATCH v2] f2fs: add block count by in-place-update in stat info
  2014-12-23  7:03 ` [f2fs-dev] " Chao Yu
@ 2014-12-23  8:22   ` Changman Lee
  2014-12-24  8:10     ` Chao Yu
  0 siblings, 1 reply; 4+ messages in thread
From: Changman Lee @ 2014-12-23  8:22 UTC (permalink / raw)
  To: Chao Yu; +Cc: linux-fsdevel, linux-f2fs-devel

Change from v1
 o use atomic_t inplace_count for more accurate suggested by Chao

-- >8 --

>From 7a42b27c8df45494e806d625be03830bfa8c30ff Mon Sep 17 00:00:00 2001
From: Changman Lee <cm224.lee@samsung.com>
Date: Wed, 24 Dec 2014 02:16:54 +0900
Subject: [PATCH] f2fs: add block count by in-place-update in stat info

This patch adds block count by in-place-update in stat.

Signed-off-by: Changman Lee <cm224.lee@samsung.com>
---
 fs/f2fs/debug.c   | 4 ++++
 fs/f2fs/f2fs.h    | 5 ++++-
 fs/f2fs/segment.c | 1 +
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c
index 91e8f69..2b64221 100644
--- a/fs/f2fs/debug.c
+++ b/fs/f2fs/debug.c
@@ -79,6 +79,8 @@ static void update_general_status(struct f2fs_sb_info *sbi)
 		si->segment_count[i] = sbi->segment_count[i];
 		si->block_count[i] = sbi->block_count[i];
 	}
+
+	si->inplace_count = atomic_read(&sbi->inplace_count);
 }
 
 /*
@@ -277,6 +279,7 @@ static int stat_show(struct seq_file *s, void *v)
 		for (j = 0; j < si->util_free; j++)
 			seq_putc(s, '-');
 		seq_puts(s, "]\n\n");
+		seq_printf(s, "IPU: %u blocks\n", si->inplace_count);
 		seq_printf(s, "SSR: %u blocks in %u segments\n",
 			   si->block_count[SSR], si->segment_count[SSR]);
 		seq_printf(s, "LFS: %u blocks in %u segments\n",
@@ -331,6 +334,7 @@ int f2fs_build_stats(struct f2fs_sb_info *sbi)
 
 	atomic_set(&sbi->inline_inode, 0);
 	atomic_set(&sbi->inline_dir, 0);
+	atomic_set(&sbi->inplace_count, 0);
 
 	mutex_lock(&f2fs_stat_mutex);
 	list_add_tail(&si->stat_list, &f2fs_stat_list);
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index ec58bb2..72d2aab 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -589,6 +589,7 @@ struct f2fs_sb_info {
 	struct f2fs_stat_info *stat_info;	/* FS status information */
 	unsigned int segment_count[2];		/* # of allocated segments */
 	unsigned int block_count[2];		/* # of allocated blocks */
+	atomic_t inplace_count;		/* # of inplace update */
 	int total_hit_ext, read_hit_ext;	/* extent cache hit ratio */
 	atomic_t inline_inode;			/* # of inline_data inodes */
 	atomic_t inline_dir;			/* # of inline_dentry inodes */
@@ -1514,6 +1515,7 @@ struct f2fs_stat_info {
 
 	unsigned int segment_count[2];
 	unsigned int block_count[2];
+	unsigned int inplace_count;
 	unsigned base_mem, cache_mem;
 };
 
@@ -1553,7 +1555,8 @@ static inline struct f2fs_stat_info *F2FS_STAT(struct f2fs_sb_info *sbi)
 		((sbi)->segment_count[(curseg)->alloc_type]++)
 #define stat_inc_block_count(sbi, curseg)				\
 		((sbi)->block_count[(curseg)->alloc_type]++)
-
+#define stat_inc_inplace_blocks(sbi)					\
+		(atomic_inc(&(sbi)->inplace_count))
 #define stat_inc_seg_count(sbi, type)					\
 	do {								\
 		struct f2fs_stat_info *si = F2FS_STAT(sbi);		\
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 42607a6..fd9bc96 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1235,6 +1235,7 @@ void write_data_page(struct page *page, struct dnode_of_data *dn,
 void rewrite_data_page(struct page *page, block_t old_blkaddr,
 					struct f2fs_io_info *fio)
 {
+	stat_inc_inplace_blocks(F2FS_P_SB(page));
 	f2fs_submit_page_mbio(F2FS_P_SB(page), page, old_blkaddr, fio);
 }
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [f2fs-dev] [PATCH v2] f2fs: add block count by in-place-update in stat info
  2014-12-23  8:22   ` [f2fs-dev] [PATCH v2] " Changman Lee
@ 2014-12-24  8:10     ` Chao Yu
  0 siblings, 0 replies; 4+ messages in thread
From: Chao Yu @ 2014-12-24  8:10 UTC (permalink / raw)
  To: 'Changman Lee'; +Cc: linux-fsdevel, linux-f2fs-devel

> -----Original Message-----
> From: Changman Lee [mailto:cm224.lee@samsung.com]
> Sent: Tuesday, December 23, 2014 4:23 PM
> To: Chao Yu
> Cc: linux-fsdevel@vger.kernel.org; linux-f2fs-devel@lists.sourceforge.net
> Subject: Re: [f2fs-dev] [PATCH v2] f2fs: add block count by in-place-update in stat info
> 
> Change from v1
>  o use atomic_t inplace_count for more accurate suggested by Chao

Reviewed-by: Chao Yu <chao2.yu@samsung.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-12-24  8:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-22 23:30 [PATCH] f2fs: add block count by in-place-update in stat info Changman Lee
2014-12-23  7:03 ` [f2fs-dev] " Chao Yu
2014-12-23  8:22   ` [f2fs-dev] [PATCH v2] " Changman Lee
2014-12-24  8:10     ` Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).