]> git.proxmox.com Git - mirror_spl.git/log
mirror_spl.git
16 years agoBreaking the world for a little bit. If anyone is going to continue
behlendo [Mon, 2 Jun 2008 17:28:49 +0000 (17:28 +0000)]
Breaking the world for a little bit.  If anyone is going to continue
working on this branch for the next few days I suggested you work
off of the 0.3.1 tag.  The following changes are fairly extensive
and are designed to make the SPL compatible with all kernels in
the range of 2.6.18-2.6.25.  There were 13 relevant API changes
between these releases and I have added the needed autoconf tests
to check for them.  However, this has not all been tested extensively.
I'll sort of the breakage on Fedora Core 9 and RHEL5 this week.

SPL_AC_TYPE_UINTPTR_T
SPL_AC_TYPE_KMEM_CACHE_T
SPL_AC_KMEM_CACHE_DESTROY_INT
SPL_AC_ATOMIC_PANIC_NOTIFIER
SPL_AC_3ARGS_INIT_WORK
SPL_AC_2ARGS_REGISTER_SYSCTL
SPL_AC_KMEM_CACHE_T
SPL_AC_KMEM_CACHE_CREATE_DTOR
SPL_AC_3ARG_KMEM_CACHE_CREATE_CTOR
SPL_AC_SET_SHRINKER
SPL_AC_PATH_IN_NAMEIDATA
SPL_AC_TASK_CURR
SPL_AC_CTL_UNNUMBERED

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@119 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoMake a tag just for release to CEA, this has the URCL
behlendo [Mon, 26 May 2008 05:01:15 +0000 (05:01 +0000)]
Make a tag just for release to CEA, this has the URCL

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@115 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoGo through and add a header with the proper UCRL number.
behlendo [Mon, 26 May 2008 04:38:26 +0000 (04:38 +0000)]
Go through and add a header with the proper UCRL number.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@114 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoPrep for for 0.3.0 tag, this is the tag which was used for all
behlendo [Wed, 21 May 2008 21:11:47 +0000 (21:11 +0000)]
Prep for for 0.3.0 tag, this is the tag which was used for all
the performance results to date.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@112 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years ago- Properly fix the debug support for all the ASSERT's, VERIFIES, etc can be
behlendo [Mon, 19 May 2008 02:49:12 +0000 (02:49 +0000)]
- Properly fix the debug support for all the ASSERT's, VERIFIES, etc can be
  compiled out when doing performance runs.
- Bite the bullet and fully autoconfize the debug options in the configure
  time parameters.  By default all the debug support is disable in the core
  SPL build, but available to modules which enable it when building against
  the SPL.  To enable particular SPL debug support use the follow configure
  options:

  --enable-debug Internal ASSERTs
  --enable-debug-kmem Detailed memory accounting
  --enable-debug-mutex Detailed mutex tracking
  --enable-debug_kstat          Kstat info exported to /proc
  --enable-debug-callb Additional callb debug

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@111 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoSPL additions to increase support for updated ZFS build
behlendo [Thu, 15 May 2008 23:39:19 +0000 (23:39 +0000)]
SPL additions to increase support for updated ZFS build

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@110 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoDisable adaptive mutexs by default (always sleep), and while
behlendo [Thu, 15 May 2008 17:32:41 +0000 (17:32 +0000)]
Disable adaptive mutexs by default (always sleep), and while
I'm at it add a module option for easy tuning.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@109 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoRework condition variable implementation to be consistent with
behlendo [Thu, 15 May 2008 17:10:30 +0000 (17:10 +0000)]
Rework condition variable implementation to be consistent with
other primitive implementations.  Additionally ensure that GFP_ATOMIC
is use for allocations when in interrupt context.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@108 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoEnhanse the thread interface to do something quasi inteligent
behlendo [Mon, 12 May 2008 18:54:08 +0000 (18:54 +0000)]
Enhanse the thread interface to do something quasi inteligent
with the function name passed to be used as a thread name.  Leaving
the trailing _thread is just redundant so just strip it this
make the thread names far more readable.

