On 11/12/2013 10:38 AM, Alexander Motin wrote: > Hi. > > While doing some performance tests I've found that LZ4 compression in > ZFS on FreeBSD each time allocates hash memory directly from VM, that on > multi-core system under significant load may consume more CPU time then > the compression itself. On 64-bit illumos that memory is allocated on > stack, but FreeBSD's kernel stack is smaller and has no sufficient space > (16K). I've made quite simple patch to reduce the allocation overhead by > creating allocation cache, same as it is done for ZIO. While for 64bit > illumos this patch is a nop, smaller architectures may still benefit > from it, same as FreeBSD does. > > Any comments about it: http://people.freebsd.org/~mav/lz4_alloc.patch ? >
The original ZFS LZ4 code did this allocation on the stack, but that was changed to kmem_alloc() after stack overruns were observed. ZFSOnLinux merged the LZ4 code before Illumos switched to kmem_alloc(). Since Linux has 8KB stacks, this was changed to kmem_cache_alloc() out of necessity as part of the merge. It would be nice to see this change make its way to other implementations, even if only to reduce code differences.
signature.asc
Description: OpenPGP digital signature
_______________________________________________ developer mailing list [email protected] http://lists.open-zfs.org/mailman/listinfo/developer
