<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/f2fs/checkpoint.c, branch linux-3.10.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.10.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.10.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2013-04-29T02:19:32Z</updated>
<entry>
<title>f2fs: check truncation of mapping after lock_page</title>
<updated>2013-04-29T02:19:32Z</updated>
<author>
<name>Jaegeuk Kim</name>
</author>
<published>2013-04-26T02:55:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=afcb7ca01f47b0481e0b248d1542d0934fa70767'/>
<id>urn:sha1:afcb7ca01f47b0481e0b248d1542d0934fa70767</id>
<content type='text'>
We call lock_page when we need to update a page after readpage.
Between grab and lock page, the page can be truncated by other thread.
So, we should check the page after lock_page whether it was truncated or not.

Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</content>
</entry>
<entry>
<title>f2fs: give a chance to merge IOs by IO scheduler</title>
<updated>2013-04-26T01:35:10Z</updated>
<author>
<name>Jaegeuk Kim</name>
</author>
<published>2013-04-24T04:19:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c718379b6b0954a04a153d7e5dc8b3136a301ee6'/>
<id>urn:sha1:c718379b6b0954a04a153d7e5dc8b3136a301ee6</id>
<content type='text'>
Previously, background GC submits many 4KB read requests to load victim blocks
and/or its (i)node blocks.

...
f2fs_gc : f2fs_readpage: ino = 1, page_index = 0xb61, blkaddr = 0x3b964ed
f2fs_gc : block_rq_complete: 8,16 R () 499854968 + 8 [0]
f2fs_gc : f2fs_readpage: ino = 1, page_index = 0xb6f, blkaddr = 0x3b964ee
f2fs_gc : block_rq_complete: 8,16 R () 499854976 + 8 [0]
f2fs_gc : f2fs_readpage: ino = 1, page_index = 0xb79, blkaddr = 0x3b964ef
f2fs_gc : block_rq_complete: 8,16 R () 499854984 + 8 [0]
...

However, by the fact that many IOs are sequential, we can give a chance to merge
the IOs by IO scheduler.
In order to do that, let's use blk_plug.

...
f2fs_gc : f2fs_iget: ino = 143
f2fs_gc : f2fs_readpage: ino = 143, page_index = 0x1c6, blkaddr = 0x2e6ee
f2fs_gc : f2fs_iget: ino = 143
f2fs_gc : f2fs_readpage: ino = 143, page_index = 0x1c7, blkaddr = 0x2e6ef
&lt;idle&gt; : block_rq_complete: 8,16 R () 1519616 + 8 [0]
&lt;idle&gt; : block_rq_complete: 8,16 R () 1519848 + 8 [0]
&lt;idle&gt; : block_rq_complete: 8,16 R () 1520432 + 96 [0]
&lt;idle&gt; : block_rq_complete: 8,16 R () 1520536 + 104 [0]
&lt;idle&gt; : block_rq_complete: 8,16 R () 1521008 + 112 [0]
&lt;idle&gt; : block_rq_complete: 8,16 R () 1521440 + 152 [0]
&lt;idle&gt; : block_rq_complete: 8,16 R () 1521688 + 144 [0]
&lt;idle&gt; : block_rq_complete: 8,16 R () 1522128 + 192 [0]
&lt;idle&gt; : block_rq_complete: 8,16 R () 1523256 + 328 [0]
...

Note that this issue should be addressed in checkpoint, and some readahead
flows too.

Reviewed-by: Namjae Jeon &lt;namjae.jeon@samsung.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</content>
</entry>
<entry>
<title>f2fs: add tracepoints to debug checkpoint request</title>
<updated>2013-04-23T10:16:37Z</updated>
<author>
<name>Namjae Jeon</name>
</author>
<published>2013-04-23T09:26:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2af4bd6ca556d690ee166200abd16fdbe749782e'/>
<id>urn:sha1:2af4bd6ca556d690ee166200abd16fdbe749782e</id>
<content type='text'>
Add tracepoints to debug checkpoint request.