Use a strncpy in spl-mutex  just to be safe.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@107 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoAdd a comment so I remember to fix this.
behlendo [Mon, 12 May 2008 16:53:41 +0000 (16:53 +0000)]
Add a comment so I remember to fix this.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@106 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoBy default disable extra KMEM and MUTEX debugging to aid performance.
behlendo [Fri, 9 May 2008 22:53:20 +0000 (22:53 +0000)]
By default disable extra KMEM and MUTEX debugging to aid performance.
They can easily be re-enabled when new stability issues are uncovered.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@105 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoStability hack. Under Solaris when KM_SLEEP is set kmem_cache_alloc()
behlendo [Fri, 9 May 2008 21:21:33 +0000 (21:21 +0000)]
Stability hack.  Under Solaris when KM_SLEEP is set kmem_cache_alloc()
may not fail.  To get this behavior I'd added a retry to the shim layer
even though it is abusive to the VM, at least it should prevent the crash.
Additionally I added a proc counter so I can easily check how often this
is happening.  It should be fairly rare, but likely will get worse and
worse the longer the machine has been up.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@104 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoAdd an almost feature complete implemenation of kstat. I chose
behlendo [Thu, 8 May 2008 23:21:47 +0000 (23:21 +0000)]
Add an almost feature complete implemenation of kstat.  I chose
not to support a few flags (we assert if they are used), and I
did not add the libkstat interface and instead exported everything
to proc for easy access.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@103 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoSame deal as ZFS, we're quite stable now so tag it.
behlendo [Wed, 7 May 2008 20:12:44 +0000 (20:12 +0000)]
Same deal as ZFS, we're quite stable now so tag it.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@101 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoDecrease of kmem warnign threshold back to 2 pages, no worse than a stack.
behlendo [Wed, 7 May 2008 19:33:01 +0000 (19:33 +0000)]
Decrease of kmem warnign threshold back to 2 pages, no worse than a stack.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@100 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoAdd vmem memory accounting
behlendo [Wed, 7 May 2008 18:54:32 +0000 (18:54 +0000)]
Add vmem memory accounting

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@99 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years ago- Relocate 'stats_per' in to proper /proc/sys/spl/mutex/ directory
behlendo [Wed, 7 May 2008 17:58:22 +0000 (17:58 +0000)]
- Relocate 'stats_per' in to proper /proc/sys/spl/mutex/ directory
- Shift to spinlock for mutex list addition and removal

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@98 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoRemaining issues fixed after reenabled mutex debugging.
behlendo [Tue, 6 May 2008 23:19:27 +0000 (23:19 +0000)]
Remaining issues fixed after reenabled mutex debugging.

- Ensure the mutex_stats_sem and mutex_stats_list are initialized
- Only spin if you have to in mutex_init

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@97 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years ago- Updated rwlock's to reside in a .c file instead of a static inline
behlendo [Tue, 6 May 2008 23:00:49 +0000 (23:00 +0000)]
- Updated rwlock's to reside in a .c file instead of a static inline
- Updated rwlock's so they can be safely initialized in ctors.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@96 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoLots of fixes here:
behlendo [Tue, 6 May 2008 20:38:28 +0000 (20:38 +0000)]
Lots of fixes here:

- Detailed kmem memory allocation tracking.  We can now get on
  spl module unload a list of all memory allocations which were
  not free'd and where the original alloc was.  E.g.

SPL: 15554:632:(spl-kmem.c:442:kmem_fini()) kmem leaked 90/319332 bytes
SPL: 15554:648:(spl-kmem.c:451:kmem_fini()) address          size  data             func:line
SPL: 15554:648:(spl-kmem.c:457:kmem_fini()) ffff8100734b68b8 32    0100000001005a5a __spl_mutex_init:70
SPL: 15554:648:(spl-kmem.c:457:kmem_fini()) ffff8100734b6148 13    &tl->tl_lock     __spl_mutex_init:74
SPL: 15554:648:(spl-kmem.c:457:kmem_fini()) ffff81007ac43730 32    0100000001005a5a __spl_mutex_init:70
SPL: 15554:648:(spl-kmem.c:457:kmem_fini()) ffff81007ac437d8 13    &tl->tl_lock     __spl_mutex_init:74

