Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change ZVOL to use _by_dnode() methods #240

Merged
merged 4 commits into from
May 13, 2020
Merged

Change ZVOL to use _by_dnode() methods #240

merged 4 commits into from
May 13, 2020

Conversation

lundman
Copy link
Collaborator

@lundman lundman commented Apr 7, 2020

Which reduces the contention behind the ZVOL_OBJ mutex.

ryao and others added 2 commits April 7, 2020 17:44
This continues what was started in
0eef1bde31d67091d3deed23fe2394f5a8bf2276 by fully converting zvols
to avoid unnecessary dnode_hold() calls. This saves a small amount
of CPU time and slightly improves latencies of operations on zvols.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@prophetstor.com>
Closes #6058

Porting-notes:

Cleaned up previous style, which was based on OSX. Since we can use
the standard uio call, we should take advantage of that.

Additionally deleted all the symlink code, as that is specific to
OSX.

Ported-by: Jorgen Lundman <lundman@lundman.net>
We can improve the performance of writes to zvols by using
dmu_tx_hold_write_by_dnode() instead of dmu_tx_hold_write().  This
reduces lock contention on the first block of the dnode object, and also
reduces the amount of CPU needed.  The benefit will be highest with
multi-threaded async writes (i.e. writes that don't call zil_commit()).

Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
@lundman lundman linked an issue Apr 10, 2020 that may be closed by this pull request
$ ./zfs create -s -V 3GB -b 2048 tank/vol
Warning: volblocksize (2048) < ashift (12 / 4096)
means all writes are amplified and space wasted.
"volblocksize (%llu) < ashift (%llu / %llu)\n"
"means all writes are amplified and space wasted.\n"),
blocksize, ashift, 1ULL << ashift);
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahrens You might want to de-ESOL the text... :)

@lundman
Copy link
Collaborator Author

lundman commented Apr 14, 2020

Waiting for approval in openzfs/zfs#10199

@lundman lundman merged commit fb5cd5b into master May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

zpool writes are 20x zvol writes
3 participants