Repository navigation
Conversation
|
/cc @MKrupauskas |
| num, err := strconv.ParseUint(v, 10, 64) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("invalid %s=%q, expected a number", k, v) | ||
| num := uint64(math.MaxUint64) |
There was a problem hiding this comment.
Nit: should we pass "max" to the kernel instead of Go's max unsigned int?
The kernel default is max already but I am open to supporting the max value as well
There was a problem hiding this comment.
also, if we decide to do that extracting the value selection logic into a small function would probably help with readability and have less if condition depth
There was a problem hiding this comment.
Nit: should we pass "max" to the kernel instead of Go's max unsigned int?
Unfortunately, the kernel supports it, but not systemd.
There was a problem hiding this comment.
also, if we decide to do that extracting the value selection logic into a small function would probably help with readability and have less if condition depth
I think both are ok, I copy them from pids.max.
https://github.com/lifubang/cgroups/blob/f953ddf15856d4c315a56e4207f0357d2af21e41/systemd/v2.go#L215-L223
There was a problem hiding this comment.
ah id systemd doesn't support it can't do much
There was a problem hiding this comment.
Yep, systemd accepts a numeric type only (and have a constant for max). It's unfortunate but that's how things are.
|
lgtm though i can’t approve |
Previously, memory.zswap.max only accepted explicit byte values. This commit adds support for the 'max' keyword. Fixes: 009e461 ("systemd: support zswap unified resources") Signed-off-by: lifubang <lifubang@acmcoder.com>
| expError: true, | ||
| expProps: []systemdDbus.Property{ | ||
| newProp("MemoryZSwapMax", uint64(math.MaxUint64)), | ||
| }, |
There was a problem hiding this comment.
Should add
minVer: zswapMaxSupportedVersion,
or the test will fail on older systemd (which, apparently, we don't have in CI here)
kolyshkin
left a comment
There was a problem hiding this comment.
one comment about the test case, also can you add
Fixes: 009e4617f2a2 ("systemd: support zswap unified resources")
to commit message footers?
cff75b5 to
d130fb8
Compare
Previously,
memory.zswap.maxonly accepted explicit byte values.This commit adds support for the
maxkeyword.Fixes: #102