-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Persistent L2ARC #9582
Persistent L2ARC #9582
Conversation
You could change the commit message to: The rest is already in the Authored and ported by tags. That way it complies with the stylerule a little more. edit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While i'm not versed in ZoL enough to review some/most of the actual function calls.
I do want to note it's very neatly structured and byond-well commented.
Quick work fixing the commit message! |
@Ornias1993 I accidentally deleted your comment regarding disabling persistent L2ARC. I guess we could make it an option the user can set, ie a zfs property? |
@gamanakis No worries that was me, I didnt notice I already submitted it and afterwards scrolled up and noted you already had a quite easy/nice hook to disable persistent L2Arc :) (not a property yet though, so maybe that can be added indeed ) |
Awesome, thanks for picking this up!
I don't see that commit in illumos. Could you specify which codebase you started from? Is it #2672 ? |
@ahrens My fault of being unclear with my advice to change the commit message. @gamanakis also accidentily changed the PR summary.
With regards to the Illumos commit... |
Thanks for clarifying. |
@behlendorf Do you have anyone in mind to request a review from? |
@gamanakis thanks for moving this work forward! I haven't had a chance to take a careful look at this PR to provide any detailed feedback. But when skimming I noticed that it doesn't appear to add any new test cases. One of the next steps for this PR would be add some to the |
@behlendorf I will work on that. Meanwhile I did a minor cleanup and implemented this as a zpool property, so that the user can set it. Is it ok if I push (or force-push?) those commits in this PR? |
@gamanakis Usually those changes can get pushed to the same repo no problem, certainly before formal review :) |
Thanks for picking this up. What is the point of another property? |
@scineram I think @gamanakis means the earlier discussed option to enable/disable the persistance |
@gamanakis Just as headsup: lookup if your git email on your machine is the same as the one setup on github. it doesn't recognise your commits as linked to your github account. you might want too ;) |
@gamanakis You might need to add your property to the test suite too, test errors: |
I pushed a final functional commit finalizing the zpool property, and adding man pages. |
4374a5a
to
acf0bac
Compare
687dae1
to
e02d8f0
Compare
|
fbf8134
to
e044ce2
Compare
This commit makes the L2ARC persistent across reboots. We implement a light-weight persistent L2ARC metadata structure that allows L2ARC contents to be recovered after a reboot. This significantly eases the impact a reboot has on read performance on systems with large caches. Co-authored-by: Saso Kiselkov <skiselkov@gmail.com> Co-authored-by: Jorgen Lundman <lundman@lundman.net> Co-authored-by: George Amanakis <gamanakis@gmail.com> Ported-by: Yuxuan Shui <yshuiv7@gmail.com> Signed-off-by: George Amanakis <gamanakis@gmail.com>
e044ce2
to
b74fa37
Compare
Still behaving well FWIW. :) |
Merged. Thanks to everyone who helped get this done! |
Thanks for your hard work on this, folks! This is going to be a great benefit to several machines I maintain with ZOL. |
why is this patch enforcing lz4 compression, no matter which compression was selected? its also uses lz4 if compression is disabled. |
@BrainSlayer the persistent L2ARC does use LZ4 for the compression of the metadata (log blocks). Otherwise the L2ARC buffers (L2ARC data) use whatever compression the filesystem uses. |
@BrainSlayer you can see what compression algorithm is used for L2ARC data by inspecting the metadata with:
Which tells you: the 5th buffer ( |
the question is more why you enforce lz4 and why not using the configured algorithm (or even no compression if disabled) |
@BrainSlayer L2ARC devices can cache from different filesystems with different compression algorithms. Doing what you suggested makes it very complex and prone to bugs. After all only the metadata on L2ARC used for restoring the buffers use LZ4, the actual cached buffers (which were fetched from ARC) still use the compression used for the filesystem. |
@BrainSlayer actually your suggestion is impossible with the current implementation. The metadata (log blocks) consist of up to 1022 entries which refer to buffers cached from ARC. Each of those 1022 cached buffers may be using a different compression algorithm, dependent on which filesystem it comes from. Ie the log block can contain entries referencing buffers, some of which are LZ4, some ZSTD, some with compression disabled. So which compression algorithm would the log block use? |
okay. thanks for explaination. i will consider this in my rework of the zstd patch. so your own patch might be already good enough |
Is it possible for l2arc to cache data even if it's still in ram and not evicted(duplicated cache)? For now, if the ram is still enough to hold cache, the data cached cannot be retrieved between reboots through persistent l2arc. It's hard to accept the most frequently used data in ram cannot be accelerated by persistent l2arc. |
@fedstryale yes it is. Try setting |
This commit makes the L2ARC persistent across reboots. We implement a light-weight persistent L2ARC metadata structure that allows L2ARC contents to be recovered after a reboot. This significantly eases the impact a reboot has on read performance on systems with large caches. Reviewed-by: Matthew Ahrens <mahrens@delphix.com> Reviewed-by: George Wilson <gwilson@delphix.com> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Saso Kiselkov <skiselkov@gmail.com> Co-authored-by: Jorgen Lundman <lundman@lundman.net> Co-authored-by: George Amanakis <gamanakis@gmail.com> Ported-by: Yuxuan Shui <yshuiv7@gmail.com> Signed-off-by: George Amanakis <gamanakis@gmail.com> Closes openzfs#925 Closes openzfs#1823 Closes openzfs#2672 Closes openzfs#3744 Closes openzfs#9582
This commit makes the L2ARC persistent across reboots. It is
based on issue 3525 in Illumos by Saso Kiselkov, which was later
ported by Yuxuan Shui to zfsonlinux (#2672) with modifications by
Jorgen Lundman, and rebased to current master with fixes and new
features by me.
Co-authored-by: Saso Kiselkov skiselkov@gmail.com
Co-authored-by: Jorgen Lundman lundman@lundman.net
Co-authored-by: George Amanakis gamanakis@gmail.com
Ported-by: Yuxuan Shui yshuiv7@gmail.com
Signed-off-by: George Amanakis gamanakis@gmail.com
Motivation and Context
This feature implements a light-weight persistent L2ARC metadata
structure that allows L2ARC contents to be recovered after a reboot.
This significantly eases the impact a reboot has on read performance
on systems with large caches.
Closes #3744
Description
This is a substantial rework of issue 3525 in Illumos and PR #2672
It includes numerous fixes and new features to be listed here.
How Has This Been Tested?
A number of tests have been added in ZTS.
Also running in a production server (VMs with ZVOLs, Samba, NFS, LXC) with unencrypted ZFS since 11/22/2019.
Types of changes
Checklist:
Signed-off-by
.