]> granicus.if.org Git - zfs/commit
Avoid 128K kmem allocations in mzap_upgrade()
authorBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 5 Aug 2014 20:46:49 +0000 (13:46 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 11 Aug 2014 23:10:32 +0000 (16:10 -0700)
commit4dd18932ba4cfdcf9b16609f6a80c2d6c239cb15
tree74f3f43d07e47d6847ec0f40511de492f0ec3af1
parent50b25b2187134ac7b19cf93bd35a420223f1d343
Avoid 128K kmem allocations in mzap_upgrade()

As originally implemented the mzap_upgrade() function will
perform up to SPA_MAXBLOCKSIZE allocations using kmem_alloc().
These large allocations can potentially block indefinitely
if contiguous memory is not available.  Since this allocation
is done under the zap->zap_rwlock it can appear as if there is
a deadlock in zap_lockdir().  This is shown below.

The optimal fix for this would be to rework mzap_upgrade()
such that no large allocations are required.  This could be
done but it would result in us diverging further from the other
implementations.  Therefore I've opted against doing this
unless it becomes absolutely necessary.

Instead mzap_upgrade() has been updated to use zio_buf_alloc()
which can reliably provide buffers of up to SPA_MAXBLOCKSIZE.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <ryao@gentoo.org>
Close #2580
module/zfs/zap_micro.c