<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/fs/f2fs/debug.c, branch v3.10.2</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: remove useless #include &lt;linux/proc_fs.h&gt; as we're now using sysfs as debug entry.</title>
<updated>2013-04-30T03:07:32+00:00</updated>
<author>
<name>Haicheng Li</name>
<email>haicheng.li@linux.intel.com</email>
</author>
<published>2013-04-28T11:16:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b743ba78ae4c7c6a6e08e623af824b6208f58019'/>
<id>b743ba78ae4c7c6a6e08e623af824b6208f58019</id>
<content type='text'>
Signed-off-by: Haicheng Li &lt;haicheng.li@linux.intel.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>
Signed-off-by: Haicheng Li &lt;haicheng.li@linux.intel.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: 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: add device name in debugfs</title>
<updated>2013-02-11T22:15:01+00:00</updated>
<author>
<name>majianpeng</name>
<email>majianpeng@gmail.com</email>
</author>
<published>2013-02-01T07:00:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f83759e28372e593879f4dd20eb6c5ba6c4f393a'/>
<id>f83759e28372e593879f4dd20eb6c5ba6c4f393a</id>
<content type='text'>
In file status, it can't distinguish between different devices.
So add device name to do this function.

Signed-off-by: Jianpeng Ma &lt;majianpeng@gmail.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>
In file status, it can't distinguish between different devices.
So add device name to do this function.

Signed-off-by: Jianpeng Ma &lt;majianpeng@gmail.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: fix the debugfs entry creation path</title>
<updated>2013-01-15T11:19:15+00:00</updated>
<author>
<name>Namjae Jeon</name>
<email>linkinjeon@gmail.com</email>
</author>
<published>2013-01-15T10:58:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4589d25d015c2d02bb5f7075d0cbf6dcf23a33c0'/>
<id>4589d25d015c2d02bb5f7075d0cbf6dcf23a33c0</id>
<content type='text'>
As the "status" debugfs entry will be maintained for entire F2FS filesystem
irrespective of the number of partitions.
So, we can move the initialization to the init part of the f2fs and destroy will
be done from exit part. After making changes, for individual partition mount -
entry creation code will not be executed.

Signed-off-by: Jianpeng Ma &lt;majianpeng@gmail.com&gt;
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>
As the "status" debugfs entry will be maintained for entire F2FS filesystem
irrespective of the number of partitions.
So, we can move the initialization to the init part of the f2fs and destroy will
be done from exit part. After making changes, for individual partition mount -
entry creation code will not be executed.

Signed-off-by: Jianpeng Ma &lt;majianpeng@gmail.com&gt;
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 global mutex_lock to protect f2fs_stat_list</title>
<updated>2013-01-15T11:18:29+00:00</updated>
<author>
<name>majianpeng</name>
<email>majianpeng@gmail.com</email>
</author>
<published>2013-01-14T12:08:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=66af62ce7588736ae65edfdb1c0df597775c4d21'/>
<id>66af62ce7588736ae65edfdb1c0df597775c4d21</id>
<content type='text'>
There is an race condition between umounting f2fs and reading f2fs/status, which
results in oops.

Fox example:
Thread A			Thread B
umount f2fs 			cat f2fs/status

f2fs_destroy_stats() {		stat_show() {
				 list_for_each_entry_safe(&amp;f2fs_stat_list)
 list_del(&amp;si-&gt;stat_list);
 mutex_lock(&amp;si-&gt;stat_lock);
 si-&gt;sbi = NULL;
 mutex_unlock(&amp;si-&gt;stat_lock);
 kfree(sbi-&gt;stat_info);
} 				 mutex_lock(&amp;si-&gt;stat_lock) &lt;- si is gone.
				 ...
				}

Solution with a global lock: f2fs_stat_mutex:
Thread A			Thread B
umount f2fs 			cat f2fs/status

f2fs_destroy_stats() {		stat_show() {
 mutex_lock(&amp;f2fs_stat_mutex);
 list_del(&amp;si-&gt;stat_list);
 mutex_unlock(&amp;f2fs_stat_mutex);
 kfree(sbi-&gt;stat_info);		 mutex_lock(&amp;f2fs_stat_mutex);
}				 list_for_each_entry_safe(&amp;f2fs_stat_list)
				 ...
				 mutex_unlock(&amp;f2fs_stat_mutex);
				}

Signed-off-by: Jianpeng Ma &lt;majianpeng@gmail.com&gt;
[jaegeuk.kim@samsung.com: fix typos, description, and remove the existing lock]
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is an race condition between umounting f2fs and reading f2fs/status, which
results in oops.

Fox example:
Thread A			Thread B
umount f2fs 			cat f2fs/status