- Shift to using rwsems in kmem implmentation, to simply locking and
  improve concurency.

- Shift to using rwsems in mutex implementation, additionally ensure we
  never sleep in the init function if non-zero preempt_count or
  interrupts are disabled as can happen in a slab cache ctor/dtor.

- Other minor formating fixes and such.

TODO:

- Finish the vmem memory allocation tracking

- Vet all other SPL primatives for potential sleeping during *_init.  I
suspect the rwlock implemenation does this and should be fixes just
like the mutex implemenation.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@95 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoCommit adaptive mutexes. This seems to have introduced some new
behlendo [Mon, 5 May 2008 20:18:49 +0000 (20:18 +0000)]
Commit adaptive mutexes.  This seems to have introduced some new
crashes but it's not clear to me yet if these are a problem with
the mutex implementation or ZFSs usage of it.

Minor taskq fixes to add new tasks to the end of the pending list.

Minor enhansements to the debug infrastructure.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@94 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoNew an improved taskq implementation for the SPL. It allows a
behlendo [Fri, 25 Apr 2008 22:10:47 +0000 (22:10 +0000)]
New an improved taskq implementation for the SPL.  It allows a
configurable number of threads like the Solaris version and almost
all of the options are supported.  Unfortunately, it appears to have
made absolutely no difference to our performance numbers.  I need
to keep looking for where we are bottle necking.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@93 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoUpdate kmem.h to properly use new debug subsystem.
behlendo [Thu, 24 Apr 2008 20:21:07 +0000 (20:21 +0000)]
Update kmem.h to properly use new debug subsystem.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@92 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoPrep for 0.2.1 tag
behlendo [Thu, 24 Apr 2008 17:41:23 +0000 (17:41 +0000)]
Prep for 0.2.1 tag
Minor fixes to headers to use debug macros
Added /proc/sys/spl/version

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@90 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoForgot to update the ChangeLog.
wartens2 [Thu, 24 Apr 2008 17:24:02 +0000 (17:24 +0000)]
Forgot to update the ChangeLog.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@89 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoMake sure that when calling __vmem_alloc that we
wartens2 [Thu, 24 Apr 2008 17:07:56 +0000 (17:07 +0000)]
Make sure that when calling __vmem_alloc that we
do not have __GFP_ZERO set.  Once the memory is allocated
then zero out the memory if __GFP_ZERO is passed to
__vmem_alloc.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@88 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoMinor improvement to taskq handling. This is a small step towards
behlendo [Wed, 23 Apr 2008 21:19:47 +0000 (21:19 +0000)]
Minor improvement to taskq handling.  This is a small step towards
dynamic taskqs which still need to be fully implemented.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@87 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoBe careful to never use any of the debug infrastructure either
behlendo [Tue, 22 Apr 2008 22:22:02 +0000 (22:22 +0000)]
Be careful to never use any of the debug infrastructure either
before the debug subsystem is fully set up, or after the debug
subsystem has been torn down.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@86 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoGive it a real version for a tag
behlendo [Tue, 22 Apr 2008 20:10:55 +0000 (20:10 +0000)]
Give it a real version for a tag

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@84 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoStack usage is my enemy. Trade cpu cycles in the debug code to
behlendo [Tue, 22 Apr 2008 16:55:26 +0000 (16:55 +0000)]
Stack usage is my enemy.  Trade cpu cycles in the debug code to
ensure I never add anything to the stack I don't absolutely need.
All this debug code could be removed from a production build
anyway so I'm not so worried about the performance impact.  We
may also consider revisting the mutex and condvar implementation
to ensure no additional stack is used there.

