* The bundirty() move interfered with softupdates because the buf_complete() callback can re-dirty the buffer. * Fixed by moving the bundirty() prior to the buf_complete() call. Reported-by: marino
* Fix more deadlocks. The solution here is not ideal, I'm doing too much unlocking and relocking of clusters and probably breaking certain atomicy requirements. * Implement a delayed flush mechanism when making permanent chain deletions instead of calling hammer2_flush(). This should allow the flush code to better optimize-out unnecessary write I/Os. * Add a spinlock for the ip->cluster (not completed yet). * I had broken system-initated filesystem syncing by calling vclrisdirty() on the syncer vnode. Fix it.
Last Changed Date: 2015-05-25 02:16:10 +0200 (Mon, 25 May 2015)
* Do not resolve the cluster when locking and unlocking. This led to problems when cparents used in iterations were being temporarily unlocked, because their nodes represent the iteration in the physical topology so the resolve might fail when relocked. Instead, resolution occurs with all cluster creation mechanics. So, e.g. hammer2_cluster_lookup() and hammer2_cluster_next() will resolve the cluster being returned. * Change hammer2_cluster_copy() semantics to inherit focus state and not call hammer2_cluster_resolve(), for the same reason as above. * A cluster iteration usually returns NULL when the focus is lost, e.g. when only unsynchronized slaves remain. Add a flag so the sync thread can iterate the cluster until all nodes are exhausted. * Cleanup focus handling for the cluster iterator. Move the bref compare to the resolver and get rid of the manual compare code in the iterator. * Fix a locking flags bug in the cluster iterator. * Fix numerous deadlocks. Mostly requires unlocking the whole cluster before looping the iterator for new elements, so later indexes are not held locked while working on earlier indexes. * Fix numerous issues in syncthr, in particular only repoint the index of the cluster the syncthr is managing when updating the inode to avoid clashes with inode updates from other syncthrs. * Change the way HAMMER2_CITEM_INVALID works in syncthr so we can be more hard-nosed about it in the cluster iterator. Generally speaking we clear the INVALID bit when synchronizing a new element, even if it is a recursion and modify_tid cannot be immediately set.
The backtrace library requires unwind.h to build. This file was never created, so the base GCC's would fall back to the version in /usr/libdata. Clang compilers from ports don't have unwind.h so they were failing on the world build (building gcc50). This modification makes unwind.h available for backtrace.c and allows the build to complete with WORLD_CCVER=clang36
* Set cpu_idle_hlt default to 1 for Intel Haswell or later cpus. These cpus do major power management in the HLT instruction. Leave cpu_idle_hlt default at 2 for AMD cpus or older Intel cpus. These cpus do not do major management in the HLT instruction and ACPI entry is required to reduce idle power consumption.
* When doing a write BIO, do not bundirty() the buffer prior to issuing the vn_strategy(). Instead, bundirty() the buffer when the I/O is complete, primarily in bpdone(). The I/O's data buffer is protected during the operation by vfs_busy_pages(), so related VM pages cannot be modified while the write is running. And, of course, the buffer itself is locked exclusively for the duration of the opeartion. Thus this change should NOT introduce any redirtying races. * This change ensures that vp->v_rbdirty_tree remains non-empty until all related write I/Os have completed, removing a race condition for code which checks vp->v_rbdirty_tree to determine e.g. if a file requires synchronization or not. This race could cause problems because the system buffer flusher might be in the midst of flushing a buffer just as a filesystem decides to sync and starts checking vp->v_rbdirty_tree. * This should theoretically fix a long-standing but difficult-to-reproduce bug in HAMMER1 where a backend flush occurs at an inopportune time.