summaryrefslogtreecommitdiffstats
path: root/module
Commit message (Collapse)AuthorAgeFilesLines
* Lower minimum objects/slab thresholdBrian Behlendorf2014-11-051-0/+9
| | | | | | | | | As long as we can fit a minimum of one object/slab there's no reason to prevent the creation of the cache. This effectively pushes the maximum object size up to 32MB. The splat cache tests were extended accordingly to verify this functionality. Signed-off-by: Brian Behlendorf <[email protected]>
* Fix modules installation directoryAlexander Pyhalov2014-10-281-1/+2
| | | | | | | | | When building zfs modules with kernel, compiled from deb.src, the packaging process ends up installing the modules in the wrong place. Signed-off-by: Alexander Pyhalov <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes zfsonlinux/zfs#2822
* kmem_cache: Call constructor/destructor on each alloc/freeRichard Yao2014-10-281-21/+16
| | | | | | | | | | | | | | This has a few benefits. First, it fixes a regression that "Rework generic memory allocation interfaces" appears to have triggered in splat's slab_reap and slab_age tests. Second, it makes porting code from Illumos to ZFSOnLinux easier. Third, it has the side effect of making reclaim from slab caches that specify reclaim functions an order of magnitude faster. The splat slab_reap test usually took 30 to 40 seconds. With this change, it takes 3 to 4. Signed-off-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #369
* Linux 3.12 compat: shrinker semanticsTim Chase2014-10-282-25/+50
| | | | | | | | | | | | | | | The new shrinker API as of Linux 3.12 modifies "struct shrinker" by replacing the @shrink callback with the pair of @count_objects and @scan_objects. It also requires the return value of @count_objects to return the number of objects actually freed whereas the previous @shrink callback returned the number of remaining freeable objects. This patch adds support for the new @scan_objects return value semantics and updates the splat shrinker test case appropriately. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Tim Chase <[email protected]> Closes #403
* Remove kern_path() wrapperBrian Behlendorf2014-10-171-16/+0
| | | | | | | The kern_path() function has been available since Linux 2.6.28. There is no longer a need to maintain this compatibility code. Signed-off-by: Brian Behlendorf <[email protected]>
* Remove kvasprintf() wrapperBrian Behlendorf2014-10-171-23/+0
| | | | | | | The kvasprintf() function has been available since Linux 2.6.22. There is no longer a need to maintain this compatibility code. Signed-off-by: Brian Behlendorf <[email protected]>
* Remove proc_handler() wrapperBrian Behlendorf2014-10-171-21/+39
| | | | | | | | As of Linux 2.6.32 the proc handlers where updated to expect only five arguments. Therefore there is no longer a need to maintain this compatibility code and this infrastructure can be simplified. Signed-off-by: Brian Behlendorf <[email protected]>
* Remove credential configure checks.Brian Behlendorf2014-10-171-94/+0
| | | | | | | | | | | The groups_search() function was never exported by a mainline kernel therefore we drop this compatibility code and always provide our own implementation. Additionally, the cred_t structure has been available since 2.6.29 so there is no longer a need to maintain compatibility code. Signed-off-by: Brian Behlendorf <[email protected]>
* Remove set_fs_pwd() configure checkBrian Behlendorf2014-10-171-12/+10
| | | | | | | | | | | This function has never been exported by any mainline and was only briefly available under RHEL5. Therefore this check is being removed and the code update to always use the wrapper function. The next step will be to eliminate all this code. If ZFS were updated not to assume that it's pwd was / there would be no need for this. Signed-off-by: Brian Behlendorf <[email protected]>
* Remove user_path_dir() wrapperBrian Behlendorf2014-10-171-20/+0
| | | | | | | The user_path_dir() function has been available since Linux 2.6.27. There is no longer a need to maintain this compatibility code. Signed-off-by: Brian Behlendorf <[email protected]>
* Remove kallsyms_lookup_name() wrapperBrian Behlendorf2014-10-172-122/+1
| | | | | | | | | | After the removable of get_vmalloc_info(), the unused global memory variables, and the optional dcache/icache shrinkers there is no longer a need for the kallsyms compatibility code. This allows us to eliminate another brittle area of the code by removing the kernel upcall this functionality depended on for older kernels. Signed-off-by: Brian Behlendorf <[email protected]>
* Remove shrink_{i,d}node_cache() wrappersBrian Behlendorf2014-10-173-109/+15
| | | | | | | | | This is optional functionality which may or may not be useful to ZFS when using older kernels. It is never a hard requirement. Therefore this functionality is being removed from the SPL and a simpler slimmed down version will be added to ZFS. Signed-off-by: Brian Behlendorf <[email protected]>
* Remove global memory variablesBrian Behlendorf2014-10-173-342/+2
| | | | | | | | | | | | | | | | | | | | Platforms such as Illumos and FreeBSD have historically provided global variables which summerize the memory state of a system. Linux on the otherhand doesn't expose any of this information to kernel modules and uses entirely different mechanisms for memory management. In order to simplify the original ZFS port to Linux these global variables were emulated by the SPL for the benefit of ZFS. As ZoL has matured over the years it has moved steadily away from these interfaces and now no longer depends on them at all. Therefore, this patch completely removes the global variables availrmem, minfree, desfree, lotsfree, needfree, swapfs_minfree, and swapfs_reserve. This greatly simplifies the memory management code and eliminates a common area of confusion. Signed-off-by: Brian Behlendorf <[email protected]>
* Remove get_vmalloc_info() wrapperBrian Behlendorf2014-10-172-112/+4
| | | | | | | | | | | | | | | The get_vmalloc_info() function was used to back the vmem_size() function. This was always problematic and resulted in brittle code because the kernel never provided a clean interface for modules. However, it turns out that the only caller of this function in ZFS uses it to determine the total virtual address space size. This can be determined easily without get_vmalloc_info() so vmem_size() has been updated to take this approach which allows us to shed the get_vmalloc_info() dependency. Signed-off-by: Brian Behlendorf <[email protected]>
* Remove on_each_cpu() wrapperBrian Behlendorf2014-10-171-1/+1
| | | | | | | The on_each_cpu() function has been available since Linux 2.6.27. There is no longer a need to maintain this compatibility code. Signed-off-by: Brian Behlendorf <[email protected]>
* Remove i_mutex() configure checkBrian Behlendorf2014-10-171-1/+1
| | | | | | | | | | | The inode structure has used i_mutex as its internal locking primitive since 2.6.16. The compatibility code to check for the previous semaphore primitive has been removed. However, the wrapper function itself is being kept because it's entirely possible this primitive will change again to allow finer grained locking. Signed-off-by: Brian Behlendorf <[email protected]>
* Simplify the time compatibility wrappersBrian Behlendorf2014-10-172-95/+0
| | | | | | | | | | Many of the time functions had grown overly complex in order to handle kernel compatibility issues. However, as of Linux 2.6.26 all the required functionality is available. This allows us to retire numerous configure checks and greatly simplify the time compatibility wrappers. Signed-off-by: Brian Behlendorf <[email protected]>
* Map highbit64() to fls64()Brian Behlendorf2014-10-172-63/+1
| | | | | | | | The fls64() function has been available since Linux 2.6.16 and it should be used to implemented highbit64(). This allows us to provide an optimized implementation and simplify the code. Signed-off-by: Brian Behlendorf <[email protected]>
* Remove CTL_UNNUMBERED sysctl interfaceBrian Behlendorf2014-10-171-167/+4
| | | | | | | | | Support for the CTL_UNNUMBERED sysctl interface was removed in Linux 2.6.19. There is no longer any reason to maintain this compatibility code. There also issue any reason to keep around the CTL_NAME macro and helpers so they have been retired. Signed-off-by: Brian Behlendorf <[email protected]>
* Remove register_sysctl() compatibility codeBrian Behlendorf2014-10-171-3/+3
| | | | | | | The register_sysctl() interface has been stable since Linux 2.6.21. There is no longer a need to maintain compatibility code. Signed-off-by: Brian Behlendorf <[email protected]>
* Remove utsname() wrapperBrian Behlendorf2014-10-171-12/+0
| | | | | | | | | There is no longer a need to wrap this because utsname() is provided by the kernel and can be called directly. This will require a small change in the ZFS code because utsname is expected to be a global structure and not a function. Signed-off-by: Brian Behlendorf <[email protected]>
* Remove sysctl_vfs_cache_pressure assumptionBrian Behlendorf2014-10-171-1/+1
| | | | | | | | | | | | | The generic SPL cache shrinkers make the assumption that the caches only contain VFS cache data and therefore should be scaled based on vfs_cache_pressure. This is not strictly true and it should not be assumed. Removing this tuning should not have any impact on the stock behavior because vfs_cache_pressure=100 by default. This means that no scaling will take place. Signed-off-by: Brian Behlendorf <[email protected]>
* Remove adaptive mutex implementationBrian Behlendorf2014-10-171-41/+0
| | | | | | | | Since the Linux 2.6.29 kernel all mutexes have been adaptive mutexs. There is no longer any point in keeping this code so it is being removed to simplify the code. Signed-off-by: Brian Behlendorf <[email protected]>
* Update code to use misc_register()/misc_deregister()Brian Behlendorf2014-10-172-70/+21
| | | | | | | | | | | | | | | | | | When the SPL was originally written it was designed to use the device_create() and device_destroy() functions. Unfortunately, these functions changed considerably over the years making them difficult to rely on. As it turns out a better choice would have been to use the misc_register()/misc_deregister() functions. This interface for registering character devices has remained stable, is simple, and provides everything we need. Therefore the code has been reworked to use this interface. The higher level ZFS code has always depended on these same interfaces so this is also as a step towards minimizing our kernel dependencies. Signed-off-by: Brian Behlendorf <[email protected]>
* Update SPLAT to use kmutex_t for portabilityBrian Behlendorf2014-10-173-21/+26
| | | | | | | For consistency throughout the code update the SPLAT infrastructure to use the wrapped mutex interfaces. Signed-off-by: Brian Behlendorf <[email protected]>
* Make license compatibility checks consistentBrian Behlendorf2014-10-172-4/+4
| | | | | | | Apply the license specified in the META file to ensure the compatibility checks are all performed consistently. Signed-off-by: Brian Behlendorf <[email protected]>
* Fix bug in SPLAT taskq:frontBrian Behlendorf2014-10-031-1/+2
| | | | | | | | | | | While running SPLAT on a kernel with CONFIG_DEBUG_ATOMIC_SLEEP enabled the taskq:front was flagged as a test which might sleep which in an unsafe context. Specifically, the splat_vprint() function which internally takes a mutex was being called under a spin lock. Moving the log function outside the spin lock cleanly solves this issue. Signed-off-by: Brian Behlendorf <[email protected]>
* Linux 3.16 compat: smp_mb__after_clear_bit()Turbo Fredriksson2014-09-221-1/+1
| | | | | | | | | | | | | | | The smp_mb__{before,after}_clear_bit functions have been renamed smp_mb__{before,after}_atomic. Rather than adding a compatibility function to handle this the code has been updated to use smp_wmb(). This has the advantage of being a stable functionally equivalent interface. On many architectures smp_mb__after_clear_bit() expands to smp_wmb(). Others might be able to do something slightly more efficient but this will be safe and correct on all of them. Signed-off-by: Turbo Fredriksson <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #386
* Cleanup vn_rename() and vn_remove()Richard Yao2014-08-132-210/+101
| | | | | | | | | | | | | | zfsonlinux/spl#bcb15891ab394e11615eee08bba1fd85ac32e158 implemented Linux 3.6+ support by adding duplicate vn_rename and vn_remove functions. The new ones were cleaner, but the duplicate functions made the codebase less maintainable. This adds some compatibility shims that allow us to retire the older vn_rename and vn_remove in favor of the new ones on old kernels. The result is a net 143 line reduction in lines of code and a cleaner codebase. Signed-off-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #370
* Linux 3.17 compat: remove wait_on_bit action functionNed Bass2014-08-111-9/+2
| | | | | | | | | | | | | | | | | | | Linux kernel 3.17 removes the action function argument from wait_on_bit(). Add autoconf test and compatibility macro to support the new interface. The former "wait_on_bit" interface required an 'action' function to be provided which does the actual waiting. There were over 20 such functions in the kernel, many of them identical, though most cases can be satisfied by one of just two functions: one which uses io_schedule() and one which just uses schedule(). This API change was made to consolidate all of those redundant wait functions. References: torvalds/linux@7431620 Signed-off-by: Ned Bass <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #378
* Set spl_kmem_cache_slab_limit=16384 to defaultBrian Behlendorf2014-08-081-0/+10
| | | | | | | | | | | | For small objects the Linux slab allocator should be used to make the most efficient use of the memory. However, large objects are not supported by the Linux slab and therefore the SPL implementation is preferred. A cutoff of 16K was determined to be optimal for architectures using 4K pages. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: DHE <[email protected]> Issue #356 Closes #379
* Set spl_kmem_cache_reclaim=0 to defaultBrian Behlendorf2014-08-081-5/+6
| | | | | | | | | | | | Reinstate the correct default behavior of returning the number of objects in the cache for reclaim. This behavior was disabled in recent releases to do occasional reports of spinning in shrink_slabs(). Those issues have been resolved and can no longer can be reproduced. See commit 376dc35. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: DHE <[email protected]> Issue #358 Closes #379
* Add functions and macros as used upstream.Tim Chase2014-07-221-0/+30
| | | | | | | | | | | Added highbit64() and howmany() which are used in recent upstream code. Both highbit() and highbit64() should at some point be re-factored to use the optimized fls() and fls64() functions. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Prakash Surya <[email protected]> Signed-off-by: Tim Chase <[email protected]> Closes #363
* Rate limit debugging stack tracesBrian Behlendorf2014-07-222-8/+16
| | | | | | | | | | | | There have been issues in the past where excessive debug logging to the console has resulted in significant performance impacts. In the vast majority of these cases only a few stack traces are required to diagnose the issue. Therefore, stack traces dumped to the console will now we limited to 5 every 60s. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Prakash Surya <[email protected]> Closes #374
* Safer debugging and assertion macros.Tim Chase2014-07-011-0/+21
| | | | | | | | | | | | | | | | | | | | | | | Spl's debugging and assertion macros macro used the typical do/while(0) form for if/else friendliness, however, this limits their use in contexts where a do loop is not valid; such as within another multi-statement style macro. The following macros have been converted to not use do/while(0): PANIC, ASSERT, ASSERTF, VERIFY, VERIFY3_IMPL PANIC has been converted to a wrapper around the new spl_PANIC() function. The other macros have been converted to use the "&&" operator for the branch-predicition conditional and also to use spl_PANIC(). The __ASSERT() macro was not touched. It is only used by the debugging infrastructure and that code, including this macro, will be retired when the tracepoint patches are merged. Signed-off-by: Tim Chase <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #367
* Add spl_kmem_cache_reclaim module optionBrian Behlendorf2014-05-221-9/+20
| | | | | | | | | | | | | | | | | | | | | | The correct behavior for all registered shrinkers is to return the number of objects in their cache. In theory this allows the Linux VM to balance memory reclaim across all registered caches. In commit b9b3715 this behavior was disabled in favor of returning -1 which notifies the VM that no additional objects are available for reclaim. This was done as a workaround to resolve thrashing in shrink_slabs() which could occur when memory was low and numerous core where in reclaim. Unfortunately, this has been observed to increase the likelihood of OOM events when SPL slab consumers are responsible for consuming the majority of memory. Therefore, this patch makes this behavior tunable. Setting the spl_kmem_cache_reclaim module option to 0x1 will result in the shrinker only being called once. This is the default behavior. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Prakash Surya <[email protected]> Closes #358
* Add KMC_SLAB cache typeBrian Behlendorf2014-05-223-35/+178
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For small objects the Linux slab allocator has several advantages over its counterpart in the SPL. These include: 1) It is more memory-efficient and packs objects more tightly. 2) It is continually tuned to maximize performance. Therefore it makes sense to layer the SPLs slab allocator on top of the Linux slab allocator. This allows us to leverage the advantages above while preserving the Illumos semantics we depend on. However, there are some things we need to be careful of: 1) The Linux slab allocator was never designed to work well with large objects. Because the SPL slab must still handle this use case a cut off limit was added to transition from Linux slab backed objects to kmem or vmem backed slabs. spl_kmem_cache_slab_limit - Objects less than or equal to this size in bytes will be backed by the Linux slab. By default this value is zero which disables the Linux slab functionality. Reasonable values for this cut off limit are in the range of 4096-16386 bytes. spl_kmem_cache_kmem_limit - Objects less than or equal to this size in bytes will be backed by a kmem slab. Objects over this size will be vmem backed instead. This value defaults to 1/8 a page, or 512 bytes on an x86_64 architecture. 2) Be aware that using the Linux slab may inadvertently introduce new deadlocks. Care has been taken previously to ensure that all allocations which occur in the write path use GFP_NOIO. However, there may be internal allocations performed in the Linux slab which do not honor these flags. If this is the case a deadlock may occur. The path forward is definitely to start relying on the Linux slab. But for that to happen we need to start building confidence that there aren't any unexpected surprises lurking for us. And ideally need to move completely away from using the SPLs slab for large memory allocations. This patch is a first step. NOTES: 1) The KMC_NOMAGAZINE flag was leveraged to support the Linux slab backed caches but it is not supported for kmem/vmem backed caches. 2) Regardless of the spl_kmem_cache_*_limit settings a cache may be explicitly set to a given type by passed the KMC_KMEM, KMC_VMEM, or KMC_SLAB flags during cache creation. 3) The constructors, destructors, and reclaim callbacks are all functional and will be called regardless of the cache type. 4) KMC_SLAB caches will not appear in /proc/spl/kmem/slab due to the issues involved in presenting correct object accounting. Instead they will appear in /proc/slabinfo under the same names. 5) Several kmem SPLAT tests needed to be fixed because they relied incorrectly on internal kmem slab accounting. With the updated test cases all the SPLAT tests pass as expected. 6) An autoconf test was added to ensure that the __GFP_COMP flag was correctly added to the default flags used when allocating a slab. This is required to ensure all pages in higher order slabs are properly refcounted, see ae16ed9. 7) When using the SLUB allocator there is no need to attempt to set the __GFP_COMP flag. This has been the default behavior for the SLUB since Linux 2.6.25. 8) When using the SLUB it may be desirable to set the slub_nomerge kernel parameter to prevent caches from being merged. Original-patch-by: DHE <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Prakash Surya <[email protected]> Signed-off-by: Tim Chase <[email protected]> Signed-off-by: DHE <[email protected]> Signed-off-by: Chunwei Chen <[email protected]> Closes #356
* Linux 3.15: vfs_rename() added a flags argumentChunwei Chen2014-05-071-6/+12
| | | | | | | | | | | | Detect the updated vfs_rename() interface and call it with an extra flags argument. References: torvalds/linux@520c8b1 Signed-off-by: Chunwei Chen <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #355
* Evenly distribute the taskq threads across available CPUsAndrey Vesnovaty2014-04-251-0/+9
| | | | | | | | | | | | | | | The problem is described in commit aeeb4e0c0ae75b99ebbaa3056f0afc8e12949532. However, instead of disabling the binding to CPU altogether we just keep the last CPU index across calls to taskq_create() and thus achieve even distribution of the taskq threads across all available CPUs. The implementation based on assumption that task queues initialization performed in serial manner. Signed-off-by: Andrey Vesnovaty <[email protected]> Signed-off-by: Andrey Vesnovaty <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #336
* Fix crash when using ZFS on Ceph rbdChunwei Chen2014-04-251-1/+2
| | | | | | | | | | | | | | | When using __get_free_pages to get high order memory, only the first page's _count will set to 1, other's will be 0. When an internal page get passed into rbd, it will eventully go into tcp_sendpage. There, it will be called with get_page and put_page, and get freed erroneously when _count jump back to 0. The solution to this problem is to use compound page. All pages in a high order compound page share a single _count. So get_page and put_page in tcp_sendpage will not cause _count jump to 0. Signed-off-by: Chunwei Chen <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #251
* Change spl_kmem_cache_expire default setting to 2Richard Yao2014-04-141-3/+4
| | | | | | | | | This behavior is more consistent with the way memory reclaim is expected to work under Linux. Signed-off-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #349
* Expose max/min objs per slab and max slab sizeAndrey Vesnovaty2014-04-141-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | By default maximal number of objects in slab can't exceed (16*2 - 1) and slab size can't exceed 32M. Today's high end servers having couple hundreds of RAM available for ARC may run into a trouble with virtual memory because of the restriction mentioned above. Problem: Reasons for very high number of virtual memory allocations: * Real slab size very small relative to the size of the entire RAM * Slabs allocated on virtual memory and fill entire ARC The result is very high number of allocated virtual memory ranges (hundreds of ranges). When virtual memory subsystem manages high number of ranges its performance become so poor that it freezes from time to time. Solution: Number of objects per slab should be increased taking into account maximal slab size which can also be increased if needed. Signed-off-by: Andrey Vesnovaty <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #337
* Add ddi_time_after and friendsChunwei Chen2014-04-141-5/+5
| | | | | | | | | | | | | | When comparing times gotten from ddi_get_lbolt, we have to take account of wrap around of jiffies. Therefore, we cannot use 't1 < t2'. Instead we should use 't1 - t2 < 0'. This patch add ddi_time_after and friends to address this issue. They have strict type restriction, clock_t for vanilla and int64_t for 64 version, to prevent type conversion from screwing things. Signed-off-by: Chunwei Chen <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #335
* Simplify hostid logicRichard Yao2014-04-142-62/+6
| | | | | | | | | | | | | | | | | | There is plenty of compatibility code for a hw_hostid that isn't used by anything. At the same time, there are apparently issues with the current hostid logic. coredumb in #zfsonlinux on freenode reported that Fedora 17 changes its hostid on every boot, which required force importing his pool. A suggestion by wca was to adopt FreeBSD's behavior, where it treats hostid as zero if /etc/hostid does not exist Adopting FreeBSD's behavior permits us to eliminate plenty of code, including a userland helper that invokes the system's hostid as a fallback. Signed-off-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #224
* Call kthread_create() correctly with fixed arguments.Tim Chase2014-04-111-1/+4
| | | | | | | | | | | The kernel's kthread_create() function is defined as "..." and there is no va_list variant at the moment. The task name is pre-formatted into a local buffer and passed to kthread_create() with fixed arguments. Signed-off-by: Chunwei Chen <[email protected]> Signed-off-by: Tim Chase <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #347
* De-inline spl_kthread_create().Tim Chase2014-04-091-0/+28
| | | | | | | | | The function was defined as a static inline with variable arguments which causes gcc to generate errors on some distros. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Tim Chase <[email protected]> Closes #346
* Support post-3.13 kthread_create() semantics.Tim Chase2014-04-085-9/+10
| | | | | | | | | | | Provide spl_kthread_create() as a wrapper to the kernel's kthread_create() to provide pre-3.13 semantics. Re-try if the call is interrupted or if it would have returned -ENOMEM. Otherwise return NULL. Signed-off-by: Chunwei Chen <[email protected]> Signed-off-by: Tim Chase <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #339
* splat cred:groupmember: Fix false positivesBrian Behlendorf2014-04-082-28/+79
| | | | | | | | | | | | | | | | Due to certain assumptions made in the the cred:groupmember test it could result in false positives when run on specific distributions. This was solely a bug in the test case and not in the groupmember() function which the test case was validating. To prevent future false positives the test case has been rewritten to be both more rigerous and to make fewer assumptions about the system. Minor style cleanup was done to cr_groups_search() and groupmember() functions. Signed-off-by: Brian Behlendorf <[email protected]>
* splat kmem:slab_reclaim: Test cleanupBrian Behlendorf2014-04-081-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | By setting __GFP_NORETRY the kernel memory reclaim logic was allowed to abort early and dump a falled allocation stack to the console. Since this was done in a tight loop to fill memory it could result in a large number of stacks being dumped to the console. This in turn slowed down the test sufficiently so it exceeded the time limit and failed. To resolve this issue the __GFP_NORETRY flag is being removed. This is how it should have been called originally to ensure we're simulating the behavior of most callers which will use the GFP_KERNEL flag. In addition, the reclaim granularity of 1000 objects was far to coarse for this to be a realistic test. For kmem:slab_reclaim there might only be a few thousand objects total in the cache. Therefore, the SPLAT_KMEM_OBJ_RECLAIM constant for these tests was lowered. This will cause the reclaim callback to run more frequently which makes for a better test case. The frequency of the cache reaping in kmem:slab_reap was increased to accommodate the reduced number of objects released during the reclaim. These changes only impact the test cases and were done to remove false positives caused by the test case itself. Signed-off-by: Brian Behlendorf <[email protected]>
* Remove default taskq thread to CPU bindingsBrian Behlendorf2014-01-071-1/+0
| | | | | | | | | | | | | | | When this code was written it appears to have been assumed that every taskq would have a large number of threads. In this case it would make sense to attempt to evenly bind the threads over all available CPUs. However, it failed to consider that creating taskqs with a small number of threads will cause the CPUs with lower ids become over-subscribed. For this reason the kthread_bind() call is being removed and we're leaving the kernel to schedule these threads as it sees fit. Signed-off-by: Brian Behlendorf <[email protected]> Closes #325