<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/fs/f2fs/segment.c, branch v3.10.5</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>f2fs: modify the number of issued pages to merge IOs</title>
<updated>2013-04-30T03:07:32+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk.kim@samsung.com</email>
</author>
<published>2013-04-29T07:58:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ac5d156c78a68b39955ee9b09498ba93831c77d7'/>
<id>ac5d156c78a68b39955ee9b09498ba93831c77d7</id>
<content type='text'>
When testing f2fs on an SSD, I found some 128 page IOs followed by 1 page IO
were issued by f2fs_write_node_pages.
This means that there were some mishandling flows which degrades performance.

Previous f2fs_write_node_pages determines the number of pages to be written,
nr_to_write, as follows.

1. The bio_get_nr_vecs returns 129 pages.
2. The bio_alloc makes a room for 128 pages.
3. The initial 128 pages go into one bio.
4. The existing bio is submitted, and a new bio is prepared for the last 1 page.
5. Finally, sync_node_pages submits the last 1 page bio.

The problem is from the use of bio_get_nr_vecs, so this patch replace it
with max_hw_blocks using queue_max_sectors.

Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When testing f2fs on an SSD, I found some 128 page IOs followed by 1 page IO
were issued by f2fs_write_node_pages.
This means that there were some mishandling flows which degrades performance.

Previous f2fs_write_node_pages determines the number of pages to be written,
nr_to_write, as follows.

1. The bio_get_nr_vecs returns 129 pages.
2. The bio_alloc makes a room for 128 pages.
3. The initial 128 pages go into one bio.
4. The existing bio is submitted, and a new bio is prepared for the last 1 page.
5. Finally, sync_node_pages submits the last 1 page bio.

The problem is from the use of bio_get_nr_vecs, so this patch replace it
with max_hw_blocks using queue_max_sectors.

Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: add REQ_META about metadata requests for submit</title>
<updated>2013-04-26T01:35:11+00:00</updated>
<author>
<name>Namjae Jeon</name>
<email>namjae.jeon@samsung.com</email>
</author>
<published>2013-04-25T02:45:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8680441caa5465a2cd87b6be857be4378df46700'/>
<id>8680441caa5465a2cd87b6be857be4378df46700</id>
<content type='text'>
Adding REQ_META for all the metadata requests can help in improving the
FS performance, if the underlying device supports TAGGING.
So, when considering the submit_bio path for all the f2fs requests. We can
add REQ_META for all the META requests.
As a precursor to this change we considered the commit
4265900e0be653f5b78baf2816857ef57cf1332f 'mmc: MMC-4.5 Data Tag Support'

Signed-off-by: Namjae Jeon &lt;namjae.jeon@samsung.com&gt;
Signed-off-by: Amit Sahrawat &lt;a.sahrawat@samsung.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adding REQ_META for all the metadata requests can help in improving the
FS performance, if the underlying device supports TAGGING.
So, when considering the submit_bio path for all the f2fs requests. We can
add REQ_META for all the META requests.
As a precursor to this change we considered the commit
4265900e0be653f5b78baf2816857ef57cf1332f 'mmc: MMC-4.5 Data Tag Support'

Signed-off-by: Namjae Jeon &lt;namjae.jeon@samsung.com&gt;
Signed-off-by: Amit Sahrawat &lt;a.sahrawat@samsung.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: add tracepoints for write page operations</title>
<updated>2013-04-23T09:15:17+00:00</updated>
<author>
<name>Namjae Jeon</name>
<email>namjae.jeon@samsung.com</email>
</author>
<published>2013-04-23T08:51:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6ec178dac6768204a6edf70f4a53d40b691c12b4'/>
<id>6ec178dac6768204a6edf70f4a53d40b691c12b4</id>
<content type='text'>
Add tracepoints to debug the various page write operation
like data pages, meta pages.

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: remove unnecessary tracepoints]
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add tracepoints to debug the various page write operation
like data pages, meta pages.

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: remove unnecessary tracepoints]
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: fix the bitmap consistency of dirty segments</title>
<updated>2013-04-03T08:27:51+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk.kim@samsung.com</email>
</author>
<published>2013-04-01T04:52:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b2f2c390c5612df97f0403e1ef1e4e41c24b7d4f'/>
<id>b2f2c390c5612df97f0403e1ef1e4e41c24b7d4f</id>
<content type='text'>
Like below, there are 8 segment bitmaps for SSR victim candidates.

enum dirty_type {
	DIRTY_HOT_DATA,		/* dirty segments assigned as hot data logs */
	DIRTY_WARM_DATA,	/* dirty segments assigned as warm data logs */
	DIRTY_COLD_DATA,	/* dirty segments assigned as cold data logs */
	DIRTY_HOT_NODE,		/* dirty segments assigned as hot node logs */
	DIRTY_WARM_NODE,	/* dirty segments assigned as warm node logs */
	DIRTY_COLD_NODE,	/* dirty segments assigned as cold node logs */
	DIRTY,			/* to count # of dirty segments */
	PRE,			/* to count # of entirely obsolete segments */
	NR_DIRTY_TYPE
};

The upper 6 bitmaps indicates segments dirtied by active log areas respectively.
And, the DIRTY bitmap integrates all the 6 bitmaps.

For example,
 o DIRTY_HOT_DATA : 1010000
 o DIRTY_WARM_DATA: 0100000
 o DIRTY_COLD_DATA: 0001000
 o DIRTY_HOT_NODE : 0000010
 o DIRTY_WARM_NODE: 0000001
 o DIRTY_COLD_NODE: 0000000
