]> git.proxmox.com Git - mirror_zfs.git/commit
Convert zio_buf_alloc() consumers
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 30 Nov 2016 23:18:20 +0000 (16:18 -0700)
committerGitHub <noreply@github.com>
Wed, 30 Nov 2016 23:18:20 +0000 (16:18 -0700)
commita3fd9d9e1525d5df18b7f8c2895270689d292ec2
treefb38211398d59ccbd9376b2e3aa52924af133255
parent7657defc48b7c47a8bf0c8f21c78783d293dc5ed
Convert zio_buf_alloc() consumers

In multiple cases zio_buf_alloc() was used instead of kmem_alloc()
or vmem_alloc().  This was often done because the allocations
could be large and it was easy to use zfs_buf_alloc() for them.

But this isn't ideal for allocations which are small or short
lived.  In these cases it is better to use kmem_alloc() or
vmem_alloc().  If possible we want to avoid the case where
we have slabs allocated for kmem caches which are rarely used.

Note for small allocations vmem_alloc() will be internally
converted to kmem_alloc().  Therefore as long as large
allocations are infrequent and short lived the penalty for
using vmem_alloc() is small.

Reviewed-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #5409
module/zfs/dbuf.c
module/zfs/sa.c
module/zfs/space_map.c
module/zfs/zap_micro.c
module/zfs/zfs_sa.c