Commit Graph

92 Commits

Author SHA1 Message Date
Brian Behlendorf 4471454be8 Merge branch 'fix-stack-ztest' into refs/top-bases/fix-branch 2010-07-23 11:42:21 -07:00
Ned Bass be92edb218 Add extra guard space if needed
Some buggy NPTL threading implementations include the guard area within
the stack size allocations.  In this case we need to allocate an extra
page to account for the guard area since we only have two pages of usable
stack on Linux.  Added an autoconf test that detects such implementations
by running a test program designed to segfault if the bug is present.
Set a flag NPTL_GUARD_WITHIN_STACK that is tested to decide if extra
stack space must be allocated for the guard area.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2010-07-23 11:38:00 -07:00
Brian Behlendorf a2cf158872 Merge branch 'fix-stack-ztest' into refs/top-bases/fix-branch 2010-07-21 10:08:22 -07:00
Ned Bass 75d868af70 Fixed typo that set thread STACK_SIZE to 24k instead of 8k
__linux__ was mispelled as _linux_ so #ifdef was always
selecting the Solaris STACK_SIZE value.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2010-07-21 10:04:21 -07:00
Brian Behlendorf d2585f5921 Merge branch 'fix-stack-vn_open' into refs/top-bases/fix-branch 2010-06-29 10:15:05 -07:00
Brian Behlendorf edbb93c11d Reduce stack usage by vn_open()
We should not put a 4k maxpathlen buffer on the stack, instead
locate it to the heap.  Even in user space we run ztest with 8K
2010-06-29 10:14:37 -07:00
Brian Behlendorf aa90238713 Merge branch 'fix-pthreads' into refs/top-bases/fix-branch 2010-06-29 10:12:03 -07:00
Brian Behlendorf 6fe1e37a5e Additional pthread related fixes for ztest
There are 3 fixes in thie commit.  First, update ztest_run() to store
the thread id and not the address of the kthread_t.  This will be freed
on thread exit and is not safe to use.  This is pretty close to how
things were done in the original ztest code before I got there.

Second, for extra paranoia update thread_exit() to return a special
TS_MAGIC value via pthread_exit().  This value is then verified in
pthread_join() to ensure the thread exited cleanly.  This can be
done cleanly because the kthread doesn't provide a return code
mechanism we need to worry about.

Third, replace the ztest deadman thread with a signal handler.  We
cannot use the previous approach because the correct behavior for
pthreads is to wait for all threads to exit before terminating the
process.  Since the deadman thread won't call exit by design we
end up hanging in kernel_exit().  To avoid this we just setup a
SIGALRM signal handle and register a deadman alarm.  IMHO this
is simpler and cleaner anyway.
2010-06-29 10:06:09 -07:00
Brian Behlendorf ee53c67258 Merge branch 'fix-pthreads' into refs/top-bases/fix-branch 2010-06-28 10:36:17 -07:00
Brian Behlendorf a2e73b7516 Allow joinable threads
There was previous discussion of a race with joinable threads but to
be honest I can neither exactly remember the race, or recrease the
issue.  I believe it may have had to do with pthread_create() returning
without having set kt->tid since this was done in the created thread.
If that was the race then I've 'fixed' it by ensuring the thread id
is set in the thread AND as the first pthread_create() argument.  Why
this wasn't done originally I'm not sure, with luck Ricardo remembers.

Additionally, explicitly set a PAGESIZE guard frame at the end of the
stack to aid in detecting stack overflow.  And add some conditional
logic to set STACK_SIZE correctly for Solaris.
2010-06-28 10:15:29 -07:00
Brian Behlendorf a2ba5b83f8 Merge branch 'fix-stack-noinline' into refs/top-bases/fix-branch 2010-06-16 14:35:14 -07:00
Brian Behlendorf bbdb8184ec Add fix-stack-noinline topic branch
Certain function must never be automatically inlined by gcc because
they are stack heavy or called recursively.  This patch flags all
such functions I have found as 'noinline' to prevent gcc from making
the optimization.
2010-06-16 14:34:41 -07:00
Brian Behlendorf 30c03a0914 Merge branch 'fix-stack' into refs/top-bases/fix-branch 2010-06-16 14:27:29 -07:00
Brian Behlendorf 2115c30515 Revert fix-stack topic branch
This patch will be broken in to several independent stack reductions
and reapplied as new topic branches.
2010-06-16 14:23:31 -07:00
Brian Behlendorf 2969945552 Merge branch 'fix-pthreads' into refs/top-bases/fix-branch 2010-06-14 16:22:00 -07:00
Brian Behlendorf f9f342c5f2 Add fix-pthreads topic branch
This is a portability change which removes the dependence of the Solaris
thread library.  All locations where Solaris thread API was used before
have been replaced with equivilant Solaris kernel style thread calls.
In user space the kernel style threading API is implemented in term of
the portable pthreads library.  This includes all threads, mutexs,
condition variables, reader/writer locks, and taskqs.
2010-06-14 16:20:44 -07:00
Brian Behlendorf 89089d1e4b Merge commit 'refs/top-bases/fix-stack' into fix-stack
Conflicts:
	module/zfs/dmu_objset.c
	module/zfs/spa_history.c
2010-05-28 13:54:08 -07:00
Brian Behlendorf 31630287ca Merge branch 'fix-dbuf_dirty_record_t' into refs/top-bases/fix-branch
Conflicts:
	lib/libzfs/libzfs_sendrecv.c
	module/zfs/dmu_objset.c
	module/zfs/dnode.c
	module/zfs/dsl_dataset.c
	module/zfs/spa_history.c