In this case,
 o DIRTY          : 1111011,

 which means that we should guarantee the consistency between DIRTY and other
 bitmaps concreately.

However, the SSR mode selects victims freely from any log types, which can set
multiple bits across the various bitmap types.

So, this patch eliminates this inconsistency.

Reviewed-by: Namjae Jeon &lt;namjae.jeon@samsung.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Like below, there are 8 segment bitmaps for SSR victim candidates.

enum dirty_type {
	DIRTY_HOT_DATA,		/* dirty segments assigned as hot data logs */
	DIRTY_WARM_DATA,	/* dirty segments assigned as warm data logs */
	DIRTY_COLD_DATA,	/* dirty segments assigned as cold data logs */
	DIRTY_HOT_NODE,		/* dirty segments assigned as hot node logs */
	DIRTY_WARM_NODE,	/* dirty segments assigned as warm node logs */
	DIRTY_COLD_NODE,	/* dirty segments assigned as cold node logs */
	DIRTY,			/* to count # of dirty segments */
	PRE,			/* to count # of entirely obsolete segments */
	NR_DIRTY_TYPE
};

The upper 6 bitmaps indicates segments dirtied by active log areas respectively.
And, the DIRTY bitmap integrates all the 6 bitmaps.

For example,
 o DIRTY_HOT_DATA : 1010000
 o DIRTY_WARM_DATA: 0100000
 o DIRTY_COLD_DATA: 0001000
 o DIRTY_HOT_NODE : 0000010
 o DIRTY_WARM_NODE: 0000001
 o DIRTY_COLD_NODE: 0000000
In this case,
 o DIRTY          : 1111011,

 which means that we should guarantee the consistency between DIRTY and other
 bitmaps concreately.

However, the SSR mode selects victims freely from any log types, which can set
multiple bits across the various bitmap types.

So, this patch eliminates this inconsistency.

Reviewed-by: Namjae Jeon &lt;namjae.jeon@samsung.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: allocate remained free segments in the LFS mode</title>
<updated>2013-04-03T08:27:50+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk.kim@samsung.com</email>
</author>
<published>2013-03-31T04:58:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=60374688a1a1cc8ef173d3dab42574719b851ac4'/>
<id>60374688a1a1cc8ef173d3dab42574719b851ac4</id>
<content type='text'>
This patch adds a new condition that allocates free segments in the current
active section even if SSR is needed.
Otherwise, f2fs cannot allocate remained free segments in the section since
SSR finds dirty segments only.

Reviewed-by: Namjae Jeon &lt;namjae.jeon@samsung.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds a new condition that allocates free segments in the current
active section even if SSR is needed.
Otherwise, f2fs cannot allocate remained free segments in the section since
SSR finds dirty segments only.

Reviewed-by: Namjae Jeon &lt;namjae.jeon@samsung.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: change GC bitmaps to apply the section granularity</title>
<updated>2013-04-03T08:27:49+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk.kim@samsung.com</email>
</author>
<published>2013-03-31T04:26:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5ec4e49f9bd753e2a6857a96e01f8ae5ff00b459'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: allocate new segment aligned with sections</title>
<updated>2013-04-03T08:27:49+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk.kim@samsung.com</email>
</author>
<published>2013-03-31T03:59:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=33afa7fde0defbb362328233e600e052d0a22cd5'/>
<id>33afa7fde0defbb362328233e600e052d0a22cd5</id>
<content type='text'>
When allocating a new segment under the LFS mode, we should keep the section
boundary.

Reviewed-by: Namjae Jeon &lt;namjae.jeon@samsung.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When allocating a new segment under the LFS mode, we should keep the section
boundary.

Reviewed-by: Namjae Jeon &lt;namjae.jeon@samsung.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: introduce TOTAL_SECS macro</title>
<updated>2013-04-03T07:23:10+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk.kim@samsung.com</email>
</author>
<published>2013-03-31T03:39:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=53cf95222fad7a962cc03fb61a33e37bcf4f5c9d'/>
<id>53cf95222fad7a962cc03fb61a33e37bcf4f5c9d</id>
<content type='text'>
Let's use a macro to get the total number of sections.

Reviewed-by: Namjae Jeon &lt;namjae.jeon@samsung.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Let's use a macro to get the total number of sections.

Reviewed-by: Namjae Jeon &lt;namjae.jeon@samsung.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: use kmemdup</title>
<updated>2013-03-31T00:12:18+00:00</updated>
<author>
<name>Alexandru Gheorghiu</name>
<email>gheorghiuandru@gmail.com</email>
</author>
<published>2013-03-28T00:24:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=79b5793be44d97c0a0e905c221858af08e5ebd85'/>
<id>79b5793be44d97c0a0e905c221858af08e5ebd85</id>
<content type='text'>
Use kmemdup instead of kzalloc and memcpy.

Signed-off-by: Alexandru Gheorghiu &lt;gheorghiuandru@gmail.com&gt;
Acked-by: Namjae Jeon &lt;namjae.jeon@samsung.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use kmemdup instead of kzalloc and memcpy.

Signed-off-by: Alexandru Gheorghiu &lt;gheorghiuandru@gmail.com&gt;
Acked-by: Namjae Jeon &lt;namjae.jeon@samsung.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: clarify and enhance the f2fs_gc flow</title>
<updated>2013-02-11T22:15:02+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk.kim@samsung.com</email>
</author>
<published>2013-02-04T06:11:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=437275272f9e635673f065300e5d95226a25cb06'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
</feed>
