<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/fs/btrfs/delayed-inode.h, branch v3.17-rc2</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>Btrfs: introduce the delayed inode ref deletion for the single link inode</title>
<updated>2014-01-28T21:20:09+00:00</updated>
<author>
<name>Miao Xie</name>
<email>miaox@cn.fujitsu.com</email>
</author>
<published>2013-12-26T05:07:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=67de11769bd5ec339a62169f500b04f304826c00'/>
<id>67de11769bd5ec339a62169f500b04f304826c00</id>
<content type='text'>
The inode reference item is close to inode item, so we insert it simultaneously
with the inode item insertion when we create a file/directory.. In fact, we also
can handle the inode reference deletion by the same way. So we made this patch to
introduce the delayed inode reference deletion for the single link inode(At most
case, the file doesn't has hard link, so we don't take the hard link into account).

This function is based on the delayed inode mechanism. After applying this patch,
we can reduce the time of the file/directory deletion by ~10%.

Signed-off-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The inode reference item is close to inode item, so we insert it simultaneously
with the inode item insertion when we create a file/directory.. In fact, we also
can handle the inode reference deletion by the same way. So we made this patch to
introduce the delayed inode reference deletion for the single link inode(At most
case, the file doesn't has hard link, so we don't take the hard link into account).

This function is based on the delayed inode mechanism. After applying this patch,
we can reduce the time of the file/directory deletion by ~10%.

Signed-off-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: use flags instead of the bool variants in delayed node</title>
<updated>2014-01-28T21:20:08+00:00</updated>
<author>
<name>Miao Xie</name>
<email>miaox@cn.fujitsu.com</email>
</author>
<published>2013-12-26T05:07:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7cf35d91b4f143b5c7529976bf5e7573a07051cd'/>
<id>7cf35d91b4f143b5c7529976bf5e7573a07051cd</id>
<content type='text'>
Signed-off-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[readdir] convert btrfs</title>
<updated>2013-06-29T08:57:00+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2013-05-22T20:48:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9cdda8d31ffb87ba688f91104be200e2a96a38cd'/>
<id>9cdda8d31ffb87ba688f91104be200e2a96a38cd</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: improve the delayed inode throttling</title>
<updated>2013-03-07T12:52:40+00:00</updated>
<author>
<name>Chris Mason</name>
<email>chris.mason@fusionio.com</email>
</author>
<published>2013-03-04T22:13:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=de3cb945db4d8eb3b046dc7a5ea89a893372750c'/>
<id>de3cb945db4d8eb3b046dc7a5ea89a893372750c</id>
<content type='text'>
The delayed inode code batches up changes to the btree in hopes of doing
them in bulk.  As the changes build up, processes kick off worker
threads and wait for them to make progress.

The current code kicks off an async work queue item for each delayed
node, which creates a lot of churn.  It also uses a fixed 1 HZ waiting
period for the throttle, which allows us to build a lot of pending
work and can slow down the commit.

This changes us to watch a sequence counter as it is bumped during the
operations.  We kick off fewer work items and have each work item do
more work.

Signed-off-by: Chris Mason &lt;chris.mason@fusionio.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The delayed inode code batches up changes to the btree in hopes of doing
them in bulk.  As the changes build up, processes kick off worker
threads and wait for them to make progress.

The current code kicks off an async work queue item for each delayed
node, which creates a lot of churn.  It also uses a fixed 1 HZ waiting
period for the throttle, which allows us to build a lot of pending
work and can slow down the commit.

This changes us to watch a sequence counter as it is bumped during the
operations.  We kick off fewer work items and have each work item do
more work.

Signed-off-by: Chris Mason &lt;chris.mason@fusionio.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: fix lots of orphan inodes when the space is not enough</title>
<updated>2013-02-20T14:36:39+00:00</updated>
<author>
<name>Miao Xie</name>
<email>miaox@cn.fujitsu.com</email>
</author>
<published>2012-12-19T06:59:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0e8c36a9fd8169a8b96c2ddc8446894bcd07b6b1'/>
<id>0e8c36a9fd8169a8b96c2ddc8446894bcd07b6b1</id>
<content type='text'>
We're running into having 50-100 orphans left over with xfstests 83
because of ENOSPC when trying to start the transaction for the inode update.
But in fact, it makes no sense in updating the inode for the new size while
we're deleting the stupid thing. This patch fixes this problem.

