summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* Go through and add a header with the proper UCRL number.behlendo2008-05-2623-2/+600
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@114 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* - Properly fix the debug support for all the ASSERT's, VERIFIES, etc can bebehlendo2008-05-195-16/+46
| | | | | | | | | | | | | | | | | | | 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
* SPL additions to increase support for updated ZFS buildbehlendo2008-05-155-8/+24
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@110 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Rework condition variable implementation to be consistent withbehlendo2008-05-151-153/+23
| | | | | | | | | 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
* Add a comment so I remember to fix this.behlendo2008-05-121-0/+5
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@106 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* By default disable extra KMEM and MUTEX debugging to aid performance.behlendo2008-05-092-16/+13
| | | | | | | | 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
* Stability hack. Under Solaris when KM_SLEEP is set kmem_cache_alloc()behlendo2008-05-091-6/+6
| | | | | | | | | | | 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
* Add an almost feature complete implemenation of kstat. I chosebehlendo2008-05-082-96/+134
| | | | | | | | | | 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
* Decrease of kmem warnign threshold back to 2 pages, no worse than a stack.behlendo2008-05-071-2/+3
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@100 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Add vmem memory accountingbehlendo2008-05-071-26/+69
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@99 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* - Relocate 'stats_per' in to proper /proc/sys/spl/mutex/ directorybehlendo2008-05-071-1/+1
| | | | | | | | - 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
* Remaining issues fixed after reenabled mutex debugging.behlendo2008-05-061-3/+2
| | | | | | | | | - 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
* - Updated rwlock's to reside in a .c file instead of a static inlinebehlendo2008-05-062-283/+34
| | | | | | | | - 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
* Lots of fixes here:behlendo2008-05-061-24/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* Commit adaptive mutexes. This seems to have introduced some newbehlendo2008-05-053-164/+78
| | | | | | | | | | | | | 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
* New an improved taskq implementation for the SPL. It allows abehlendo2008-04-253-64/+83
| | | | | | | | | | | 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
* Update kmem.h to properly use new debug subsystem.behlendo2008-04-241-10/+23
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@92 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Prep for 0.2.1 tagbehlendo2008-04-244-22/+31
| | | | | | | | | 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
* Make sure that when calling __vmem_alloc that wewartens22008-04-241-2/+5
| | | | | | | | | 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
* Minor improvement to taskq handling. This is a small step towardsbehlendo2008-04-231-1/+1
| | | | | | | 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
* Stack usage is my enemy. Trade cpu cycles in the debug code tobehlendo2008-04-223-62/+55
| | | | | | | | | | | | | | | | | 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
* More fixes to ensure we get good debug logs even if we're in thebehlendo2008-04-211-24/+28
| | | | | | | | | 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
* Handful of minor stack checking fixesbehlendo2008-04-211-3/+3
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@79 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Update SPL to use new debug infrastructure. This means:behlendo2008-04-2110-94/+130
| | | | | | | | | - 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
* Frist minor batch of fixes. Catch a dropped ;, and use SBUG instead of BUG.behlendo2008-04-191-3/+4
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@77 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Whoops need this!behlendo2008-04-181-0/+21
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@76 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* First commit of lustre style internal debug support. Thesebehlendo2008-04-183-25/+323
| | | | | | | | | | | | | | | | | 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
* - Add some spinlocks to cover all the private data in the mutex. I don'tbehlendo2008-04-151-12/+46
| | | | | | | | | | | | | 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
* Just cleanup up an error case to avoid overspamming the console.behlendo2008-04-141-4/+2
| | | | | | | 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
* Adjust the condition variables to simply sleep uninteruptibly.behlendo2008-04-111-69/+32
| | | | | | | | | 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
* - Add more strict in_atomic() checking to the mutex entrybehlendo2008-04-111-0/+17
| | | | | | | | | | | | | | | 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
* Fix race in rwlock implementation which can occur whenbehlendo2008-04-071-0/+4
| | | | | | | | | 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
* Update the thread shim to use the current kernel threading API.behlendo2008-04-041-4/+5
| | | | | | | | | | | | | | 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
* Correctly implement atomic_cas_ptr() function. Ideally all of thesebehlendo2008-04-031-12/+10
| | | | | | | | 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
* - Remapped ldi_handle_t to struct block_device * which is much more usefulbehlendo2008-04-031-4/+7
| | | | | | | | | | | | | - 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
* Apparently it's OK for done to be NULL, which was not clear in thebehlendo2008-04-011-1/+5
| | | | | | | | 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
* Double large kmalloc warning size to 4 pages. It was 2 pages, and ideallybehlendo2008-04-012-1/+65
| | | | | | | | | | | | | 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
* Add vmem_zalloc support.behlendo2008-03-311-11/+18
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@60 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Add some crude debugging support. It leaves alot to bebehlendo2008-03-314-5/+12
| | | | | | | 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
* Correctly functioning 64-bit atomic shim layer. It's notbehlendo2008-03-281-11/+64
| | | | | | | | | | 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
* Remove minor lingering CDDL tait of copied headers. Requiredbehlendo2008-03-277-1650/+93
| | | | | | | | headers rewritten to include minimally what we need. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@56 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* - Thinko fix to the SPL module interfacebehlendo2008-03-272-12/+15
| | | | | | | | | | - 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
* Relocated to zfs repobehlendo2008-03-271-0/+0
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@54 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Two fixes to the module interface. Could be worse!behlendo2008-03-211-2/+1
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@53 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* OK, a first reasonable attempt at a solaris module/chdev shim layer.behlendo2008-03-205-6/+207
| | | | | | | | | | | | | 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
* OK, some pretty substantial rework here. I've merged the spl-filebehlendo2008-03-183-36/+17
| | | | | | | | | | | | | | | | | | | | 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
* Initial pass at a file API getf/releasef hooksbehlendo2008-03-184-0/+44
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@50 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Minimal signal handling interface.behlendo2008-03-172-0/+25
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@49 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Missing headers, more minor fixesbehlendo2008-03-156-3/+50
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@48 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Fix kmem memory accountingbehlendo2008-03-141-19/+24
| | | | | | | | | 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