diff options
author | Brian Behlendorf <[email protected]> | 2014-08-05 13:46:49 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2014-08-11 16:10:32 -0700 |
commit | 4dd18932ba4cfdcf9b16609f6a80c2d6c239cb15 (patch) | |
tree | 74f3f43d07e47d6847ec0f40511de492f0ec3af1 /include/sys | |
parent | 50b25b2187134ac7b19cf93bd35a420223f1d343 (diff) |
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 <[email protected]>
Signed-off-by: Richard Yao <[email protected]>
Close #2580
Diffstat (limited to 'include/sys')
0 files changed, 0 insertions, 0 deletions