[DragonFlyBSD - Submit #2771] (Closed) [PATCH 2/2] sys/vfs/hammer: make hammer_blockmap_lookup() lightweight
bugtracker-admin at leaf.dragonflybsd.org
bugtracker-admin at leaf.dragonflybsd.org
Sat Jan 17 12:50:35 PST 2015
Issue #2771 has been updated by dillon.
Status changed from New to Closed
Applied to master in f4fe61c211f76405279f2734eaff5e7285174523. Also see 2772.
-Matt
----------------------------------------
Submit #2771: [PATCH 2/2] sys/vfs/hammer: make hammer_blockmap_lookup() lightweight
http://bugs.dragonflybsd.org/issues/2771#change-12490
* Author: tkusumi
* Status: Closed
* Priority: Normal
* Assignee:
* Category: VFS subsystem
* Target version:
----------------------------------------
This patch makes a core function hammer_blockmap_lookup() lightweight by splitting it into inlined lookup part and verification part. The problem with current hammer_blockmap_lookup() is that this function really does nothing other than flipping zone bits (blockmap offset translation) when hammer_verify_zone is disabled (set to 0) which is default. It should be inlined to eliminate unnecessary overhead.
It's fairly expensive to call a function with 3 args only to change upper 4 bits of the 64 bits address to a static value 0x2, considering this function is frequently called by hammer_get_buffer() for blockmap offset translation whenever hammer needs a buffer for i/o (except for undo and walking layer1-2) but the buffer isn't cached on the on-memory rbtree.
This patch does the following.
1. Split hammer_blockmap_lookup() into inlined hammer_blockmap_lookup() and hammer_blockmap_lookup_verify()
1-1. hammer_blockmap_lookup() only does bits flipping if hammer_verify_zone is disabled (default)
1-2. hammer_blockmap_lookup() does bits flipping plus blockmap verify by calling hammer_blockmap_lookup_verify() if hammer_veirfy_zone is enabled
There is no logical change here, as it only attempts to reduce unnecessary overhead within core routines. Cloning dragonfly git repository on hammer happens to call hammer_blockmap_lookup() nearly 10000 times with around 37000 files on my environment which is not too small.
This patch goes on top of a cleanup (and obvious) patch I've sent as
[PATCH 1/2] sys/vfs/hammer: make variable names up-to-date with code
since they both changes the same part regarding zone_offset arg.
---Files--------------------------------
0002-sys-vfs-hammer-make-hammer_blockmap_lookup-lightweig.patch (5.64 KB)
--
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account
More information about the Submit
mailing list