Initial indications are I have reduced the worst case stack
usage to 9080 bytes.  Still to large for the default 8k stacks
so I have been forced to run with 16k stacks until I can
reduce the worst offenders.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@83 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoMore fixes to ensure we get good debug logs even if we're in the
behlendo [Mon, 21 Apr 2008 22:44:11 +0000 (22:44 +0000)]
More fixes to ensure we get good debug logs even if we're in the
process of destroying the stacks.  Threshhold set fairly aggressively
top 80% of stack usage.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@82 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoAdded 4 missing subsystem flags
behlendo [Mon, 21 Apr 2008 18:43:02 +0000 (18:43 +0000)]
Added 4 missing subsystem flags

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@81 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoWhoops, missed an instance where we could recursively stack check... bad.
behlendo [Mon, 21 Apr 2008 18:16:04 +0000 (18:16 +0000)]
Whoops, missed an instance where we could recursively stack check... bad.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@80 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoHandful of minor stack checking fixes
behlendo [Mon, 21 Apr 2008 18:08:33 +0000 (18:08 +0000)]
Handful of minor stack checking fixes

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@79 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoUpdate SPL to use new debug infrastructure. This means:
behlendo [Mon, 21 Apr 2008 17:29:47 +0000 (17:29 +0000)]
Update SPL to use new debug infrastructure.  This means:
- Replacing all BUG_ON()'s with proper ASSERT()'s
- Using ENTRY,EXIT,GOTO, and RETURN macro to instument call paths

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@78 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoFrist minor batch of fixes. Catch a dropped ;, and use SBUG instead of BUG.
behlendo [Sat, 19 Apr 2008 00:02:11 +0000 (00:02 +0000)]
Frist minor batch of fixes.  Catch a dropped ;, and use SBUG instead of BUG.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@77 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoWhoops need this!
behlendo [Fri, 18 Apr 2008 23:42:45 +0000 (23:42 +0000)]
Whoops need this!

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@76 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoFirst commit of lustre style internal debug support. These
behlendo [Fri, 18 Apr 2008 23:39:58 +0000 (23:39 +0000)]
First commit of lustre style internal debug support.  These
changes bring over everything lustre had for debugging with
two exceptions.  I dropped by the debug daemon and upcalls
just because it made things a little easier.  They can be
readded easily enough if we feel they are needed.

Everything compiles and seems to work on first inspection
but I suspect there are a handful of issues still lingering
which I'll be sorting out right away.  I just wanted to get
all these changes commited and safe.  I'm getting a little
paranoid about losing them.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@75 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years ago * modules/spl/spl-kmem.c : Make sure to disable interrupts
wartens2 [Wed, 16 Apr 2008 16:37:51 +0000 (16:37 +0000)]
    * modules/spl/spl-kmem.c : Make sure to disable interrupts
        when necessary to avoid deadlocks.  We were seeing the deadlock
        when calling kmem_cache_generic_constructor() and then an interrupt
        forced us to end up calling kmem_cache_generic_destructor()
        which caused our deadlock.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@74 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years ago- Add some spinlocks to cover all the private data in the mutex. I don't
behlendo [Tue, 15 Apr 2008 20:53:36 +0000 (20:53 +0000)]
- Add some spinlocks to cover all the private data in the mutex.  I don't
think this should fix anything but it's a good idea regardless.

- Drop the lock before calling the construct/destructor for the slab
otherwise we can't sleep in a constructor/destructor and for long running
functions we may NMI.

- Do something braindead, but safe for the console debug logs for now.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@73 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoJust cleanup up an error case to avoid overspamming the console.
behlendo [Mon, 14 Apr 2008 18:37:20 +0000 (18:37 +0000)]
Just cleanup up an error case to avoid overspamming the console.
We get the stack once from the BUG() no reason to dump it twice.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@72 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoAdd hw_serial support based on a usermodehelper which runs
behlendo [Sat, 12 Apr 2008 04:27:59 +0000 (04:27 +0000)]
Add hw_serial support based on a usermodehelper which runs
at spl module load time can calls hostid.  The resolved hostid
is then fed back in to a proc entry for latter use.  It's
not a pretty thing, but it will work for now.  The hw_serial
is required for things such as 'zpool status' to work.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@71 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoAdjust the condition variables to simply sleep uninteruptibly.
behlendo [Fri, 11 Apr 2008 22:49:48 +0000 (22:49 +0000)]
Adjust the condition variables to simply sleep uninteruptibly.
This way we don't have to contend with superious wakeups which
it appears ZFS is not so careful to handle anyway.  So this is
probably for the best.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@70 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years ago- Add more strict in_atomic() checking to the mutex entry
behlendo [Fri, 11 Apr 2008 17:03:57 +0000 (17:03 +0000)]
- Add more strict in_atomic() checking to the mutex entry
function just to be extra safety and paranoid.

