This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit 760de7c984e3a5965ba6eed86e956c406189c009
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Fri May 29 17:30:21 2020 +0100
savemeta: Don't trim off trailing zeroes when compressing
The code that trims the trailing zeroes from blocks before saving them
always features as one of the slow points in performance reports. When
we're compressing the file anyway, the compression algos should do this
much more efficiently than we can, so short circuit it when compression
is enabled.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/edit/savemeta.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 76477b7..55f6492 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -532,8 +532,10 @@ static int save_buf(struct metafd *mfd, const char *buf, uint64_t
addr, unsigned
struct saved_metablock *savedata;
size_t outsz;
- /* No need to save trailing zeroes */
- for (; blklen > 0 && buf[blklen - 1] == '\0'; blklen--);
+ /* No need to save trailing zeroes, but leave that for compression to
+ deal with when enabled as this adds a significant overhead */
+ if (mfd->gziplevel == 0)
+ for (; blklen > 0 && buf[blklen - 1] == '\0'; blklen--);
if (blklen == 0) /* No significant data; skip. */
return 0;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.