Commit Graph

762 Commits

Author SHA1 Message Date
Brian Behlendorf 9e3e35dc3f Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-08-06 10:52:35 -07:00
Brian Behlendorf 8f8d2b66aa Merge branch 'fix-branch' into refs/top-bases/zfs-branch 2010-08-06 10:52:34 -07:00
Brian Behlendorf 2e982255da Merge branch 'fix-zfs_ioc_objset_stats' into refs/top-bases/fix-branch 2010-08-06 10:47:02 -07:00
Brian Behlendorf 89f0abf9b5 Add missing zfs_ioc_objset_stats() error handling
Interestingly this looks like an upstream bug as well.  If for some
reason we are unable to get a zvols statistics, because perhaps the
zpool is hopelessly corrupt, we would trigger the VERIFY.  This
commit adds the proper error handling just to propagate the error
back to user space.  Now the user space tools still must handle this
properly but in the worst case the tool will crash or perhaps have
some missing output.  That's far far better than crashing the host.

Closes #45
2010-08-06 10:46:39 -07:00
Brian Behlendorf 63a645c3c8 Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-08-03 16:02:21 -07:00
Brian Behlendorf 1b9fd31ada Merge branch 'fix-branch' into refs/top-bases/zfs-branch 2010-08-03 16:02:20 -07:00
Brian Behlendorf 2cb5528450 Merge branch 'fix-bpobj_close' into refs/top-bases/fix-branch 2010-08-03 15:56:53 -07:00
Brian Behlendorf 3253b39fa6 Set bpo->bpo_object = 0 on close to allow retry
During spa_load the spl->spa_deferred_bpobj maybe be opened and closed
multiple times.  It's critical that when the object is closed the
bpo->bpo_object is set to zero to indicate the object is closed.
If it's not during spl_load_retry the spl->spa_deferred_bpobj can
be closes twice resulting in a NULL deref.

This appears to have been fixed upstream the same way.
2010-08-03 15:56:29 -07:00
Brian Behlendorf 8481c9b7bb Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-08-02 15:29:28 -07:00
Brian Behlendorf 7e9bdac1a8 Merge branch 'fix-branch' into refs/top-bases/zfs-branch 2010-08-02 15:29:27 -07:00
Brian Behlendorf 8bf0a4e79c Merge branch 'fix-stack-inline' into refs/top-bases/fix-branch 2010-08-02 15:29:25 -07:00
Brian Behlendorf 45c00bf359 Fix spa_load_impl() prototype
Both the forward declaration of spa_load_impl() and the actual
function declaration must match.
2010-08-02 15:24:33 -07:00
Brian Behlendorf 52c23142d4 Revert "Inline zio_execute() to reduce stack use"
This reverts commit 411dd65af1.

gcc version 4.1.2 does not like having differing prototypes
for zio_execute, one version in the .c with inline and one
version in the .h without.  Thus I'm reverting this change
and we'll see how critical this particular stack reduction is.
2010-08-02 15:22:11 -07:00
Brian Behlendorf 1afa38755a Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-08-02 14:17:17 -07:00
Brian Behlendorf 3de149b962 Merge branch 'fix-branch' into refs/top-bases/zfs-branch 2010-08-02 14:17:16 -07:00
Brian Behlendorf 529d515858 Merge branch 'fix-stack-dbuf_hold_impl' into refs/top-bases/fix-branch 2010-08-02 14:12:55 -07:00
Ned Bass 4d3fc57112 Reduce stack usage for recursive dbuf_hold_impl()
This commit preserves the recursive function dbuf_hold_impl() but moves
the local variables and function arguments to the heap to minimize
the stack frame size.  Enough space is initially allocated on the
stack for 20 levels of recursion.  This technique was based on commit
34229a2f2a which reduced stack usage of
traverse_visitbp().

