diff options
author | Brian Behlendorf <[email protected]> | 2010-08-27 16:48:18 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2010-08-31 08:38:50 -0700 |
commit | 6656bf56216f36805731298ee0f4de87ae6b6b3d (patch) | |
tree | 2f28be68a0f1ee5a049b91999420fd7643d43e0c /lib/libzfs/libzfs_pool.c | |
parent | da6b4005c92ce02359aabae6549f1031ad1fe41c (diff) |
Fix stack 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.
Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'lib/libzfs/libzfs_pool.c')
0 files changed, 0 insertions, 0 deletions