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

Debian lz4 #128

Merged
merged 2 commits into from Feb 3, 2018
Merged

Debian lz4 #128

merged 2 commits into from Feb 3, 2018

Conversation

fabbione
Copy link
Member

@fabbione fabbione commented Feb 2, 2018

No description provided.

@fabbione fabbione requested a review from wferi February 2, 2018 06:22
@fabbione
Copy link
Member Author

fabbione commented Feb 2, 2018

Side note: CI will pass happily because lz4 build is not enabled yet for debian builders. I tested this one on debian-unstable-x86-64 builder manually. Once the patch is merged, I´ll enable lz4 in CI.

1 similar comment
@fabbione
Copy link
Member Author

fabbione commented Feb 2, 2018

Side note: CI will pass happily because lz4 build is not enabled yet for debian builders. I tested this one on debian-unstable-x86-64 builder manually. Once the patch is merged, I´ll enable lz4 in CI.

@@ -10,6 +10,7 @@
#include "config.h"

#include <errno.h>
#include <lz4.h>
#include <lz4hc.h>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the lz4hc.h include could go.

* We defalt to 9 based on the comments in the include file
* from older versions.
*/
#define KNET_LZ4HC_MAX 9
Copy link
Collaborator

Choose a reason for hiding this comment

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

This comment is a little confusing, do you set 9 as default or as maximum? Or is it that knet defaults to the maximum allowed by the compressor?
Also, 0 means "use default value" for LZ4, but "no compression" for zlib (-1 selects some default there), which knet does not allow. Do we need consistency here?

@fabbione
Copy link
Member Author

fabbione commented Feb 2, 2018 via email

@fabbione
Copy link
Member Author

fabbione commented Feb 2, 2018

Ok pushed a change to default to 16 that is the max allowed in older versions.

@wferi
Copy link
Collaborator

wferi commented Feb 2, 2018 via email

@wferi
Copy link
Collaborator

wferi commented Feb 2, 2018 via email

@fabbione
Copy link
Member Author

fabbione commented Feb 2, 2018

I start to hate github.. can´t reply via email and didn´t get notification of the previous comment.

(manual quoting)

====

No it can´t go. In recent versions of lz4, lz4.h does not include
lz4hc.h and we need the decompressor.
I mean from libknet/compress_lz4.c, not from libknet/compress_lz4hc.c.

ack, yes this should be able to go.

===

Yeah, but it's name is KNET_LZ4HC_MAX for a reason: knet won't allow
higher values.

The name might be misleading, but it does allow values higher than MAX. It will print a warning than the value is remapped:

    if (compress_level > KNET_LZ4HC_MAX) {
            log_warn(knet_h, KNET_SUB_LZ4HCCOMP, "lz4hc installed on this system supports up to compression level %d. Higher values behaves as %d", KNET_LZ4HC_MAX, KNET_LZ4HC_MAX);
    }

but does not fail.

===

If all compression plugins admit a "level" described by an int, we can
simply pass it through. After all, the person selecting a compressor is
responsible for configuring that compressor. This also means knet can't
simply use any generic default value, it must be prescribed for each
compressor separately.

the reason why I started validating values was lzo2. It has some really odd values to map and without some proper logging, it´s hard for a user to figure it out. Perhaps we can just warn better in lzo2 and free the others. What do you think?

Tho I agree, we could potentially drop all those checks and pass-through.

@fabbione
Copy link
Member Author

fabbione commented Feb 3, 2018

Feri, I changed the header inclusion for compress_lz4.c.

As for dropping all the compress level checks, I would like to do that in another PR and talk a bit with @chrissie-c too on the subject.

does that work for you?

wferi
wferi previously approved these changes Feb 3, 2018
Copy link
Collaborator

@wferi wferi left a comment

Choose a reason for hiding this comment

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

Objections withdrawn. :)

upon reading lz4hc.h, lz4.h should always be included as depedency

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
@fabbione
Copy link
Member Author

fabbione commented Feb 3, 2018

rebased on top of master. Unless you get to ack it again, i´ll use my super powers later today.

Copy link
Collaborator

@knet-ci-bot knet-ci-bot left a comment

Choose a reason for hiding this comment

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

re-approving after rebase on top of master. No code changes.

@fabbione fabbione merged commit 13e42d4 into master Feb 3, 2018
@fabbione fabbione deleted the debian-lz4 branch February 3, 2018 14:11
@fabbione
Copy link
Member Author

fabbione commented Feb 3, 2018

lz4 build in debian is now enable in CI on all builders.

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.

None yet

3 participants