Reported-by: Josef Bacik &lt;jbacik@fusionio.com&gt;
Signed-off-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Signed-off-by: Josef Bacik &lt;jbacik@fusionio.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We're running into having 50-100 orphans left over with xfstests 83
because of ENOSPC when trying to start the transaction for the inode update.
But in fact, it makes no sense in updating the inode for the new size while
we're deleting the stupid thing. This patch fixes this problem.

Reported-by: Josef Bacik &lt;jbacik@fusionio.com&gt;
Signed-off-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Signed-off-by: Josef Bacik &lt;jbacik@fusionio.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: flush delayed inodes if we're short on space</title>
<updated>2012-07-23T19:41:40+00:00</updated>
<author>
<name>Josef Bacik</name>
<email>jbacik@fusionio.com</email>
</author>
<published>2012-06-21T18:05:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=96c3f4331a8c1cd0a58307e4ac7e73e09d7dab23'/>
<id>96c3f4331a8c1cd0a58307e4ac7e73e09d7dab23</id>
<content type='text'>
Those crazy gentoo guys have been complaining about ENOSPC errors on their
portage volumes.  This is because doing things like untar tends to create
lots of new files which will soak up all the reservation space in the
delayed inodes.  Usually this gets papered over by the fact that we will try
and commit the transaction, however if this happens in the wrong spot or we
choose not to commit the transaction you will be screwed.  So add the
ability to expclitly flush delayed inodes to free up space.  Please test
this out guys to make sure it works since as usual I cannot reproduce.
Thanks,

Signed-off-by: Josef Bacik &lt;jbacik@fusionio.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Those crazy gentoo guys have been complaining about ENOSPC errors on their
portage volumes.  This is because doing things like untar tends to create
lots of new files which will soak up all the reservation space in the
delayed inodes.  Usually this gets papered over by the fact that we will try
and commit the transaction, however if this happens in the wrong spot or we
choose not to commit the transaction you will be screwed.  So add the
ability to expclitly flush delayed inodes to free up space.  Please test
this out guys to make sure it works since as usual I cannot reproduce.
Thanks,

Signed-off-by: Josef Bacik &lt;jbacik@fusionio.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: destroy the items of the delayed inodes in error handling routine</title>
<updated>2012-06-15T15:42:28+00:00</updated>
<author>
<name>Miao Xie</name>
<email>miaox@cn.fujitsu.com</email>
</author>
<published>2012-06-14T08:23:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=67cde3448d951b55088a6ea3bb1aee0160068fb9'/>
<id>67cde3448d951b55088a6ea3bb1aee0160068fb9</id>
<content type='text'>
the items of the delayed inodes were forgotten to be freed, this patch
fixes it.

Signed-off-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@fusionio.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
the items of the delayed inodes were forgotten to be freed, this patch
fixes it.

Signed-off-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@fusionio.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>atomic: use &lt;linux/atomic.h&gt;</title>
<updated>2011-07-26T23:49:47+00:00</updated>
<author>
<name>Arun Sharma</name>
<email>asharma@fb.com</email>
</author>
<published>2011-07-26T23:09:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=60063497a95e716c9a689af3be2687d261f115b4'/>
<id>60063497a95e716c9a689af3be2687d261f115b4</id>
<content type='text'>
This allows us to move duplicated code in &lt;asm/atomic.h&gt;
(atomic_inc_not_zero() for now) to &lt;linux/atomic.h&gt;

Signed-off-by: Arun Sharma &lt;asharma@fb.com&gt;
Reviewed-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: David Miller &lt;davem@davemloft.net&gt;
Cc: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Acked-by: Mike Frysinger &lt;vapier@gentoo.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows us to move duplicated code in &lt;asm/atomic.h&gt;
(atomic_inc_not_zero() for now) to &lt;linux/atomic.h&gt;