dbuf_hold_impl() is mutually recursive with dbuf_findbp(),
but the latter function is also called from other functions.
Therefore dbuf_findbp() must contain logic to determine how to call
dbuf_hold_impl().  To this end, dbuf_hold_impl() now takes a
struct dbuf_hold_impl_data pointer as an argument.  If that argument
is NULL it calls dbuf_hold_impl() as before, otherwise it calls
__debuf_hold_impl() with a single dbuf_hold_impl_data pointer argument.
As the name implies, dbuf_hold_impl_data stores the arguments and local
variables for dbuf_hold_impl().

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2010-08-02 14:12:31 -07:00
Brian Behlendorf 2a9adcbffb Merge branch 'fix-stack-dsl_scan_visitbp' into refs/top-bases/fix-branch 2010-08-02 14:09:39 -07:00
Ned Bass 410d8c4e15 Reduce dsl_scan_visitbp stack usage by moving blkptr_t to heap
Github issue 22 reported a stack overrun when the zfs module was
loaded, possibly related to the presence of existing zpools created
under zfs-fuse.  The stack trace showed 9 levels of recursion between
dsl_scan_visitbp() and dsl_scan_recurse(). To reduce stack overhead in
that code path, this commit moves the 128 byte blkptr_t data strucutre
in dsl_scan_visitbp() to the heap.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2010-08-02 14:09:15 -07:00
Brian Behlendorf 425b8742a5 Merge branch 'fix-stack-zio_done' into refs/top-bases/fix-branch 2010-08-02 14:06:32 -07:00
Ned Bass d5658668e0 Reduce stack usage of zio_done
Eliminated local variables pointing to members of the zio struct.
Just refer to the struct members directly.  This saved about 32 bytes per
call, but this function can be called recurisvely up to 19 levels deep,
so we potentially save up to 608 bytes.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2010-08-02 14:05:49 -07:00
Brian Behlendorf f3d8ee7357 Merge branch 'fix-stack-vdev_cache_read' into refs/top-bases/fix-branch 2010-08-02 13:57:39 -07:00
Brian Behlendorf 48669030fe Reduce stack in vdev_cache_read
Moving the vdev_cache_entry_t struct ve_search from the stack to
the heap saves ~100 bytes.
2010-08-02 13:57:15 -07:00
Brian Behlendorf fd164fdb40 Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-08-02 13:52:57 -07:00
Brian Behlendorf 5d145c70f1 Merge branch 'fix-branch' into refs/top-bases/zfs-branch 2010-08-02 13:52:56 -07:00
Brian Behlendorf 215b84f12f Merge branch 'fix-stack-inline' into refs/top-bases/fix-branch 2010-08-02 13:49:05 -07:00
Ned Bass 411dd65af1 Inline zio_execute() to reduce stack use
Deep recursive call chains are contributing to segfaults in ztest due to
heavy stack use.  Inlining zio_execute() helps reduce the stack depth of
the zio_notify_parent() -> zio_execute() -> zio_wait() recursive cycle.
I am no longer seeing ztest segfaults in this code path with this change.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2010-08-02 13:47:49 -07:00
Ned Bass 526d004cf5 Inline dbuf_findbp() to reduce stack use
Deep recursive call chains are contributing to segfaults in ztest due
to heavy stack use.  Inlining dbuf_findbp() helps reduce the stack depth
of the dbuf_findbp() -> dbuf_hold_impl() cycle.  However, segfaults are
still occurring in this code path, so further reductions are still needed.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2010-08-02 13:47:21 -07:00
Ned Bass dd72f3d647 Inline zio_notify_parent() to reduce stack use
Deep recursive call chains are contributing to segfaults in ztest due
to heavy stack use.  Inlining zio_notify_parent() helps reduce the
stack depth of the zio_notify_parent() -> zio_execute() -> zio_done()
recursive cycle.  I am no longer seeing ztest segfaults in this code
path with this change combined with the zio_done() stack reduction in
the previous commit.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2010-08-02 13:46:48 -07:00
Brian Behlendorf ca5262f030 Reduce stack by inlining spa_impl_load
The spa_load function may call itself recursively through
the spa_load_impl function.  This call path of spa_load->
spa_load_impl->spa_load->spa_load_impl takes 640 bytes of
stack.  By forcing spa_load_impl to be inlined as part of
spa_load the can be reduced to 448 bytes, for a savings of
192 bytes,
2010-08-02 13:45:28 -07:00
Brian Behlendorf 0fee5e7ac8 Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-08-02 13:21:53 -07:00
Brian Behlendorf 7b8a233029 Merge branch 'fix-branch' into refs/top-bases/zfs-branch 2010-08-02 13:21:52 -07:00
Brian Behlendorf bb064e0220 Merge branch 'fix-taskq' into refs/top-bases/fix-branch 2010-08-02 13:21:51 -07:00
Ricardo M. Correia 4ca4dfe9bb Fix taskq_dispatch() call in zio_taskq_dispatch().
The feature branch 'fix-taskq' in Linux's ZFS tree changes the taskq_dispatch()
flag from TQ_SLEEP to TQ_NOSLEEP to avoid sleeping in some circumstances.