- Rewrite the thread shim to take full advantage of the
new kernel kthread API.  This greatly simplifies things.

- Add a new regression test for thread_exit() to ensure
it properly terminates a thread immediately without
allowing futher execution of the thread.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@69 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoFix race in rwlock implementation which can occur when
behlendo [Mon, 7 Apr 2008 23:54:34 +0000 (23:54 +0000)]
Fix race in rwlock implementation which can occur when
your task is rescheduled to a different cpu after you've
taken the lock but before calling RW_LOCK_HELD is called.
We need the spinlock to ensure there is a wmb() there.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@68 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years ago- Fix write-only behavior in vn-open()
behlendo [Fri, 4 Apr 2008 17:08:12 +0000 (17:08 +0000)]
- Fix write-only behavior in vn-open()
- Ensure we have at least 1 write-only splat test
- Fix return codes for vn_* Solaris does not use negative return
  codes in the kernel.  So linux errno's must be inverted.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@67 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoUpdate the thread shim to use the current kernel threading API.
behlendo [Fri, 4 Apr 2008 04:44:16 +0000 (04:44 +0000)]
Update the thread shim to use the current kernel threading API.
We need to use kthread_create() here for a few reasons.  First
off to old kernel_thread() API functioin will be going away.
Secondly, and more importantly if I use kthread_create() we can
then properly implement a thread_exit() function which terminates
the kernel thread at any point with do_exit().  This fixes our
cleanup bug which was caused by dropping a mutex twice after
thread_exit() didn't really exit.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@66 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoCorrectly implement atomic_cas_ptr() function. Ideally all of these
behlendo [Thu, 3 Apr 2008 21:48:57 +0000 (21:48 +0000)]
Correctly implement atomic_cas_ptr() function.  Ideally all of these
atomic operations will be rewritten anyway with the correct arch
specific assembly.  But not today.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@65 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years ago- Remapped ldi_handle_t to struct block_device * which is much more useful
behlendo [Thu, 3 Apr 2008 16:33:31 +0000 (16:33 +0000)]
- Remapped ldi_handle_t to struct block_device * which is much more useful
- Added liunx block device headers to sunldi.h
- Made __taskq_dispatch safe for interrupt context where it turns out we
  need to be useing it.
- Fixed NULL const/dest bug for kmem slab caches
- Places debug __dprintf debugging messages under a spin_lock_irqsave
  so it's safe to use then in interrupt handlers.  For debugging only!

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@64 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoApparently it's OK for done to be NULL, which was not clear in the
behlendo [Tue, 1 Apr 2008 17:00:06 +0000 (17:00 +0000)]
Apparently it's OK for done to be NULL, which was not clear in the
Solaris man page.  Anyway, since apparently this usage is accectable
I've updated the function to handle it.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@63 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoDouble large kmalloc warning size to 4 pages. It was 2 pages, and ideally
behlendo [Tue, 1 Apr 2008 16:09:18 +0000 (16:09 +0000)]
Double large kmalloc warning size to 4 pages.  It was 2 pages, and ideally
it should be dropped to one page but in the short term we should be able
to easily live with 4 page allocations.

