<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/xfs/xfs_alloc.c, branch linux-3.7.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.7.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.7.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2012-11-08T17:08:46Z</updated>
<entry>
<title>xfs: move allocation stack switch up to xfs_bmapi_allocate</title>
<updated>2012-11-08T17:08:46Z</updated>
<author>
<name>Dave Chinner</name>
</author>
<published>2012-10-05T01:06:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1f3c785c3adb7d2b109ec7c8f10081d1294b03d3'/>
<id>urn:sha1:1f3c785c3adb7d2b109ec7c8f10081d1294b03d3</id>
<content type='text'>
Switching stacks are xfs_alloc_vextent can cause deadlocks when we
run out of worker threads on the allocation workqueue. This can
occur because xfs_bmap_btalloc can make multiple calls to
xfs_alloc_vextent() and even if xfs_alloc_vextent() fails it can
return with the AGF locked in the current allocation transaction.

If we then need to make another allocation, and all the allocation
worker contexts are exhausted because the are blocked waiting for
the AGF lock, holder of the AGF cannot get it's xfs-alloc_vextent
work completed to release the AGF.  Hence allocation effectively
deadlocks.

To avoid this, move the stack switch one layer up to
xfs_bmapi_allocate() so that all of the allocation attempts in a
single switched stack transaction occur in a single worker context.
This avoids the problem of an allocation being blocked waiting for
a worker thread whilst holding the AGF.

Signed-off-by: Dave Chinner &lt;dchinner@redhat.com&gt;
Reviewed-by: Mark Tinguely &lt;tinguely@sgi.com&gt;
Signed-off-by: Ben Myers &lt;bpm@sgi.com&gt;
</content>
</entry>
<entry>
<title>xfs: introduce XFS_BMAPI_STACK_SWITCH</title>
<updated>2012-11-08T17:08:27Z</updated>
<author>
<name>Dave Chinner</name>
</author>
<published>2012-10-05T01:06:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=326c03555b914ff153ba5b40df87fd6e28e7e367'/>
<id>urn:sha1:326c03555b914ff153ba5b40df87fd6e28e7e367</id>
<content type='text'>
Certain allocation paths through xfs_bmapi_write() are in situations
where we have limited stack available. These are almost always in
the buffered IO writeback path when convertion delayed allocation
extents to real extents.

The current stack switch occurs for userdata allocations, which
means we also do stack switches for preallocation, direct IO and
unwritten extent conversion, even those these call chains have never
been implicated in a stack overrun.

Hence, let's target just the single stack overun offended for stack
switches. To do that, introduce a XFS_BMAPI_STACK_SWITCH flag that
the caller can pass xfs_bmapi_write() to indicate it should switch
stacks if it needs to do allocation.

Signed-off-by: Dave Chinner &lt;dchinner@redhat.com&gt;
Reviewed-by: Mark Tinguely &lt;tinguely@sgi.com&gt;
Signed-off-by: Ben Myers &lt;bpm@sgi.com&gt;
</content>
</entry>
<entry>
<title>xfs: zero allocation_args on the kernel stack</title>
<updated>2012-11-08T17:08:10Z</updated>
<author>
<name>Mark Tinguely</name>
</author>
<published>2012-09-20T18:16:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=408cc4e97a3ccd172d2d676e4b585badf439271b'/>
<id>urn:sha1:408cc4e97a3ccd172d2d676e4b585badf439271b</id>
<content type='text'>
Zero the kernel stack space that makes up the xfs_alloc_arg structures.

Signed-off-by: Mark Tinguely &lt;tinguely@sgi.com&gt;
Reviewed-by: Ben Myers &lt;bpm@sgi.com&gt;
Signed-off-by: Ben Myers &lt;bpm@sgi.com&gt;
</content>
</entry>
<entry>
<title>xfs: don't defer metadata allocation to the workqueue</title>
<updated>2012-07-13T18:09:27Z</updated>
<author>
<name>Dave Chinner</name>
</author>
<published>2012-07-11T21:40:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=aa292847b9fc6e187547110de833a7d3131bbddf'/>
<id>urn:sha1:aa292847b9fc6e187547110de833a7d3131bbddf</id>
<content type='text'>
Almost all metadata allocations come from shallow stack usage
situations. Avoid the overhead of switching the allocation to a
workqueue as we are not in danger of running out of stack when
making these allocations. Metadata allocations are already marked
through the args that are passed down, so this is trivial to do.

Signed-off-by: Dave Chinner &lt;dchinner@redhat.com&gt;
Reported-by: Mel Gorman &lt;mgorman@suse.de&gt;
Tested-by: Mel Gorman &lt;mgorman@suse.de&gt;
Signed-off-by: Ben Myers &lt;bpm@sgi.com&gt;
</content>
</entry>
<entry>
<title>xfs: really fix the cursor leak in xfs_alloc_ag_vextent_near</title>
<updated>2012-07-13T18:09:18Z</updated>
<author>
<name>Dave Chinner</name>
</author>
<published>2012-07-11T21:40:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e3a746f5aab71f2dd0a83116772922fb37ae29d6'/>
<id>urn:sha1:e3a746f5aab71f2dd0a83116772922fb37ae29d6</id>
<content type='text'>
The current cursor is reallocated when retrying the allocation, so
the existing cursor needs to be destroyed in both the restart and
the failure cases.

