]> git.proxmox.com Git - mirror_spl.git/commit
Fix vmem_size()
authorUbuntu <ubuntu@ip-172-31-16-145.us-west-1.compute.internal>
Fri, 28 Oct 2016 20:56:38 +0000 (20:56 +0000)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 2 Nov 2016 17:34:19 +0000 (10:34 -0700)
commit1b457bcbe502eb29333a34b0518c1dca0e2ee974
tree6f1bf489e55c479b950c896dd372d2247b408174
parent7b25c48e6ec6aa55bd5fead2d57ade01bfb0777b
Fix vmem_size()

Add a minimal implementation of vmem_size() which accounts for the
virtual memory usage of the SPL's kmem cache.  This functionality
is only useful on 32-bit systems with a small virtual address space.

The following assumptions are made:

  1) The major SPL consumer of virtual memory is the kmem cache.
  2) Memory allocated with vmem_alloc() is short lived and can be ignored.
  3) Allow a 4MB floor as a generous pad given normal consumption.
  4) The spl_kmem_cache_sem only contends with cache create/destroy.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
module/spl/spl-vmem.c
module/splat/splat-kmem.c