forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First try at packing small buffers in the l2arc
L2ARC compression increases the effective space of a cache device. However, the compression ratio achieved with small buffers is relatively poor due to the need to align them with the cache device block size. One of my main use cases for ZFS is on systems which are mostly IO limited by metadata reads. On these systems I use small L2ARC cache devices with secondarycache=metadata. This should benefit from packing small buffers in the L2ARC. This patch is a quick (and dirty) first try at packing buffers in the L2ARC. * It only packs buffers which are written during a single L2ARC feed. * It only packs small buffers which are <50% block size after compression. In an unrealistic test case I saw *real* L2ARC usage of: 297MB - just compression 55MB - packing and without compression 15MB - packing and compression 9MB - l2arc in zram So in some cases this would certainly save a *lot* of L2ARC. BUT there are also a lot of cases where this would provide no real benefit.
- Loading branch information
Showing
4 changed files
with
120 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
243d508
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.
Just out of curiosity, in the test case you mentioned, how many buffers were there in your L2ARC device? Because my guess is that at buffer sizes significantly smaller than 256B, the arc_buf_hdr_t overhead (which is several hundred bytes) will largely dominate real-world performance.