Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1573541 > unrolled thread
| Started by | Jaegeuk Kim <jaegeuk@kernel.org> |
|---|---|
| First post | 2017-02-04 00:50 +0100 |
| Last post | 2017-02-04 00:50 +0100 |
| Articles | 3 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH 1/5] f2fs: show # of APPEND and UPDATE inodes Jaegeuk Kim <jaegeuk@kernel.org> - 2017-02-04 00:50 +0100
[PATCH 5/5] f2fs: avoid out-of-order execution of atomic writes Jaegeuk Kim <jaegeuk@kernel.org> - 2017-02-04 00:50 +0100
[PATCH 3/5] f2fs: move flush tracepoint Jaegeuk Kim <jaegeuk@kernel.org> - 2017-02-04 00:50 +0100
| From | Jaegeuk Kim <jaegeuk@kernel.org> |
|---|---|
| Date | 2017-02-04 00:50 +0100 |
| Subject | [PATCH 1/5] f2fs: show # of APPEND and UPDATE inodes |
| Message-ID | <t6VM5-g9-3@gated-at.bofh.it> |
This patch shows cached # of APPEND and UPDATE inode entries.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fs/f2fs/debug.c | 6 ++++--
fs/f2fs/f2fs.h | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c
index 0ca977a94c13..de8da9fc5c99 100644
--- a/fs/f2fs/debug.c
+++ b/fs/f2fs/debug.c
@@ -70,6 +70,8 @@ static void update_general_status(struct f2fs_sb_info *sbi)
si->inline_xattr = atomic_read(&sbi->inline_xattr);
si->inline_inode = atomic_read(&sbi->inline_inode);
si->inline_dir = atomic_read(&sbi->inline_dir);
+ si->append = sbi->im[APPEND_INO].ino_num;
+ si->update = sbi->im[UPDATE_INO].ino_num;
si->orphans = sbi->im[ORPHAN_INO].ino_num;
si->utilization = utilization(sbi);
@@ -264,8 +266,8 @@ static int stat_show(struct seq_file *s, void *v)
si->inline_inode);
seq_printf(s, " - Inline_dentry Inode: %u\n",
si->inline_dir);
- seq_printf(s, " - Orphan Inode: %u\n",
- si->orphans);
+ seq_printf(s, " - Orphan/Append/Update Inode: %u, %u, %u\n",
+ si->orphans, si->append, si->update);
seq_printf(s, "\nMain area: %d segs, %d secs %d zones\n",
si->main_area_segs, si->main_area_sections,
si->main_area_zones);
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index e97b4a0453d8..23b34d01e454 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -2293,7 +2293,7 @@ struct f2fs_stat_info {
int nats, dirty_nats, sits, dirty_sits, free_nids, alloc_nids;
int total_count, utilization;
int bg_gc, nr_wb_cp_data, nr_wb_data, nr_flush, nr_discard;
- int inline_xattr, inline_inode, inline_dir, orphans;
+ int inline_xattr, inline_inode, inline_dir, append, update, orphans;
int aw_cnt, max_aw_cnt;
unsigned int valid_count, valid_node_count, valid_inode_count, discard_blks;
unsigned int bimodal, avg_vblocks;
--
2.11.0
[toc] | [next] | [standalone]
| From | Jaegeuk Kim <jaegeuk@kernel.org> |
|---|---|
| Date | 2017-02-04 00:50 +0100 |
| Subject | [PATCH 5/5] f2fs: avoid out-of-order execution of atomic writes |
| Message-ID | <t6VM6-g9-13@gated-at.bofh.it> |
| In reply to | #1573541 |
We need to flush data writes before flushing last node block writes by using
FUA with PREFLUSH. We don't need to guarantee precedent node writes since if
those are not written, we can't reach to the last node block when scanning
node block chain during roll-forward recovery.
Afterwards f2fs_wait_on_page_writeback guarantees all the IO submission to
disk, which builds a valid node block chain.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fs/f2fs/file.c | 3 ++-
fs/f2fs/node.c | 10 +++++++---
include/trace/events/f2fs.h | 1 +
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 9c0f469cde13..a3808c49e326 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -278,7 +278,8 @@ static int f2fs_do_sync_file(struct file *file, loff_t start, loff_t end,
flush_out:
remove_ino_entry(sbi, ino, UPDATE_INO);
clear_inode_flag(inode, FI_UPDATE_WRITE);
- ret = f2fs_issue_flush(sbi);
+ if (!atomic)
+ ret = f2fs_issue_flush(sbi);
f2fs_update_time(sbi, REQ_TIME);
out:
trace_f2fs_sync_file_exit(inode, need_cp, datasync, ret);
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index f30cf1dec9a8..135a0233a201 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1318,7 +1318,7 @@ static struct page *last_fsync_dnode(struct f2fs_sb_info *sbi, nid_t ino)
return last_page;
}
-static int __write_node_page(struct page *page,
+static int __write_node_page(struct page *page, bool atomic,
struct writeback_control *wbc)
{
struct f2fs_sb_info *sbi = F2FS_P_SB(page);
@@ -1362,6 +1362,9 @@ static int __write_node_page(struct page *page,
return 0;
}
+ if (atomic)
+ fio.op_flags |= REQ_PREFLUSH | REQ_FUA;
+
set_page_writeback(page);
fio.old_blkaddr = ni.blk_addr;
write_node_page(nid, &fio);
@@ -1388,7 +1391,7 @@ static int __write_node_page(struct page *page,
static int f2fs_write_node_page(struct page *page,
struct writeback_control *wbc)
{
- return __write_node_page(page, wbc);
+ return __write_node_page(page, false, wbc);
}
int fsync_node_pages(struct f2fs_sb_info *sbi, struct inode *inode,
@@ -1470,7 +1473,8 @@ int fsync_node_pages(struct f2fs_sb_info *sbi, struct inode *inode,
if (!clear_page_dirty_for_io(page))
goto continue_unlock;
- ret = __write_node_page(page, wbc);
+ ret = __write_node_page(page, atomic &&
+ page == last_page, wbc);
if (ret) {
unlock_page(page);
f2fs_put_page(last_page, 0);
diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
index 04c527410ecc..82236792b50c 100644
--- a/include/trace/events/f2fs.h
+++ b/include/trace/events/f2fs.h
@@ -81,6 +81,7 @@ TRACE_DEFINE_ENUM(CP_DISCARD);
{ REQ_SYNC | REQ_PRIO, "(SP)" }, \
{ REQ_META, "(M)" }, \
{ REQ_META | REQ_PRIO, "(MP)" }, \
+ { REQ_SYNC | REQ_PREFLUSH , "(SF)" }, \
{ REQ_SYNC | REQ_META | REQ_PRIO, "(SMP)" }, \
{ REQ_PREFLUSH | REQ_META | REQ_PRIO, "(FMP)" }, \
{ 0, " \b" })
--
2.11.0
[toc] | [prev] | [next] | [standalone]
| From | Jaegeuk Kim <jaegeuk@kernel.org> |
|---|---|
| Date | 2017-02-04 00:50 +0100 |
| Subject | [PATCH 3/5] f2fs: move flush tracepoint |
| Message-ID | <t6VM6-g9-15@gated-at.bofh.it> |
| In reply to | #1573541 |
This patch moves the tracepoint location for flush command.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fs/f2fs/segment.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 984d94efe8cb..2c283a5fead0 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -429,6 +429,9 @@ static int submit_flush_wait(struct f2fs_sb_info *sbi)
int ret = __submit_flush_wait(sbi->sb->s_bdev);
int i;
+ trace_f2fs_issue_flush(sbi->sb, test_opt(sbi, NOBARRIER),
+ test_opt(sbi, FLUSH_MERGE));
+
if (sbi->s_ndevs && !ret) {
for (i = 1; i < sbi->s_ndevs; i++) {
ret = __submit_flush_wait(FDEV(i).bdev);
@@ -474,9 +477,6 @@ int f2fs_issue_flush(struct f2fs_sb_info *sbi)
struct flush_cmd_control *fcc = SM_I(sbi)->fcc_info;
struct flush_cmd cmd;
- trace_f2fs_issue_flush(sbi->sb, test_opt(sbi, NOBARRIER),
- test_opt(sbi, FLUSH_MERGE));
-
if (test_opt(sbi, NOBARRIER))
return 0;
--
2.11.0
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web