Signed-off-by: Arun Sharma &lt;asharma@fb.com&gt;
Reviewed-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: David Miller &lt;davem@davemloft.net&gt;
Cc: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Acked-by: Mike Frysinger &lt;vapier@gentoo.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>btrfs: fix inconsonant inode information</title>
<updated>2011-06-27T15:34:27+00:00</updated>
<author>
<name>Miao Xie</name>
<email>miaox@cn.fujitsu.com</email>
</author>
<published>2011-06-23T07:27:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2f7e33d432d097a2a7f467b031bf18be91cb3d49'/>
<id>2f7e33d432d097a2a7f467b031bf18be91cb3d49</id>
<content type='text'>
When iputting the inode, We may leave the delayed nodes if they have some
delayed items that have not been dealt with. So when the inode is read again,
we must look up the relative delayed node, and use the information in it to
initialize the inode. Or we will get inconsonant inode information, it may
cause that the same directory index number is allocated again, and hit the
following oops:

[ 5447.554187] err add delayed dir index item(name: pglog_0.965_0) into the
insertion tree of the delayed node(root id: 262, inode id: 258, errno: -17)
[ 5447.569766] ------------[ cut here ]------------
[ 5447.575361] kernel BUG at fs/btrfs/delayed-inode.c:1301!
[SNIP]
[ 5447.790721] Call Trace:
[ 5447.793191]  [&lt;ffffffffa0641c4e&gt;] btrfs_insert_dir_item+0x189/0x1bb [btrfs]
[ 5447.800156]  [&lt;ffffffffa0651a45&gt;] btrfs_add_link+0x12b/0x191 [btrfs]
[ 5447.806517]  [&lt;ffffffffa0651adc&gt;] btrfs_add_nondir+0x31/0x58 [btrfs]
[ 5447.812876]  [&lt;ffffffffa0651d6a&gt;] btrfs_create+0xf9/0x197 [btrfs]
[ 5447.818961]  [&lt;ffffffff8111f840&gt;] vfs_create+0x72/0x92
[ 5447.824090]  [&lt;ffffffff8111fa8c&gt;] do_last+0x22c/0x40b
[ 5447.829133]  [&lt;ffffffff8112076a&gt;] path_openat+0xc0/0x2ef
[ 5447.834438]  [&lt;ffffffff810c58e2&gt;] ? __perf_event_task_sched_out+0x24/0x44
[ 5447.841216]  [&lt;ffffffff8103ecdd&gt;] ? perf_event_task_sched_out+0x59/0x67
[ 5447.847846]  [&lt;ffffffff81121a79&gt;] do_filp_open+0x3d/0x87
[ 5447.853156]  [&lt;ffffffff811e126c&gt;] ? strncpy_from_user+0x43/0x4d
[ 5447.859072]  [&lt;ffffffff8111f1f5&gt;] ? getname_flags+0x2e/0x80
[ 5447.864636]  [&lt;ffffffff8111f179&gt;] ? do_getname+0x14b/0x173
[ 5447.870112]  [&lt;ffffffff8111f1b7&gt;] ? audit_getname+0x16/0x26
[ 5447.875682]  [&lt;ffffffff8112b1ab&gt;] ? spin_lock+0xe/0x10
[ 5447.880882]  [&lt;ffffffff81112d39&gt;] do_sys_open+0x69/0xae
[ 5447.886153]  [&lt;ffffffff81112db1&gt;] sys_open+0x20/0x22
[ 5447.891114]  [&lt;ffffffff813b9aab&gt;] system_call_fastpath+0x16/0x1b

Fix it by reusing the old delayed node.

Reported-by: Jim Schutt &lt;jaschut@sandia.gov&gt;
Signed-off-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Tested-by: Jim Schutt &lt;jaschut@sandia.gov&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When iputting the inode, We may leave the delayed nodes if they have some
delayed items that have not been dealt with. So when the inode is read again,
we must look up the relative delayed node, and use the information in it to
initialize the inode. Or we will get inconsonant inode information, it may
cause that the same directory index number is allocated again, and hit the
following oops:

