Skip to content

Commit

Permalink
Fixes: openzfs#8934 Large kmem_alloc
Browse files Browse the repository at this point in the history
Large allocation over the spl_kmem_alloc_warn value was being performed.
Switched to vmem_alloc interface as specified for large allocations.
Changed the subsequent frees to match.

Reviewed-by: Tom Caputi <tcaputi@datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: nmattis <nickm970@gmail.com>
Closes openzfs#8934
Closes openzfs#9011
  • Loading branch information
nmattis authored and tonyhutter committed Aug 22, 2019
1 parent 07ddf7d commit 10dc94e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions module/zfs/vdev_indirect_births.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ vdev_indirect_births_close(vdev_indirect_births_t *vib)
if (vib->vib_phys->vib_count > 0) {
uint64_t births_size = vdev_indirect_births_size_impl(vib);

kmem_free(vib->vib_entries, births_size);
vmem_free(vib->vib_entries, births_size);
vib->vib_entries = NULL;
}

Expand Down Expand Up @@ -108,7 +108,7 @@ vdev_indirect_births_open(objset_t *os, uint64_t births_object)

if (vib->vib_phys->vib_count > 0) {
uint64_t births_size = vdev_indirect_births_size_impl(vib);
vib->vib_entries = kmem_alloc(births_size, KM_SLEEP);
vib->vib_entries = vmem_alloc(births_size, KM_SLEEP);
VERIFY0(dmu_read(vib->vib_objset, vib->vib_object, 0,
births_size, vib->vib_entries, DMU_READ_PREFETCH));
}
Expand Down Expand Up @@ -148,10 +148,10 @@ vdev_indirect_births_add_entry(vdev_indirect_births_t *vib,
vib->vib_phys->vib_count++;
new_size = vdev_indirect_births_size_impl(vib);

new_entries = kmem_alloc(new_size, KM_SLEEP);
new_entries = vmem_alloc(new_size, KM_SLEEP);
if (old_size > 0) {
bcopy(vib->vib_entries, new_entries, old_size);
kmem_free(vib->vib_entries, old_size);
vmem_free(vib->vib_entries, old_size);
}
new_entries[vib->vib_phys->vib_count - 1] = vibe;
vib->vib_entries = new_entries;
Expand Down

0 comments on commit 10dc94e

Please sign in to comment.