f2fs_destroy_stats() {		stat_show() {
				 list_for_each_entry_safe(&amp;f2fs_stat_list)
 list_del(&amp;si-&gt;stat_list);
 mutex_lock(&amp;si-&gt;stat_lock);
 si-&gt;sbi = NULL;
 mutex_unlock(&amp;si-&gt;stat_lock);
 kfree(sbi-&gt;stat_info);
} 				 mutex_lock(&amp;si-&gt;stat_lock) &lt;- si is gone.
				 ...
				}

Solution with a global lock: f2fs_stat_mutex:
Thread A			Thread B
umount f2fs 			cat f2fs/status

f2fs_destroy_stats() {		stat_show() {
 mutex_lock(&amp;f2fs_stat_mutex);
 list_del(&amp;si-&gt;stat_list);
 mutex_unlock(&amp;f2fs_stat_mutex);
 kfree(sbi-&gt;stat_info);		 mutex_lock(&amp;f2fs_stat_mutex);
}				 list_for_each_entry_safe(&amp;f2fs_stat_list)
				 ...
				 mutex_unlock(&amp;f2fs_stat_mutex);
				}

Signed-off-by: Jianpeng Ma &lt;majianpeng@gmail.com&gt;
[jaegeuk.kim@samsung.com: fix typos, description, and remove the existing lock]
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: update f2fs partition info about SIT/NAT layout</title>
<updated>2013-01-04T00:42:59+00:00</updated>
<author>
<name>Huajun Li</name>
<email>huajun.li.lee@gmail.com</email>
</author>
<published>2012-12-31T05:59:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7880ceedec55fbc3997d80e68670d03395225367'/>
<id>7880ceedec55fbc3997d80e68670d03395225367</id>
<content type='text'>
Update partition info output under debug FS to reflect segment layout correctly.

Signed-off-by: Huajun Li &lt;huajun.li.lee@gmail.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>
Update partition info output under debug FS to reflect segment layout correctly.

Signed-off-by: Huajun Li &lt;huajun.li.lee@gmail.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: adjust kernel coding style</title>
<updated>2012-12-11T04:43:42+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk.kim@samsung.com</email>
</author>
<published>2012-11-29T04:28:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0a8165d7c2cf1395059db20ab07665baf3758fcd'/>
<id>0a8165d7c2cf1395059db20ab07665baf3758fcd</id>
<content type='text'>
As pointed out by Randy Dunlap, this patch removes all usage of "/**" for comment
blocks. Instead, just use "/*".

Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As pointed out by Randy Dunlap, this patch removes all usage of "/**" for comment
blocks. Instead, just use "/*".

Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: fix endian conversion bugs reported by sparse</title>
<updated>2012-12-11T04:43:42+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk.kim@samsung.com</email>
</author>
<published>2012-11-28T07:12:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=25ca923b2a766b9c93b63777ead351137533a623'/>
<id>25ca923b2a766b9c93b63777ead351137533a623</id>
<content type='text'>
This patch should resolve the bugs reported by the sparse tool.
Initial reports were written by "kbuild test robot" managed by fengguang.wu.

In my local machines, I've tested also by running:
&gt; make C=2 CF="-D__CHECK_ENDIAN__"

Accordingly, I've found lots of warnings and bugs related to the endian
conversion. And I've fixed all at this moment.

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 should resolve the bugs reported by the sparse tool.
Initial reports were written by "kbuild test robot" managed by fengguang.wu.

In my local machines, I've tested also by running:
&gt; make C=2 CF="-D__CHECK_ENDIAN__"

Accordingly, I've found lots of warnings and bugs related to the endian
conversion. And I've fixed all at this moment.

Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: move proc files to debugfs</title>
<updated>2012-12-11T04:43:42+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2012-11-02T21:50:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=902829aa0b722511369e4e6193e66390bc58e0a2'/>
<id>902829aa0b722511369e4e6193e66390bc58e0a2</id>
<content type='text'>
This moves all of the f2fs debugging files into debugfs. The files are
located in /sys/kernel/debug/f2fs/

Note, I think we are generating all of the same information in each of
the files for every unique f2fs filesystem in the machine.  This copies
the functionality that was present in the proc files, but this should be
fixed up in the future.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
[jaegeuk.kim@samsung.com: merged 3 debugfs entries into a *status* entry]
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 moves all of the f2fs debugging files into debugfs. The files are
located in /sys/kernel/debug/f2fs/

Note, I think we are generating all of the same information in each of
the files for every unique f2fs filesystem in the machine.  This copies
the functionality that was present in the proc files, but this should be
fixed up in the future.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
[jaegeuk.kim@samsung.com: merged 3 debugfs entries into a *status* entry]
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