Signed-off-by: Dave Chinner &lt;dchinner@redhat.com&gt;
Tested-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Signed-off-by: Ben Myers &lt;bpm@sgi.com&gt;
</content>
</entry>
<entry>
<title>xfs: fix allocbt cursor leak in xfs_alloc_ag_vextent_near</title>
<updated>2012-06-21T19:20:20Z</updated>
<author>
<name>Dave Chinner</name>
</author>
<published>2012-06-12T04:20:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=76d095388b040229ea1aad7dea45be0cfa20f589'/>
<id>urn:sha1:76d095388b040229ea1aad7dea45be0cfa20f589</id>
<content type='text'>
When we fail to find an matching extent near the requested extent
specification during a left-right distance search in
xfs_alloc_ag_vextent_near, we fail to free the original cursor that
we used to look up the XFS_BTNUM_CNT tree and hence leak it.

Reported-by: Chris J Arges &lt;chris.j.arges@canonical.com&gt;
Signed-off-by: Dave Chinner &lt;dchinner@redhat.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Ben Myers &lt;bpm@sgi.com&gt;
</content>
</entry>
<entry>
<title>xfs: fix debug_object WARN at xfs_alloc_vextent()</title>
<updated>2012-06-20T19:58:24Z</updated>
<author>
<name>Jeff Liu</name>
</author>
<published>2012-06-07T07:44:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3b876c8f2a361ceeed3fed894980c69066f903a0'/>
<id>urn:sha1:3b876c8f2a361ceeed3fed894980c69066f903a0</id>
<content type='text'>
Fengguang reports:

[  780.529603] XFS (vdd): Ending clean mount
[  781.454590] ODEBUG: object is on stack, but not annotated
[  781.455433] ------------[ cut here ]------------
[  781.455433] WARNING: at /c/kernel-tests/sound/lib/debugobjects.c:301 __debug_object_init+0x173/0x1f1()
[  781.455433] Hardware name: Bochs
[  781.455433] Modules linked in:
[  781.455433] Pid: 26910, comm: kworker/0:2 Not tainted 3.4.0+ #51
[  781.455433] Call Trace:
[  781.455433]  [&lt;ffffffff8106bc84&gt;] warn_slowpath_common+0x83/0x9b
[  781.455433]  [&lt;ffffffff8106bcb6&gt;] warn_slowpath_null+0x1a/0x1c
[  781.455433]  [&lt;ffffffff814919a5&gt;] __debug_object_init+0x173/0x1f1
[  781.455433]  [&lt;ffffffff81491c65&gt;] debug_object_init+0x14/0x16
[  781.455433]  [&lt;ffffffff8108842a&gt;] __init_work+0x20/0x22
[  781.455433]  [&lt;ffffffff8134ea56&gt;] xfs_alloc_vextent+0x6c/0xd5

Use INIT_WORK_ONSTACK in xfs_alloc_vextent instead of INIT_WORK.

Reported-by: Wu Fengguang &lt;wfg@linux.intel.com&gt;
Signed-off-by: Jie Liu &lt;jeff.liu@oracle.com&gt;
Signed-off-by: Ben Myers &lt;bpm@sgi.com&gt;
</content>
</entry>
<entry>
<title>xfs: make xfs_extent_busy_trim not static</title>
<updated>2012-05-14T21:21:04Z</updated>
<author>
<name>Ben Myers</name>
</author>
<published>2012-05-10T18:55:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e700a06c71dbbc0879a5d15881cca7b772282484'/>
<id>urn:sha1:e700a06c71dbbc0879a5d15881cca7b772282484</id>
<content type='text'>
Commit e459df5, 'xfs: move busy extent handling to it's own file'
moved some code from xfs_alloc.c into xfs_extent_busy.c for
convenience in userspace code merges.  One of the functions moved is
xfs_extent_busy_trim (formerly xfs_alloc_busy_trim) which is defined
STATIC.  Unfortunately this function is still used in xfs_alloc.c, and
this results in an undefined symbol in xfs.ko.

Make xfs_extent_busy_trim not static and add its prototype to
xfs_extent_busy.h.

Signed-off-by: Ben Myers &lt;bpm@sgi.com&gt;
Reviewed-by: Mark Tinguely &lt;tinguely@sgi.com&gt;
</content>
</entry>
<entry>
<title>xfs: clean up busy extent naming</title>
<updated>2012-05-14T21:20:56Z</updated>
<author>
<name>Dave Chinner</name>
</author>
<published>2012-04-29T10:41:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4ecbfe637cbcc0f093d1f295ef483f4e31e3987b'/>
<id>urn:sha1:4ecbfe637cbcc0f093d1f295ef483f4e31e3987b</id>
<content type='text'>
Now that the busy extent tracking has been moved out of the
allocation files, clean up the namespace it uses to
"xfs_extent_busy" rather than a mix of "xfs_busy" and
"xfs_alloc_busy".

Signed-off-by: Dave Chinner&lt;dchinner@redhat.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Mark Tinguely &lt;tinguely@sgi.com&gt;
Signed-off-by: Ben Myers &lt;bpm@sgi.com&gt;
</content>
</entry>
<entry>
<title>xfs: move busy extent handling to it's own file</title>
<updated>2012-05-14T21:20:55Z</updated>
<author>
<name>Dave Chinner</name>
</author>
<published>2012-04-29T10:39:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=efc27b52594e322d4c94e379489fa3690bf74739'/>
<id>urn:sha1:efc27b52594e322d4c94e379489fa3690bf74739</id>
<content type='text'>
To make it easier to handle userspace code merges, move all the busy
extent handling out of the allocation code and into it's own file.
The userspace code does not need the busy extent code, so this
simplifies the merging of the kernel code into the userspace
xfsprogs library.

Because the busy extent code has been almost completely rewritten
over the past couple of years, also update the copyright on this new
file to include the authors that made all those changes.

Signed-off-by: Dave Chinner &lt;dchinner@redhat.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Mark Tinguely &lt;tinguely@sgi.com&gt;
Signed-off-by: Ben Myers &lt;bpm@sgi.com&gt;
</content>
</entry>
</feed>