2010-05-28 13:51:29 -07:00
Brian Behlendorf 428870ff73 Update core ZFS code from build 121 to build 141. 2010-05-28 13:45:14 -07:00
Brian Behlendorf fcfae8fbee Merge branch 'fix-get-configs' into refs/top-bases/fix-branch 2010-05-28 12:20:30 -07:00
Brian Behlendorf c37d6443a4 Revert fix-get-configs should no longer be needed 2010-05-28 12:18:45 -07:00
Brian Behlendorf 166355dcf0 Merge branch 'fix-error-handling' into refs/top-bases/fix-branch 2010-03-10 09:54:43 -08:00
Ricardo M. Correia 62a0ac8f22 Fix some incorrect error handling.
In vn_open(), if fstat64() returned an error, the real errno
was being obscured by calling close().

Add error handling for both pwrite64() calls in vn_rdwr().
2010-03-10 09:53:53 -08:00
Brian Behlendorf e59c225cea Merge commit 'refs/top-bases/fix-stack' into fix-stack 2009-10-09 15:43:15 -07:00
Brian Behlendorf 1af5dcae21 Merge commit 'refs/top-bases/fix-get-configs' into fix-get-configs 2009-10-09 15:43:08 -07:00
Brian Behlendorf 5fc177d934 Merge branch 'fix-clock-wrap' into refs/top-bases/fix-branch 2009-10-09 15:43:00 -07:00
Brian Behlendorf 5c36312909 Script update-zfs.sh updated to include libefi library 2009-10-09 15:37:29 -07:00
Brian Behlendorf f8cca2b295 Merge commit 'refs/top-bases/fix-stack' into fix-stack 2009-08-18 12:09:57 -07:00
Brian Behlendorf b3ea816a68 Merge commit 'refs/top-bases/fix-get-configs' into fix-get-configs 2009-08-18 12:09:36 -07:00
Brian Behlendorf d205b25a74 Merge branch 'fix-clock-wrap' into refs/top-bases/fix-branch 2009-08-18 12:09:10 -07:00
Brian Behlendorf 45d1cae3b8 Rebase master to b121 2009-08-18 11:43:27 -07:00
Brian Behlendorf e4610d7991 Merge branch 'fix-get-configs' into refs/top-bases/fix-branch 2009-07-24 09:15:53 -07:00
Brian Behlendorf 1b4dfb80fb Increase buffer size for nvlist for large configurations
It's still not clear to me why the default value here is large
enough Solaris.  I hit this limit again when setting up 120 SATA
drives configured as 15 raidz2 groups each containing 8 drives.
We expect to go bigger so we may just want to spend a little
time and figure out how to make this all dynamic.
2009-07-24 08:53:18 -07:00
Brian Behlendorf ed3bd6f446 Merge branch 'fix-acl' into refs/top-bases/fix-branch 2009-07-07 14:19:35 -07:00
Brian Behlendorf 798cf63309 New topic branch for minor acl related fixes 2009-07-07 14:18:47 -07:00
Brian Behlendorf 326bb586bd Merge commit 'refs/top-bases/fix-stack' into fix-stack 2009-07-06 13:13:20 -07:00
Brian Behlendorf e320858042 Merge commit 'refs/top-bases/fix-get-configs' into fix-get-configs 2009-07-06 13:12:54 -07:00
Brian Behlendorf 01c3cfc58f Merge branch 'fix-clock-wrap' into refs/top-bases/fix-branch
Conflicts:

	module/zfs/zil.c
2009-07-06 13:12:23 -07:00
Brian Behlendorf 9babb37438 Rebase master to b117 2009-07-02 15:44:48 -07:00
Brian Behlendorf 05cec154f5 Merge branch 'fix-pthreads' into refs/top-bases/fix-branch 2009-03-19 19:49:53 -07:00
Brian Behlendorf 53db4c7b29 Revert fix-pthreads moving to feature-pthreads branch 2009-03-19 19:43:09 -07:00
Brian Behlendorf 9818e69640 Merge branch 'fix-deadcode' into refs/top-bases/fix-branch 2009-03-16 10:12:01 -07:00
Brian Behlendorf 2924858552 Remove two self referential functions.
Newer versions of gcc (4.3.0) detected the following unused
code segments.
2009-03-16 10:02:06 -07:00
Brian Behlendorf c4e10eb3df Merge branch 'fix-strncat' into refs/top-bases/fix-branch 2009-03-12 15:21:30 -07:00
Brian Behlendorf f1f9c50dd9 Add fix-strncat branch which corrects a buffer overrun. 2009-03-12 15:20:26 -07:00
Brian Behlendorf 7fe1b71533 Merge commit 'refs/top-bases/fix-stack' into fix-stack 2009-02-18 14:29:19 -08:00
Brian Behlendorf 15f5ddebdf Merge commit 'refs/top-bases/fix-pthreads' into fix-pthreads
Conflicts:

	lib/libzpool/kernel.c
2009-02-18 14:29:08 -08:00
Brian Behlendorf 109a1d5b16 Merge commit 'refs/top-bases/fix-get-configs' into fix-get-configs 2009-02-18 14:28:38 -08:00
Brian Behlendorf 6fe19bd252 Merge branch 'fix-clock-wrap' into refs/top-bases/fix-branch
Conflicts:

	lib/libzpool/kernel.c
	module/zfs/arc.c
2009-02-18 14:28:15 -08:00
Brian Behlendorf d164b20935 Rebase master to b108 2009-02-18 12:51:31 -08:00