Fix the nvlist bug, it turns out the user space side of things were
packing the nvlists correctly as little endian, and the kernel space
side of things due to a missing #define were unpacking them as big endian.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@62 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoEnsure all file ops pointer are NULL or we may end up
behlendo [Tue, 1 Apr 2008 03:24:17 +0000 (03:24 +0000)]
Ensure all file ops pointer are NULL or we may end up
calling garbage pointers on open/close etc and get
what look like random crashes.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@61 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoAdd vmem_zalloc support.
behlendo [Mon, 31 Mar 2008 23:04:07 +0000 (23:04 +0000)]
Add vmem_zalloc support.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@60 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoAdd some crude debugging support. It leaves alot to be
behlendo [Mon, 31 Mar 2008 20:42:36 +0000 (20:42 +0000)]
Add some crude debugging support.  It leaves alot to be
desired, but it should allow more easy kernel debugging for now.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@59 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoFixed that.
behlendo [Fri, 28 Mar 2008 18:22:29 +0000 (18:22 +0000)]
Fixed that.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@58 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoCorrectly functioning 64-bit atomic shim layer. It's not
behlendo [Fri, 28 Mar 2008 18:21:09 +0000 (18:21 +0000)]
Correctly functioning 64-bit atomic shim layer.  It's not
what I would call effecient but it does have the advantage
of being correct which is all I need right now.  I added
a regression test as well.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@57 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoRemove minor lingering CDDL tait of copied headers. Required
behlendo [Thu, 27 Mar 2008 23:40:09 +0000 (23:40 +0000)]
Remove minor lingering CDDL tait of copied headers.  Required
headers rewritten to include minimally what we need.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@56 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years ago- Thinko fix to the SPL module interface
behlendo [Thu, 27 Mar 2008 22:06:59 +0000 (22:06 +0000)]
- Thinko fix to the SPL module interface
- Enhanse the VERIFY() support to output the values which
  failed to compare as expected before crashing.  This make
  debugging much much much easier.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@55 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoRelocated to zfs repo
behlendo [Thu, 27 Mar 2008 17:58:10 +0000 (17:58 +0000)]
Relocated to zfs repo

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@54 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoTwo fixes to the module interface. Could be worse!
behlendo [Fri, 21 Mar 2008 19:16:25 +0000 (19:16 +0000)]
Two fixes to the module interface.  Could be worse!

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@53 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoOK, a first reasonable attempt at a solaris module/chdev shim layer.
behlendo [Thu, 20 Mar 2008 23:30:15 +0000 (23:30 +0000)]
OK, a first reasonable attempt at a solaris module/chdev shim layer.
This should handle the absolute minimum I need for ZFS.  It will
register the chdev with the right callbacks.  Then the generic
registered linux callback will find the right registered solaris
callback for the function and munge the args just right before
passing it on.  Should work, but untested (just compiled), so I
expect bugs.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@52 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoOK, some pretty substantial rework here. I've merged the spl-file
behlendo [Tue, 18 Mar 2008 23:20:30 +0000 (23:20 +0000)]
OK, some pretty substantial rework here.  I've merged the spl-file
stuff which only inclused the getf()/releasef() in to the vnode area
where it will only really be used.  These calls allow a user to
grab an open file struct given only the known open fd for a particular
user context.  ZFS makes use of these, but they're a bit tricky to
test from within the kernel since you already need the file open
and know the fd.  So we basically spook the system calls to setup
the environment we need for the splat test case and verify given
just the know fd we can get the file, create the needed vnode, and
then use the vnode interface as usual to read and write from it.

While I was hacking away I also noticed a NULL termination issue
in the second kobj test case so I fixed that too.  In fact, I fixed
a few other things as well but all for the best!

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@51 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoInitial pass at a file API getf/releasef hooks
behlendo [Tue, 18 Mar 2008 04:56:43 +0000 (04:56 +0000)]
Initial pass at a file API getf/releasef hooks

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@50 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoMinimal signal handling interface.
behlendo [Mon, 17 Mar 2008 18:29:57 +0000 (18:29 +0000)]
Minimal signal handling interface.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@49 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoMissing headers, more minor fixes
behlendo [Sat, 15 Mar 2008 00:05:38 +0000 (00:05 +0000)]
Missing headers, more minor fixes

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@48 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoFix kmem memory accounting
behlendo [Fri, 14 Mar 2008 20:56:26 +0000 (20:56 +0000)]
Fix kmem memory accounting

