git: hammer2 - stabilization, improvements
Matthew Dillon
dillon at crater.dragonflybsd.org
Tue Dec 3 18:03:55 PST 2013
commit 0924b3f8b02e204754852ec6897879a0373c98aa
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date: Tue Dec 3 17:52:24 2013 -0800
hammer2 - stabilization, improvements
* Improve hammer2_io hysteresis by keeping track of a simple activity
metric when figuring out what to free. Instead of cleaning out all
free hammer2_io structures the code now tries to clean out only half
of them when the hysteresis limit is reached.
* Remove some debug fields, add some debug fields.
* Refactor the memory load flush/wait code. Instead of tracking the number
of chain structures we track the number of MODIFIED chain structures,
and stage early flushes and resource memory use waits based on that.
* Add temporary debug procedure hammer2_chain_assert_not_present() which
asserts that a chain being created will not collide with a chain already
present.
* Fix a bug related to freeing non-stale chains that could corrupt the
flush algorithm.
* Fix bugs related to races between lookups and delete-duplicate operations.
Races can occur because a delete-duplicate does not lock the chain->above
core.
This was a nasty one. A delete-duplicate race can cause a lookup to
find a DELETE+DUPLICATED chain, but just testing the DUPLICATED bit
doesn't detect the race. Instead we have to test whether the bit has
changed between the spin-locked layer/RBTREE search and the locking of
the chain that was found.
* Fix a bug in h2ignore_deleted(). When a chain is DUPLICATED, the
delete_tid must be tested for any bref type. Not testing this was
allowing delete-duplicates on inodes to cause chains with the MOVED
flag set to be left dangling in the in-memory topology and never
get freed.
* Refactor the flush core a bit, in particular handle a case where
we were improperly clearing the MOVED bit for a chain which had
flush-deferred children.
* Remove some unused flags.
* Handle a hardlink shifted-upward race in hammer2_inode_lock_ex().
Summary of changes:
sys/vfs/hammer2/TODO | 2 +
sys/vfs/hammer2/hammer2.h | 21 ++-
sys/vfs/hammer2/hammer2_chain.c | 348 ++++++++++++++++++++++++++++----------
sys/vfs/hammer2/hammer2_flush.c | 253 +++++++++++++++++----------
sys/vfs/hammer2/hammer2_freemap.c | 3 +-
sys/vfs/hammer2/hammer2_inode.c | 280 +++++++++++++++---------------
sys/vfs/hammer2/hammer2_io.c | 51 ++++--
sys/vfs/hammer2/hammer2_vfsops.c | 15 +-
sys/vfs/hammer2/hammer2_vnops.c | 8 +
9 files changed, 636 insertions(+), 345 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/0924b3f8b02e204754852ec6897879a0373c98aa
--
DragonFly BSD source repository
More information about the Commits
mailing list