Signed-off-by: Namjae Jeon &lt;namjae.jeon@samsung.com&gt;
Signed-off-by: Pankaj Kumar &lt;pankaj.km@samsung.com&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
[Jaegeuk: change expressions]
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</content>
</entry>
<entry>
<title>f2fs: introduce a new global lock scheme</title>
<updated>2013-04-09T09:21:18Z</updated>
<author>
<name>Jaegeuk Kim</name>
</author>
<published>2012-11-22T07:21:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=399368372ed9f3c396eadb5c2bbc98be8c774a39'/>
<id>urn:sha1:399368372ed9f3c396eadb5c2bbc98be8c774a39</id>
<content type='text'>
In the previous version, f2fs uses global locks according to the usage types,
such as directory operations, block allocation, block write, and so on.

Reference the following lock types in f2fs.h.
enum lock_type {
	RENAME,		/* for renaming operations */
	DENTRY_OPS,	/* for directory operations */
	DATA_WRITE,	/* for data write */
	DATA_NEW,	/* for data allocation */
	DATA_TRUNC,	/* for data truncate */
	NODE_NEW,	/* for node allocation */
	NODE_TRUNC,	/* for node truncate */
	NODE_WRITE,	/* for node write */
	NR_LOCK_TYPE,
};

In that case, we lose the performance under the multi-threading environment,
since every types of operations must be conducted one at a time.

In order to address the problem, let's share the locks globally with a mutex
array regardless of any types.
So, let users grab a mutex and perform their jobs in parallel as much as
possbile.

For this, I propose a new global lock scheme as follows.

0. Data structure
 - f2fs_sb_info -&gt; mutex_lock[NR_GLOBAL_LOCKS]
 - f2fs_sb_info -&gt; node_write

1. mutex_lock_op(sbi)
 - try to get an avaiable lock from the array.
 - returns the index of the gottern lock variable.

2. mutex_unlock_op(sbi, index of the lock)
 - unlock the given index of the lock.

3. mutex_lock_all(sbi)
 - grab all the locks in the array before the checkpoint.

4. mutex_unlock_all(sbi)
 - release all the locks in the array after checkpoint.

5. block_operations()
 - call mutex_lock_all()
 - sync_dirty_dir_inodes()
 - grab node_write
 - sync_node_pages()

Note that,
 the pairs of mutex_lock_op()/mutex_unlock_op() and
 mutex_lock_all()/mutex_unlock_all() should be used together.

Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</content>
</entry>
<entry>
<title>f2fs: change GC bitmaps to apply the section granularity</title>
<updated>2013-04-03T08:27:49Z</updated>
<author>
<name>Jaegeuk Kim</name>
</author>
<published>2013-03-31T04:26:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5ec4e49f9bd753e2a6857a96e01f8ae5ff00b459'/>
<id>urn:sha1:5ec4e49f9bd753e2a6857a96e01f8ae5ff00b459</id>
<content type='text'>
This patch removes a bitmap for victim segments selected by foreground GC, and
modifies the other bitmap for victim segments selected by background GC.

1) foreground GC bitmap
 : We don't need to manage this, since we just only one previous victim section
   number instead of the whole victim history.
   The f2fs uses the victim section number in order not to allocate currently
   GC'ed section to current active logs.

2) background GC bitmap
 : This bitmap is used to avoid selecting victims repeatedly by background GCs.
   In addition, the victims are able to be selected by foreground GCs, since
   there is no need to read victim blocks during foreground GCs.

   By the fact that the foreground GC reclaims segments in a section unit, it'd
   be better to manage this bitmap based on the section granularity.

Reviewed-by: Namjae Jeon &lt;namjae.jeon@samsung.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</content>
</entry>
<entry>
<title>f2fs: reduce unncessary locking pages during read</title>
<updated>2013-03-20T09:30:06Z</updated>
<author>
<name>Jaegeuk Kim</name>
</author>
<published>2013-03-08T12:29:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=393ff91f57c87d48ffed30878be6e3e486d3a00a'/>
<id>urn:sha1:393ff91f57c87d48ffed30878be6e3e486d3a00a</id>
<content type='text'>
This patch reduces redundant locking and unlocking pages during read operations.
In f2fs_readpage, let's use wait_on_page_locked() instead of lock_page.
And then, when we need to modify any data finally, let's lock the page so that
we can avoid lock contention.

[readpage rule]
- The f2fs_readpage returns unlocked page, or released page too in error cases.
- Its caller should handle read error, -EIO, after locking the page, which
  indicates read completion.
- Its caller should check PageUptodate after grab_cache_page.