Adjust kmem slab interface to make a copy of the slab name before
passing it on to the linux slab (we free it latter too)

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@47 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoFix KMEM_DEBUG support (enable by default)
behlendo [Fri, 14 Mar 2008 19:04:41 +0000 (19:04 +0000)]
Fix KMEM_DEBUG support (enable by default)
Add vmem_alloc/vmem_free support (and test case)
Add missing time functions

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@46 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoAdd missing headers
behlendo [Fri, 14 Mar 2008 00:04:01 +0000 (00:04 +0000)]
Add missing headers
Rework vnodes to be based on the slab cache, just like on Solaris.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@45 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoAdd missing headers
behlendo [Thu, 13 Mar 2008 22:52:23 +0000 (22:52 +0000)]
Add missing headers

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@44 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoAdd two more missing headers
behlendo [Thu, 13 Mar 2008 20:41:29 +0000 (20:41 +0000)]
Add two more missing headers

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@43 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoDrop unicode support, provided in ZFS tree libport
behlendo [Thu, 13 Mar 2008 19:49:09 +0000 (19:49 +0000)]
Drop unicode support, provided in ZFS tree libport
Update uio support

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@42 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years ago- Add some more missing headers
behlendo [Wed, 12 Mar 2008 23:48:28 +0000 (23:48 +0000)]
- Add some more missing headers
- Map the LE/BE_* byteorder macros to the linux versions
- More minor vnodes fixes

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@41 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoAdd copyin/copyout mapping
behlendo [Wed, 12 Mar 2008 21:33:28 +0000 (21:33 +0000)]
Add copyin/copyout mapping
Fix some vnode types

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@40 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years ago- Implemented vnode interfaces and 6 test cases to the test suite.
behlendo [Wed, 12 Mar 2008 20:52:46 +0000 (20:52 +0000)]
- Implemented vnode interfaces and 6 test cases to the test suite.
- Re-implmented kobj support based on the vnode support.
- Add TESTS option to check.sh, and removed delay after module load.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@39 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoApply fix from bug239 for rwlock deadlock.
behlendo [Tue, 11 Mar 2008 20:54:40 +0000 (20:54 +0000)]
Apply fix from bug239 for rwlock deadlock.

Update check.sh script to take V=1 env var so you can run it verbosely as
follows if your chasing something: sudo make check V=1

Add new kobj api and needed regression tests to allow reading of files from
within the kernel.  Normally thats not something I support but the spa layer
needs the support for its config file.