However, this has the side effect that taskq_dispatch() now may fail, and since
the return code was not even being checked, it could lead to zio's not being
scheduled to execute.

I'm fixing this in a simplistic but not very elegant way, by just looping until
taskq_dispatch() succeeds.

Signed-off-by: Ricardo M. Correia <ricardo.correia@oracle.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2010-08-02 13:12:54 -07:00
Brian Behlendorf 9662934bd9 Add uninstall Makefile targets
Extend the Makefiles with an uninstall target to cleanly
remove a package which was installed with 'make install'.

Additionally, ensure a 'depmod -a' is run as part of the
install to update the module dependency information.
2010-07-28 16:47:26 -07:00
Brian Behlendorf 5387c446cf Merge branch 'fix-branch' into refs/top-bases/zfs-branch 2010-06-29 16:57:41 -07:00
Brian Behlendorf f28ca65b92 Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-06-29 16:57:41 -07:00
Brian Behlendorf 015677660a Merge branch 'fix-stack-traverse_visitbp' into refs/top-bases/fix-branch 2010-06-29 16:57:39 -07:00
Brian Behlendorf f20301b41b Minor fix to ensure tv_depth is there when debugging is disabled. 2010-06-29 16:52:42 -07:00
Brian Behlendorf 2eceb0c47a Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-06-29 11:12:00 -07:00
Brian Behlendorf b0c8dc3c75 Merge branch 'fix-branch' into refs/top-bases/zfs-branch 2010-06-29 11:11:59 -07:00
Brian Behlendorf 46b2d46053 Merge branch 'fix-stack-traverse_visitbp' into refs/top-bases/fix-branch 2010-06-29 11:04:51 -07:00
Brian Behlendorf 34229a2f2a Reduce stack usage for recursive traverse_visitbp()
Due to  limited stack space recursive functions are frowned upon in
the Linux kernel.  However, they often are the most elegant solution
to a problem.  The following code preserves the recursive function
traverse_visitbp() but moves the local variables AND function
arguments to the heap to minimize the stack frame size.  Enough
space is initially allocated on the stack for 20 levels of recursion.
This change does ugly-up-the-code but it reduces the worst case
usage from roughly 4160 bytes to 960 bytes on x86_64 archs.
2010-06-29 11:04:26 -07:00
Brian Behlendorf 0a2b049259 Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-06-29 10:59:54 -07:00
Brian Behlendorf ffeafc898e Merge branch 'fix-branch' into refs/top-bases/zfs-branch
Conflicts:

	cmd/ztest/ztest.c
2010-06-29 10:55:38 -07:00
Brian Behlendorf b873e71b0f Merge branch 'gcc-branch' into refs/top-bases/zfs-branch 2010-06-29 10:29:42 -07:00
Brian Behlendorf 192b36dcfd Merge branch 'gcc-uninit' into refs/top-bases/gcc-branch 2010-06-29 10:25:31 -07:00
Brian Behlendorf 9cdd80e387 Revert traverse_impl() changes
These changes are now taken care of by the fix-stack-traverse_impl
topic branch which not only solves the uninit problem but also
moves these locals off the stack and on to the heap.
2010-06-29 10:24:14 -07:00
Brian Behlendorf 96bd9f434d Merge branch 'fix-stack-traverse_impl' into refs/top-bases/fix-branch 2010-06-29 10:21:53 -07:00
Brian Behlendorf 8e2de85a6d Reduce stack usage of traverse_impl()
Stack use reduced from 560 bytes to 128 bytes.
2010-06-29 10:21:21 -07:00