Signed-off-by: Changman Lee &lt;cm224.lee@samsung.com&gt;
Reviewed-by: Namjae Jeon &lt;namjae.jeon@samsung.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</content>
</entry>
<entry>
<title>f2fs: clarify and enhance the f2fs_gc flow</title>
<updated>2013-02-11T22:15:02Z</updated>
<author>
<name>Jaegeuk Kim</name>
</author>
<published>2013-02-04T06:11:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=437275272f9e635673f065300e5d95226a25cb06'/>
<id>urn:sha1:437275272f9e635673f065300e5d95226a25cb06</id>
<content type='text'>
This patch makes clearer the ambiguous f2fs_gc flow as follows.

1. Remove intermediate checkpoint condition during f2fs_gc
 (i.e., should_do_checkpoint() and GC_BLOCKED)

2. Remove unnecessary return values of f2fs_gc because of #1.
 (i.e., GC_NODE, GC_OK, etc)

3. Simplify write_checkpoint() because of #2.

4. Clarify the main f2fs_gc flow.
 o monitor how many freed sections during one iteration of do_garbage_collect().
 o do GC more without checkpoints if we can't get enough free sections.
 o do checkpoint once we've got enough free sections through forground GCs.

5. Adopt thread-logging (Slack-Space-Recycle) scheme more aggressively on data
  log types. See. get_ssr_segement()

Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</content>
</entry>
<entry>
<title>f2fs: remove repeated F2FS_SET_SB_DIRT call</title>
<updated>2013-02-11T22:15:01Z</updated>
<author>
<name>Changman Lee</name>
</author>
<published>2013-02-01T09:05:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=94787d91cba7ba168b028703b50a0224702ace9c'/>
<id>urn:sha1:94787d91cba7ba168b028703b50a0224702ace9c</id>
<content type='text'>
F2FS_SET_SB_DIRT is called in inc_page_count and
it is directly called one more time in the next line.

Signed-off-by: Changman Lee &lt;cm224.lee@samsung.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</content>
</entry>
<entry>
<title>f2fs: clean up the add_orphan_inode func</title>
<updated>2013-02-11T22:15:00Z</updated>
<author>
<name>majianpeng</name>
</author>
<published>2013-01-29T08:19:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a2617dc6863b21a8109c199ab533b3dbfe178f27'/>
<id>urn:sha1:a2617dc6863b21a8109c199ab533b3dbfe178f27</id>
<content type='text'>
For the code
&gt; prev = list_entry(orphan-&gt;list.prev, typeof(*prev), list);
if orphan-&gt;list.prev == head, it can't get the right prev.
And we can use the parameter 'this' to add.

Signed-off-by: Jianpeng Ma &lt;majianpeng@gmail.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</content>
</entry>
<entry>
<title>f2fs: prevent checkpoint once any IO failure is detected</title>
<updated>2013-02-11T22:15:00Z</updated>
<author>
<name>Jaegeuk Kim</name>
</author>
<published>2013-01-24T10:56:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=577e349514452fa3fcd99fd06e587b02d3d1cf28'/>
<id>urn:sha1:577e349514452fa3fcd99fd06e587b02d3d1cf28</id>
<content type='text'>
This patch enhances the checkpoint routine to cope with IO errors.

Basically f2fs detects IO errors from end_io_write, and the errors are able to
be occurred during one of data, node, and meta page writes.

In the previous code, when an IO error is occurred during writes, f2fs sets a
flag, CP_ERROR_FLAG, in the raw ckeckpoint buffer which will be written to disk.
Afterwards, write_checkpoint() will check the flag and remount f2fs as a
read-only (ro) mode.

However, even once f2fs is remounted as a ro mode, dirty checkpoint pages are
freely able to be written to disk by flusher or kswapd in background.
In such a case, after cold reboot, f2fs would restore the checkpoint data having
CP_ERROR_FLAG, resulting in disabling write_checkpoint and remounting f2fs as
a ro mode again.

Therefore, let's prevent any checkpoint page (meta) writes once an IO error is
occurred, and remount f2fs as a ro mode right away at that moment.

Reported-by: Oliver Winker &lt;oliver@oli1170.net&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
Reviewed-by: Namjae Jeon &lt;namjae.jeon@samsung.com&gt;
</content>
</entry>
</feed>
