aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* * include/sys/sunddi.h, modules/spl/spl-module.c : Removed defaultbehlendo2008-11-135-47/+83
| | | | | | | | | | | udev support from sunddi implementation because it uses GPL-only symbols. This support is optionally available for SPL consumers if they define HAVE_GPL_ONLY_SYMBOLS and license their module as GPL using the MODULE_LICENSE("GPL") macro. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@179 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Prep for spl-0.3.4 tag.behlendo2008-11-062-1/+22
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@177 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Remove 3 instances of unused variables.behlendo2008-11-052-3/+0
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@176 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Add proper error handling for the case where a thread can not bebehlendo2008-11-051-5/+12
| | | | | | | | | | created. Instead of asserting we simply abort the test, wait for any tasks we created to finish, and return -ESRCH back to the user space component. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@175 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Slightly increase SPLAT_NAME_SIZE to ensure string is alwaysbehlendo2008-11-051-1/+1
| | | | | | | NULL terminated. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@174 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Fix a small corner case in the test infrastructure wherebehlendo2008-11-041-2/+2
| | | | | | | | we might end up with a non-NULL terminated buffer if the test name or desc is too long. Only copy N-1 bytes. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@173 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* 3 minor fixups where sprintf() was used instead of snprintf() withbehlendo2008-11-043-6/+7
| | | | | | | | | a known max length. Additionally the function return value is cast to void to make it explicit that the value is not needed. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@172 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Removed useless checkbehlendo2008-11-042-17/+8
| | | | | | | | Fix forward NULL in splat kmem_cache test ctors/dtors git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@171 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Add missing error handling to this case where a memory allocation fails.behlendo2008-11-041-2/+7
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@170 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Simple ignore the return type which was never used here and cast it to void.behlendo2008-11-041-2/+2
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@169 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Add proper error handling to one of the atomic test cases in the event behlendo2008-11-041-5/+15
| | | | | | | that a kernel thread cannot be properly spawned. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@168 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Add missing initializer which is needed in an unlikely error case.behlendo2008-11-041-1/+1
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@167 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Ensure GPL-only symbols are re-exported as GPL-onlybehlendo2008-11-042-11/+7
| | | | | | | | Remove GPL-only symbol from __gethrtime() git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@166 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* * spl-09-fix-kmem-track-oops.patchbehlendo2008-11-032-12/+56
| | | | | | | | | | | | | | | | This fixes an oops when unloading the modules, in the case where memory tracking was enabled and there were memory leaks. The comment in the code explains what was the problem. * spl-10-fix-assert-verify-ndebug.patch This fixes ASSERT*() and VERIFY*() macros in non-debug builds. VERIFY*() macros are supposed to check the condition and panic even in production builds, and ASSERT*() macros don't need to evaluate the arguments. Also some 32-bit fixes. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@165 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Under Solaris KM_SLEEP ensures success (or at least you hang forever). behlendo2008-11-031-1/+1
| | | | | | | | | | | | That said when working with a finite resource like memory failure really is always a possibility. It would be far better longer term if the ZFS code could be weened off this assumption and properly handle the cases where an allocation fails. Still I've applied the patch to spl-0.3.4 since this layer is supposed to emulate Solaris as closely as possible. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@164 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Add a SPL_AC_TYPE_ATOMIC64_T test to configure for systems which dobehlendo2008-11-036-359/+485
| | | | | | | | | | | | | | | already supprt atomic64_t types. * spl-07-kmem-cleanup.patch This moves all the debugging code from sys/kmem.h to spl-kmem.c, because the huge macros were hard to debug and were bloating functions that allocated memory. I also fixed some other minor problems, including 32-bit fixes and a reported memory leak which was just due to using the wrong free function. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@163 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Apply two nice improvements caught by Ricardo,behlendo2008-11-037-54/+85
| | | | | | | | | | | | | spl-05-div64.patch This is a much less intrusive fix for undefined 64-bit division symbols when compiling the DMU in 32-bit kernels. * spl-06-atomic64.patch This is a workaround for 32-bit kernels that don't have atomic64_t. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@162 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Apply a nice fix caught by Ricardo,behlendo2008-11-032-21/+21
| | | | | | | | | | | * spl-04-fix-taskq-spinlock-lockup.patch Fixes a deadlock in the BIO completion handler, due to the taskq code prematurely re-enabling interrupts when another spinlock had disabled them in the IDE IRQ handler. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@161 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Reviewed and applied spl-01-rm-gpl-symbol-set_cpus_allowed.patchbehlendo2008-11-032-73/+76
| | | | | | | | | | | from Ricardo which removes a dependency on the GPL-only symbol set_cpus_allowed(). Using this symbol is simpler but in the name of portability we are adopting a spinlock based solution here to remove this dependency. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@160 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Reviewed and applied spl-00-rm-gpl-symbol-notifier_chain.patch behlendo2008-11-033-103/+35
| | | | | | | | | | from Ricardo which removes a dependency on the GPL-only symbol needed for a panic time notifier. This funcationality was never used and this improves our portability. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@159 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Minor tweak to handle systems with restrictive udev rulesbehlendo2008-08-121-1/+15
| | | | | | | or older systems which are not using udev at all. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@158 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Sigh more compat fixes, this is almost right for 2.6.9 - 2.6.26 kernels.behlendo2008-08-116-19/+32
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@157 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Pull in initial 32-bit support patches.behlendo2008-08-115-1/+112
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@156 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Commit bulk of remaining 2.6.9 and 2.6.26 compat changes.behlendo2008-08-1112-93/+222
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@155 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Include linux/uaccess.h compat changes.behlendo2008-08-117-8/+27
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@154 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* More 2.6.26 compat changesbehlendo2008-08-116-6/+46
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@153 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Pull in timespec, list, and type compat changes to supportbehlendo2008-08-116-15/+145
| | | | | | | | building against a wider range of kernels. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@152 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Resolve incomplete type when building against 2.6.26behlendo2008-08-111-0/+1
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@151 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Add class / device portability code. Two autoconf testsbehlendo2008-08-108-44/+103
| | | | | | | | | | | were added to cover the 3 possible APIs from 2.6.9 to 2.6.26. We attempt to use the newest interfaces and if not available fallback to the oldest. This a rework of some changes proposed by Ricardo for RHEL4. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@150 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Pull in fls64 compat changes from spl-00-rhel4-compat.patch,behlendo2008-08-063-0/+38
| | | | | | | | to allow greater compatibility with kernels pre 2.6.16. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@149 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Start bringing in Ricardo's spl-00-rhel4-compat.patch, a few chunksbehlendo2008-08-055-121/+3
| | | | | | | | | | | | | | | | | | | at a time as I audit it. This chunk finishes moving the SPL entirely off the linux slab on to the SPL implementation. It differs slightly from the proposed version in that the spl continues to export to all the Solaris types and functions. These do conflict with the Linux slab so a module usings these interfaces must not include the SPL slab if they also intend to use the linux slab. Or they must explcitly #undef the macros which remap the functioin to their spl_* equivilants. A nice side of effect of dropping the entire linux slab is we don't need to autoconf checks anymore. They kept messing with the slab API endlessly! git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@148 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Apply Ricardo's spl-02-condvar-poison.patchbehlendo2008-08-041-1/+1
| | | | | | | | Fix too early memory poisoning on condvars. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@147 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Trivial commit to remove whitespacebehlendo2008-07-091-1/+0
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@146 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Fix race in kmem_locking testbehlendo2008-07-071-4/+6
| | | | | | | | Reduce max memory usage for kmem_locking tests (for low memory machines) git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@145 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Two easy fixes I caught with debug enabledbehlendo2008-07-011-3/+2
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@143 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Update info to prep for a tag. If all goes well I'll havebehlendo2008-07-012-1/+10
| | | | | | | something I'm not too embarased to distrubute tommorow. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@142 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* - Remove hash functionality from slab in favor of direct lookupsbehlendo2008-07-014-349/+232
| | | | | | | | | | | | | | | | | | | | | | | based of the spl_kmem_obj_t tacked on the end of each object. This actually isn't so back because we are now allocing large chunks for the slab and partitioning it ourselves. So there's not a ton of wasted space. We may suffer a performance hit however due to alignment issues. - Remove remaining depenancies on the linux slab implementation. We're standing on our own now for better or worse. - Rework slabs to be either kmem or vmem based. If neither KMC_VMEM of KMC_KMEM are specified we make a decent guess about what will work best for their based on the object size. Additionally we provide a kmem_virt() function caller can use to see if they have a virtual or physical address. - Minor fixups in the test suite. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@141 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Remove stray call to spl_cache_free() and remove all thebehlendo2008-06-283-53/+2
| | | | | | | | | | | | cycle count which was costing me overhead. It was hurting performance pretty badly for heavily used caches. I'm also thinking the hash may be hurting me as well and it might be worth sticking a pointer in to a little space after the alloced object. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@140 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Victory! I've reworked caches with large objects which arebehlendo2008-06-283-87/+198
| | | | | | | | | | | | | | based by vmalloc()'ed memory. I now alloc a slab which is roughly 32*spl_obj_size and in this block of memory I place the slab descriptor, slab object descriptors, and objects themselves. This greatly reduces vmalloc lock contention. Still some minor cleanup remains and fine tuning but it's working pretty well. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@139 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Further slab improvements, I'm getting close to something which works behlendo2008-06-275-95/+357
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | well for the expected workloads. Improvement in this commit include: - Added DEBUG_KMEM_TRACKING #define which can optionally be set when DEBUG_KMEM is defined to do per allocation tracking. This allows us to get all the lightweight kmem debugging enabled by default which is pretty light weight, and only when looking for a memory leak we can briefly enable the per alloc tracking. - Added set_normalized_timespec() in to SPL to simply using the timespec() primatives from within a module. - Added per-spinlock cycle counters to the slab in an attempt to run down a lock contention issue. The contended lock was in vmalloc() but I'm going to leave the cycle counters in place for a little while until I'm convinced there arn't other locking improvement possible in the slab. - Added a proc interface to the slab to export per slab cache statistics to /proc/spl/kmem/slab for analysis. - Reworked spl_slab_alloc() function to allocate from kmem for small allocation and vmem for large allocations. This improved things considerably but futher work is needed. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@138 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Fix for memory corruption caused by overruning the magazinebehlendo2008-06-263-63/+95
| | | | | | | | | | when repopulating it. Plus I fixed a few more suble races in that part of the code which were catching me. Finally I fixed a small race in kmem_test8. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@137 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Implement per-cpu local caches. This seems to have bough me another behlendo2008-06-255-146/+404
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | factor of 10x improvement on SMP system due to reduced lock contention. This may put me in the ballpark of what is needed. We can still further improve things on NUMA systems by creating an additional L3 cache per memory node instead of the current global pool. With luck this won't be needed. I should also take another look at the locking now that everything is working. There's a good chance I can tighten it up a little bit and improve things a little more. kmem_lock: time (sec) slabs objs hash kmem_lock: tot/max/calc tot/max/calc size/depth kmem_lock: 0.000999926 6/6/1 192/192/32 32768/0 kmem_lock: 0.000999926 4/4/2 128/128/64 32768/0 kmem_lock: 0.000999926 4/4/4 128/128/128 32768/0 kmem_lock: 0.000999926 4/4/8 128/128/256 32768/0 kmem_lock: 0.000999926 4/4/16 128/128/512 32768/0 kmem_lock: 0.000999926 4/4/32 128/128/1024 32768/0 kmem_lock: 0.000999926 4/4/64 128/128/2048 32768/0 kmem_lock: 0.000999926 8/8/128 256/256/4096 32768/0 kmem_lock: 0.003999704 24/23/256 768/736/8192 32768/1 kmem_lock: 0.012999038 44/41/512 1408/1312/16384 32768/1 kmem_lock: 0.051996153 96/93/1024 3072/2976/32768 32768/2 kmem_lock: 0.181986536 187/184/2048 5984/5888/65536 32768/3 kmem_lock: 0.655951469 342/339/4096 10944/10848/131072 32768/4 git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@136 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* The first locking issue was due to the semaphore I used. I was tryingbehlendo2008-06-243-35/+41
| | | | | | | | | | | | | | | | | | | | | | | to be overly clever and the context switch when the semaphore was busy was destroying performance. Converting to a simple spin lock bough me a factor of 50 or so. That said it's still not good enough. Tests show bad performance and we are still CPU bound. The logical fix is I need to implement per-cpu hot caches to minimize the SMP contention. Linux and Solaris both have this, I was hoping to do without but it looks like that's not to be. kmem_lock: time (sec) slabs objs hash kmem_lock: tot/max/calc tot/max/calc size/depth kmem_lock: 0.022000000 7/6/64 224/177/2048 32768/1 kmem_lock: 0.039000000 13/13/128 416/404/4096 32768/1 kmem_lock: 0.079000000 23/21/256 736/672/8192 32768/1 kmem_lock: 0.158000000 48/47/512 1536/1504/16384 32768/1 kmem_lock: 0.345000000 105/105/1024 3360/3358/32768 32768/2 kmem_lock: 0.760000000 202/200/2048 6464/6400/65536 32768/3 git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@135 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Add another kmem test to check for lock contention in the slabbehlendo2008-06-231-0/+158
| | | | | | | | | | | | | | | | | | | | | | | allocator. I have serious contention issues here and I needed a way to easily measure how much the following batch of changes will improve things. Currently things are quite bad when the allocator is highly contended, and interestingly it seems to get worse in a non-linear fashion... I'm not sure why yet. I'll figure it out tomorrow. kmem:kmem_lock Pass kmem_lock: time (sec) slabs objs kmem_lock: tot/max/calc tot/max/calc kmem_lock: 0.061000000 75/60/64 2400/1894/2048 kmem_lock: 0.157000000 134/125/128 4288/3974/4096 kmem_lock: 0.471000000 263/249/256 8416/7962/8192 kmem_lock: 2.526000000 518/499/512 16576/15957/16384 kmem_lock: 14.393000000 990/978/1024 31680/31270/32768 git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@134 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Fix minor chaos/fc9 kernel discrepencies in buildbehlendo2008-06-132-7/+21
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@133 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* * : modules/sys/kmem-slab.c : Re-implemented the slab to nobehlendo2008-06-137-569/+875
| | | | | | | | | | longer be based on the linux slab but to be its own complete implementation. The new slab behaves much more like the Solaris slab than the Linux slab. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@132 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Minor tweak to ensure kstat values are printed correctly on x86_64 at leastbehlendo2008-06-061-3/+3
| | | | | | | Additionally fix a minor typo in the .ul ULONG case. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@131 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Prep for 0.3.2 tagbehlendo2008-06-042-1/+11
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@129 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Add missing () to quiet warnings in NDEBUG casebehlendo2008-06-041-1/+1
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@128 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Fix some bad grammerbehlendo2008-06-041-1/+1
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@127 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c