Add some more missing stub headers

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@38 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoTwo more GPL only symbols moved to helper functions in the spl module.
behlendo [Tue, 11 Mar 2008 02:08:57 +0000 (02:08 +0000)]
Two more GPL only symbols moved to helper functions in the spl module.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@37 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoRemap gethrestime() with #define to new symbol and export that new
behlendo [Mon, 10 Mar 2008 21:38:39 +0000 (21:38 +0000)]
Remap gethrestime() with #define to new symbol and export that new
symbol to avoid direct use of GPL only symbol.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@36 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoAdd some typedefs to make it clearer when we passing a function,
behlendo [Mon, 10 Mar 2008 19:25:20 +0000 (19:25 +0000)]
Add some typedefs to make it clearer when we passing a function,
Add fm_panic define
Add another bad atomic hack (need to do this right)

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@35 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoFix systemic naming mistake
behlendo [Mon, 10 Mar 2008 19:04:14 +0000 (19:04 +0000)]
Fix systemic naming mistake

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@34 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoAdd missing headers
behlendo [Mon, 10 Mar 2008 17:05:34 +0000 (17:05 +0000)]
Add missing headers

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@33 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoJust filling in more of the env.
behlendo [Sat, 8 Mar 2008 00:58:32 +0000 (00:58 +0000)]
Just filling in more of the env.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@32 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoAdd somre debugging support
behlendo [Sat, 8 Mar 2008 00:18:21 +0000 (00:18 +0000)]
Add somre debugging support

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@31 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoAdd the initial vestigates of vnode support
behlendo [Fri, 7 Mar 2008 23:07:02 +0000 (23:07 +0000)]
Add the initial vestigates of vnode support

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@30 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoAdd missing cred.h functions
behlendo [Fri, 7 Mar 2008 20:48:44 +0000 (20:48 +0000)]
Add missing cred.h functions
Resolve compiler warning with kmem_free (unused len)
Add stub for byteorder.h
Add zlib shim for compress2 and uncompress functions

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@29 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoMinor atomic cleanup, this needs to be done right.
behlendo [Fri, 7 Mar 2008 00:28:32 +0000 (00:28 +0000)]
Minor atomic cleanup, this needs to be done right.
Fixed a bug in the timer code
Added missing macros

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@28 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoAdd some missing rw_lock symbols
behlendo [Thu, 6 Mar 2008 23:42:37 +0000 (23:42 +0000)]
Add some missing rw_lock symbols

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@27 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoAdd highbit func,
behlendo [Thu, 6 Mar 2008 23:12:55 +0000 (23:12 +0000)]
Add highbit func,
Add sloopy atomic declaration which will need to be fixed (eventually)
Fill out more of the Solaris VM hooks
Adjust the create_thread function

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@26 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoCheckpoint for the night,
behlendo [Wed, 5 Mar 2008 00:58:54 +0000 (00:58 +0000)]
Checkpoint for the night,
added a few more stub headers,
fleshed out a few stub headers,
added a FIXME file,
added various compatibility macros

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@25 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoRemove spl.h, just include the headers you need.
behlendo [Tue, 4 Mar 2008 20:06:29 +0000 (20:06 +0000)]
Remove spl.h, just include the headers you need.
Add a few more stubs.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@24 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoFix type
behlendo [Tue, 4 Mar 2008 19:38:27 +0000 (19:38 +0000)]
Fix type

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@23 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoMore stub headers,
behlendo [Tue, 4 Mar 2008 18:22:31 +0000 (18:22 +0000)]
More stub headers,
moved generic to sysmacros,
added some more macros for kernel compatibility

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@22 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoStub out some missing headers which are expected. I'll fill
behlendo [Sat, 1 Mar 2008 18:30:12 +0000 (18:30 +0000)]
Stub out some missing headers which are expected.  I'll fill
in what the contents need to be as I encounter the warnings
about missing prototypes, symbols, and such.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@21 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoRemaining lose ends
behlendo [Sat, 1 Mar 2008 00:51:41 +0000 (00:51 +0000)]
Remaining lose ends

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@20 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoAlmost dropped this!
behlendo [Sat, 1 Mar 2008 00:47:23 +0000 (00:47 +0000)]
Almost dropped this!

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@19 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoReorganize /include/ to add a /sys/, this way we don't need to
behlendo [Sat, 1 Mar 2008 00:45:59 +0000 (00:45 +0000)]
Reorganize /include/ to add a /sys/, this way we don't need to
muck with #includes in existing Solaris style source to get it
to find the right stuff.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@18 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoMinor nit, SOLARIS should be SPL
behlendo [Thu, 28 Feb 2008 00:52:31 +0000 (00:52 +0000)]
Minor nit, SOLARIS should be SPL

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@17 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoOK, I think this is the last of major cleanup and restructuring.
behlendo [Thu, 28 Feb 2008 00:48:31 +0000 (00:48 +0000)]
OK, I think this is the last of major cleanup and restructuring.
We've dropped all the linux- prefixes on the file in favor of spl-
which makes more sense.  And we've cleaned up some of the includes
so everybody should be including their own dependencies properly.
All a module which wants to use the spl support needs to do in
include spl.h and ensure it has access to Module.symvers.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@16 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoAdd top level make check target which runs the validation
behlendo [Thu, 28 Feb 2008 00:16:24 +0000 (00:16 +0000)]
Add top level make check target which runs the validation
suite.  Careful with this right now one of the tests still
causes a lockup on the node.  This happened before the move
from the ZFS repo so its not a new issue.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@15 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoMore cleanup.
behlendo [Wed, 27 Feb 2008 23:42:31 +0000 (23:42 +0000)]
More cleanup.
- Removed all references to kzt and replaced with splat
- Moved portions of include files which do not need to be
  available to all source files in to local.h files in
  proper source subdirs.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@14 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

16 years agoOK, it builds... and the modules load... now for some more
behlendo [Wed, 27 Feb 2008 21:56:51 +0000 (21:56 +0000)]
OK, it builds... and the modules load...  now for some more
cleanup to remove the remaining vestages of the time it lives
with the ZFS code.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@13 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c