[ 5447.554187] err add delayed dir index item(name: pglog_0.965_0) into the
insertion tree of the delayed node(root id: 262, inode id: 258, errno: -17)
[ 5447.569766] ------------[ cut here ]------------
[ 5447.575361] kernel BUG at fs/btrfs/delayed-inode.c:1301!
[SNIP]
[ 5447.790721] Call Trace:
[ 5447.793191]  [&lt;ffffffffa0641c4e&gt;] btrfs_insert_dir_item+0x189/0x1bb [btrfs]
[ 5447.800156]  [&lt;ffffffffa0651a45&gt;] btrfs_add_link+0x12b/0x191 [btrfs]
[ 5447.806517]  [&lt;ffffffffa0651adc&gt;] btrfs_add_nondir+0x31/0x58 [btrfs]
[ 5447.812876]  [&lt;ffffffffa0651d6a&gt;] btrfs_create+0xf9/0x197 [btrfs]
[ 5447.818961]  [&lt;ffffffff8111f840&gt;] vfs_create+0x72/0x92
[ 5447.824090]  [&lt;ffffffff8111fa8c&gt;] do_last+0x22c/0x40b
[ 5447.829133]  [&lt;ffffffff8112076a&gt;] path_openat+0xc0/0x2ef
[ 5447.834438]  [&lt;ffffffff810c58e2&gt;] ? __perf_event_task_sched_out+0x24/0x44
[ 5447.841216]  [&lt;ffffffff8103ecdd&gt;] ? perf_event_task_sched_out+0x59/0x67
[ 5447.847846]  [&lt;ffffffff81121a79&gt;] do_filp_open+0x3d/0x87
[ 5447.853156]  [&lt;ffffffff811e126c&gt;] ? strncpy_from_user+0x43/0x4d
[ 5447.859072]  [&lt;ffffffff8111f1f5&gt;] ? getname_flags+0x2e/0x80
[ 5447.864636]  [&lt;ffffffff8111f179&gt;] ? do_getname+0x14b/0x173
[ 5447.870112]  [&lt;ffffffff8111f1b7&gt;] ? audit_getname+0x16/0x26
[ 5447.875682]  [&lt;ffffffff8112b1ab&gt;] ? spin_lock+0xe/0x10
[ 5447.880882]  [&lt;ffffffff81112d39&gt;] do_sys_open+0x69/0xae
[ 5447.886153]  [&lt;ffffffff81112db1&gt;] sys_open+0x20/0x22
[ 5447.891114]  [&lt;ffffffff813b9aab&gt;] system_call_fastpath+0x16/0x1b

Fix it by reusing the old delayed node.

Reported-by: Jim Schutt &lt;jaschut@sandia.gov&gt;
Signed-off-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Tested-by: Jim Schutt &lt;jaschut@sandia.gov&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: avoid delayed metadata items during commits</title>
<updated>2011-06-17T20:38:47+00:00</updated>
<author>
<name>Chris Mason</name>
<email>chris.mason@oracle.com</email>
</author>
<published>2011-06-17T20:14:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e999376f094162aa425ae749aa1df95ab928d010'/>
<id>e999376f094162aa425ae749aa1df95ab928d010</id>
<content type='text'>
Snapshot creation has two phases.  One is the initial snapshot setup,
and the second is done during commit, while nobody is allowed to modify
the root we are snapshotting.

The delayed metadata insertion code can break that rule, it does a
delayed inode update on the inode of the parent of the snapshot,
and delayed directory item insertion.

This makes sure to run the pending delayed operations before we
record the snapshot root, which avoids corruptions.

Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Snapshot creation has two phases.  One is the initial snapshot setup,
and the second is done during commit, while nobody is allowed to modify
the root we are snapshotting.

The delayed metadata insertion code can break that rule, it does a
delayed inode update on the inode of the parent of the snapshot,
and delayed directory item insertion.

This makes sure to run the pending delayed operations before we
record the snapshot root, which avoids corruptions.

Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
