Re: [f2fs-dev] [PATCH] fs/f2fs: add cond_resched() to sync_dirty_dir_inodes()

2015-03-03 Thread Sebastian Andrzej Siewior
On 03/03/2015 02:13 AM, Changman Lee wrote:

 Hi Sebastian,
Hi Jaegeuk,

 After this patch, your test is all done without any CPU stall, Right?

correct.

 IMHO, context should be switched without cond_resched() after consumed
 own time quota. So, it just reduces system latency due to yielding.
Correct but without preemption enabled there is no time quota. I still
have the 5sec printk but since the task schedules away I don't have a
problem anymore.

 I thought another way to discard pages of inode to be evicted in merged bio
 instead of submit. If so, evict() doesn't need to wait for writeback.
You are lucky that the workqueue code is aware of that. That means it
will schedule another worker if the current task schedules away because
it waits for something. Otherwise you would stall other worker.

If you could solve it in another way, that would be better than just
polling for it.

 Just my curiousity out of this problem.
 
 Thanks,

Sebastian

--
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


[f2fs-dev] [PATCH 1/3] f2fs: avoid to trigger writepage during POR

2015-03-03 Thread Jaegeuk Kim
This patch doesn't make any effect on previous behavior, since
f2fs_write_data_page bypasses writing the page during POR.

But, the difference is that this patch avoids holding writepages mutex.
This is to avoid the following false warning, since this can happen only
when mount and shutdown are triggered at the same time.

 ==
 [ INFO: possible circular locking dependency detected ]
 4.0.0-rc1+ #3 Tainted: G   O
 ---
 kworker/u8:0/2270 is trying to acquire lock:
  (sbi-gc_mutex){+.+.+.}, at: [a02bdd33] f2fs_balance_fs+0x73/0x90 
[f2fs]

 but task is already holding lock:
  (sbi-writepages){+.+...}, at: [a02b261b] 
f2fs_write_data_pages+0xcb/0x3a0 [f2fs]

 which lock already depends on the new lock.

 the existing dependency chain (in reverse order) is:

 - #2 (sbi-writepages){+.+...}:
[810e2b11] lock_acquire+0xe1/0x2f0
[8185e1b3] mutex_lock_nested+0x63/0x530
[a02b261b] f2fs_write_data_pages+0xcb/0x3a0 [f2fs]
[811c38c1] do_writepages+0x21/0x50
[8126c5a6] __writeback_single_inode+0x76/0xbf0
[8126e23a] writeback_single_inode+0xea/0x1c0
[8126e425] write_inode_now+0x95/0xa0
[81259dab] iput+0x20b/0x3f0
[a02c1c8b] recover_data.constprop.14+0x26b/0xa80 [f2fs]
[a02c2776] recover_fsync_data+0x2b6/0x5e0 [f2fs]
[a02a9744] f2fs_fill_super+0xb24/0xb90 [f2fs]
[8123d7f4] mount_bdev+0x1a4/0x1e0
[a02a3c85] f2fs_mount+0x15/0x20 [f2fs]
[8123e159] mount_fs+0x39/0x180
[8125e51b] vfs_kern_mount+0x6b/0x160
[81261554] do_mount+0x204/0xbe0
[8126223b] SyS_mount+0x8b/0xe0
[81863e6d] system_call_fastpath+0x16/0x1b

 - #1 (sbi-cp_mutex){+.+...}:
[810e2b11] lock_acquire+0xe1/0x2f0
[8185e1b3] mutex_lock_nested+0x63/0x530
[a02acbf2] write_checkpoint+0x42/0x1230 [f2fs]
[a02a847d] f2fs_sync_fs+0x9d/0x2a0 [f2fs]
[81272f82] sync_filesystem+0x82/0xb0
[8123c214] generic_shutdown_super+0x34/0x100
[8123c5f7] kill_block_super+0x27/0x70
[a02a3c60] kill_f2fs_super+0x20/0x30 [f2fs]
[8123ca49] deactivate_locked_super+0x49/0x80
[8123d05e] deactivate_super+0x4e/0x70
[8125df63] cleanup_mnt+0x43/0x90
[8125e002] __cleanup_mnt+0x12/0x20
[810a82e4] task_work_run+0xc4/0xf0
[8101f0bd] do_notify_resume+0x8d/0xa0
[81864141] int_signal+0x12/0x17

 - #0 (sbi-gc_mutex){+.+.+.}:
[810e2866] __lock_acquire+0x1ac6/0x1c90
[810e2b11] lock_acquire+0xe1/0x2f0
[8185e1b3] mutex_lock_nested+0x63/0x530
[a02bdd33] f2fs_balance_fs+0x73/0x90 [f2fs]
[a02b5938] f2fs_write_data_page+0x348/0x5b0 [f2fs]
[a02af9da] __f2fs_writepage+0x1a/0x50 [f2fs]
[811c1b54] write_cache_pages+0x274/0x6f0
[a02b2630] f2fs_write_data_pages+0xe0/0x3a0 [f2fs]
[811c38c1] do_writepages+0x21/0x50
[8126c5a6] __writeback_single_inode+0x76/0xbf0
[8126d44a] writeback_sb_inodes+0x32a/0x710
[8126d8cf] __writeback_inodes_wb+0x9f/0xd0
[8126dcdb] wb_writeback+0x3db/0x850
[8126e848] bdi_writeback_workfn+0x148/0x980
[810a3782] process_one_work+0x1e2/0x840
[810a3f01] worker_thread+0x121/0x460
[810a9dc8] kthread+0xf8/0x110
[81863dbc] ret_from_fork+0x7c/0xb0

Signed-off-by: Jaegeuk Kim jaeg...@kernel.org
---
 fs/f2fs/data.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 389fda7..0057d4b 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1408,6 +1408,10 @@ static int f2fs_write_data_pages(struct address_space 
*mapping,
available_free_memory(sbi, DIRTY_DENTS))
goto skip_write;
 
+   /* during POR, we don't need to trigger writepage at all. */
+   if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING)))
+   goto skip_write;
+
diff = nr_pages_to_write(sbi, DATA, wbc);
 
if (!S_ISDIR(inode-i_mode)) {
-- 
2.1.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/

[f2fs-dev] [PATCH 3/3] f2fs: report -ENOENT for unreached data indices

2015-03-03 Thread Jaegeuk Kim
If inode has inline_data, it should report -ENOENT when accessing out-of-bound
region.
This is used by f2fs_fiemap which treats -ENOENT with no error.

Signed-off-by: Jaegeuk Kim jaeg...@kernel.org
---
 fs/f2fs/node.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 35a9117..4687eae 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -501,7 +501,7 @@ int get_dnode_of_data(struct dnode_of_data *dn, pgoff_t 
index, int mode)
 
/* if inline_data is set, should not report any block indices */
if (f2fs_has_inline_data(dn-inode)  index) {
-   err = -EINVAL;
+   err = -ENOENT;
f2fs_put_page(npage[0], 1);
goto release_out;
}
-- 
2.1.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


[f2fs-dev] [PATCH 2/3] f2fs: clear append/update flags once fsync is done

2015-03-03 Thread Jaegeuk Kim
When fsync is done through checkpoint, previous f2fs missed to clear append
and update flag. This patch fixes to clear them.

This was originally catched by Changman Lee before.

Signed-off-by: Changman Lee cm224@samsung.com
Signed-off-by: Jaegeuk Kim jaeg...@kernel.org
---
 fs/f2fs/file.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 0deee3b..f1341c7 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -241,6 +241,8 @@ go_write:
 * will be used only for fsynced inodes after checkpoint.
 */
try_to_fix_pino(inode);
+   clear_inode_flag(fi, FI_APPEND_WRITE);
+   clear_inode_flag(fi, FI_UPDATE_WRITE);
goto out;
}
 sync_nodes:
-- 
2.1.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


[f2fs-dev] [PATCH] f2fs: relocate Kconfig from misc filesystems

2015-03-03 Thread Jaegeuk Kim
The f2fs has been shipped on many smartphone devices during a couple of years.
So, it is worth to relocate Kconfig into main page from misc filesystems for
developers to choose it more easily.

Signed-off-by: Jaegeuk Kim jaeg...@kernel.org
---
 fs/Kconfig  | 2 +-
 fs/f2fs/Kconfig | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/Kconfig b/fs/Kconfig
index ec35851..011f433 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -32,6 +32,7 @@ source fs/gfs2/Kconfig
 source fs/ocfs2/Kconfig
 source fs/btrfs/Kconfig
 source fs/nilfs2/Kconfig
+source fs/f2fs/Kconfig
 
 config FS_DAX
bool Direct Access (DAX) support
@@ -217,7 +218,6 @@ source fs/pstore/Kconfig
 source fs/sysv/Kconfig
 source fs/ufs/Kconfig
 source fs/exofs/Kconfig
-source fs/f2fs/Kconfig
 
 endif # MISC_FILESYSTEMS
 
diff --git a/fs/f2fs/Kconfig b/fs/f2fs/Kconfig
index 94e2d2f..05f0f66 100644
--- a/fs/f2fs/Kconfig
+++ b/fs/f2fs/Kconfig
@@ -1,5 +1,5 @@
 config F2FS_FS
-   tristate F2FS filesystem support (EXPERIMENTAL)
+   tristate F2FS filesystem support
depends on BLOCK
help
  F2FS is based on Log-structured File System (LFS), which supports
-- 
2.1.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