aboutsummaryrefslogtreecommitdiffstats
path: root/modules/splat
Commit message (Collapse)AuthorAgeFilesLines
* Make the splat load message caps just for consistencyBrian Behlendorf2009-01-131-5/+5
|
* Rework ddi_strtox calls to a native implementation which actuall supports ↵Brian Behlendorf2009-01-134-5/+241
| | | | the EINVAL, ERANGE error handling, plus add a regression suite to ensure I got it atleast mostly right
* Add active test for splat list testsBrian Behlendorf2009-01-071-2/+68
|
* Add 5 splat tests for list handlingBrian Behlendorf2009-01-074-11/+425
|
* Add system taskq supportBrian Behlendorf2009-01-051-5/+44
|
* Remove 3 instances of unused variables.behlendo2008-11-051-2/+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
* 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-041-1/+2
| | | | | | | | | 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-041-14/+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 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
* Sigh more compat fixes, this is almost right for 2.6.9 - 2.6.26 kernels.behlendo2008-08-112-4/+7
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@157 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Commit bulk of remaining 2.6.9 and 2.6.26 compat changes.behlendo2008-08-111-3/+14
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@155 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Include linux/uaccess.h compat changes.behlendo2008-08-111-5/+0
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@154 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* More 2.6.26 compat changesbehlendo2008-08-112-1/+6
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@153 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-102-35/+10
| | | | | | | | | | | 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
* 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
* - Remove hash functionality from slab in favor of direct lookupsbehlendo2008-07-011-11/+32
| | | | | | | | | | | | | | | | | | | | | | | 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
* Victory! I've reworked caches with large objects which arebehlendo2008-06-281-16/+34
| | | | | | | | | | | | | | 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-271-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-261-1/+2
| | | | | | | | | | 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-251-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-241-5/+7
| | | | | | | | | | | | | | | | | | | | | | | 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
* * : modules/sys/kmem-slab.c : Re-implemented the slab to nobehlendo2008-06-131-105/+205
| | | | | | | | | | 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
* Fix missing return resulting in a double unlock of &files->file_lockbehlendo2008-06-032-2/+3
| | | | | | | | | | | and a hang on subsequent sys_close. I'm not quite sure why the Fedora kernel caught this bug the Chaos kernel did not, but I'm glad! Convert remaining BUG_ON's to ASSERTs git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@122 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Breaking the world for a little bit. If anyone is going to continuebehlendo2008-06-023-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Go through and add a header with the proper UCRL number.behlendo2008-05-2614-11/+347
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@114 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Lots of fixes here:behlendo2008-05-062-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* New an improved taskq implementation for the SPL. It allows abehlendo2008-04-251-5/+13
| | | | | | | | | | | 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
* - Add more strict in_atomic() checking to the mutex entrybehlendo2008-04-111-26/+90
| | | | | | | | | | | | | | | 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 write-only behavior in vn-open()behlendo2008-04-042-2/+2
| | | | | | | | | | | - 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
* Add some crude debugging support. It leaves alot to bebehlendo2008-03-311-18/+18
| | | | | | | 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-284-0/+197
| | | | | | | | | | 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
* OK, a first reasonable attempt at a solaris module/chdev shim layer.behlendo2008-03-201-2/+2
| | | | | | | | | | | | | 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-186-67/+126
| | | | | | | | | | | | | | | | | | | | 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-185-3/+66
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@50 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Fix kmem memory accountingbehlendo2008-03-141-0/+12
| | | | | | | | | 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
* Fix KMEM_DEBUG support (enable by default)behlendo2008-03-141-2/+43
| | | | | | | | | 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
* Add copyin/copyout mappingbehlendo2008-03-121-4/+4
| | | | | | | | Fix some vnode types git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@40 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* - Implemented vnode interfaces and 6 test cases to the test suite.behlendo2008-03-125-5/+383
| | | | | | | | | - 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
* Apply fix from bug239 for rwlock deadlock.behlendo2008-03-114-0/+144
| | | | | | | | | | | | | | | 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
* Fix systemic naming mistakebehlendo2008-03-101-3/+3
| | | | git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@34 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Add highbit func,behlendo2008-03-061-1/+1
| | | | | | | | | | 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
* Remove spl.h, just include the headers you need.behlendo2008-03-041-1/+15
| | | | | | | | Add a few more stubs. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@24 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
* Reorganize /include/ to add a /sys/, this way we don't need tobehlendo2008-03-011-1/+1
| | | | | | | | | 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
* OK, I think this is the last of major cleanup and restructuring.behlendo2008-02-281-16/+2
| | | | | | | | | | | | 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
* More cleanup.behlendo2008-02-2711-812/+1001
| | | | | | | | | | | - 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
* OK, everything builds now. My initial intent was to place all ofbehlendo2008-02-2710-0/+3169
the directories at the top level but that proved troublesome. The kernel buildsystem and autoconf were conflicting too much. To resolve the issue I moved the kernel bits in to a modules directory which can then only use the kernel build system. We just pass along the likely make targets to the kernel build system. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@11 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c