dmu_buf_will_dirty could be faster
For some workloads (e.g. deletion of files whose indirect blocks are cached), the time is dominated by spa_sync() repeatedly calling dmu_buf_will_dirty() on the same dbufs (e.g. the dataset's ds_dbuf, the bpobj's bpo_cached_dbuf and bpo_dbuf).
We can improve the performance of dmu_buf_will_dirty() by adding a fast path for already-dirty bufs.
In the example workload (removal of files whose indirect blocks are cached), this fix doubled performance.
trunk bits: dmu_buf_will_dirty() uses 40% of (non-idle) CPU
with fix: dmu_buf_will_dirty() uses <3% of (non-idle) CPU
Updated by Electric Monk over 4 years ago
- % Done changed from 0 to 100
- Status changed from New to Closed
commit 0f2e7d03b8f588387cb8dd8dd500cbe5ff4484e0 Author: Matthew Ahrens <email@example.com> Date: 2015-10-09T17:44:48.000Z 6288 dmu_buf_will_dirty could be faster Reviewed by: George Wilson <firstname.lastname@example.org> Reviewed by: Paul Dagnelie <email@example.com> Reviewed by: Justin Gibbs <firstname.lastname@example.org> Reviewed by: Richard Elling <Richard.Elling@RichardElling.com> Approved by: Robert Mustacchi <email@example.com>