]> git.proxmox.com Git - mirror_spl.git/commit - module/spl/spl-kmem.c
Optimize vmem_alloc() retry path
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 30 Jan 2015 00:08:25 +0000 (16:08 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 2 Feb 2015 18:57:56 +0000 (10:57 -0800)
commitc7db36a3c4ac768a74bd86778cc3535bdcb8d526
tree3ba5c7c1d6f8b6f28d9a26e7e373fcf39722ef02
parent54cccfc2e30fa84463c056e8ad04b2be9448999e
Optimize vmem_alloc() retry path

For performance reasons the reworked kmem code maps vmem_alloc() to
kmalloc_node() for allocations less than spa_kmem_alloc_max.  This
allows for more concurrency in the system and less contention of
the virtual address space.  Generally, this is a good thing.

However, in the case when the kmalloc_node() fails it makes little
sense to retry it using kmalloc_node() again.  It will likely fail
in exactly the same way.  A smarter strategy is to abandon this
optimization and retry using spl_vmalloc() which is very likely
to succeed.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ned Bass <bass6@llnl.gov>
Closes #428
module/spl/spl-kmem.c