Reduce max kmem based slab size

Allowing MAX_ORDER-1 sized allocations for kmem based slabs have
been observed to result in deadlocks.  To help prvent this limit
max kmem based slab size to MAX_ORDER-3.  Just for the record
callers should not be creating slabs like this, but if they do
we should still handle it as safely as we can.
This commit is contained in:
Brian Behlendorf 2010-03-18 13:39:51 -07:00
parent c5c3d402f7
commit aa600d8a38

View File

@ -1057,7 +1057,7 @@ spl_slab_size(spl_kmem_cache_t *skc, uint32_t *objs, uint32_t *size)
obj_size = spl_obj_size(skc);
if (skc->skc_flags & KMC_KMEM)
max_size = ((uint32_t)1 << (MAX_ORDER-1)) * PAGE_SIZE;
max_size = ((uint32_t)1 << (MAX_ORDER-3)) * PAGE_SIZE;
else
max_size = (32 * 1024 * 1024);