zfsonlinux/spl — pull request #147 by ryao (2012-08-01 10:14:08+00:00)
Title: Use Linux SLAB allocator for SPL SLABs

The SPL SLAB code relied on __vmalloc() for its allocations. The Linux kernel ignores flags passed to __vmalloc(), which required a kernel patch to avoid deadlock. We replace this allocation with allocations from the Linux SLAB to avoid this.

The maximum allocation size of __vmalloc() far exceeded the maximum slab size of the Linux kernel. The kernel is not prepared to satisfy allocations of such size under low memory conditions, which can also caused deadlocks. We change the maximum SLAB size to the maximum supported by Linux to avoid that.

Allocations of spl_kmem_slab_t structures were particularly large, which required suppressing a warning. It could potentially cause failures under the right conditions when loading the module. We replace these allocations with allocations from the SLAB allocator, which should eliminate such problems. It also enables us to do allocations in a way that minimizes the potential for false sharing, which should improve the performance of the SPL SLAB code.

These changes make the SPL SLAB implementation a wrapper for the Linux SLAB allocator. The Linux SLAB objects are the SPL slabs from which SPL SLAB objects are created. This is the partial rewrite I promised in zfsonlinux/spl#145.