Uh oh!
There was an error while loading. Please reload this page.
Fix cgroups value types in the spec. - #233
Conversation
wking
commented
Oct 27, 2015
On Tue, Oct 27, 2015 at 10:59:48AM -0700, Vish Kannan wrote:
This unwinds a lot of type changes from #199. Are we sure we want to |
vishh
commented
Oct 27, 2015
Unless these field become pointers, I do not see how I can skip these On Tue, Oct 27, 2015 at 11:17 AM, W. Trevor King notifications@github.com
|
wking
commented
Oct 27, 2015
On Tue, Oct 27, 2015 at 11:21:02AM -0700, Vish Kannan wrote:
I'm fine with pointers (and I expect Go generated from a protobuf |
vbatts
commented
Oct 27, 2015
ah no. int64 makes more sense here. Pointers is a bit too much complication here. LGTM |
wking
commented
Oct 27, 2015
On Tue, Oct 27, 2015 at 01:36:50PM -0700, Vincent Batts wrote:
I'm fine punting this to the protobuf transition (at which point these |
hqhq
commented
Oct 28, 2015
I don't understand why we take -1 as unlimited? What's the intention here? |
vishh
commented
Oct 28, 2015
@hqhq: Sometimes, we want to use the system defaults for certain cgroups values. The default value of |
hqhq
commented
Oct 29, 2015
@vishh I understand and agree with this intention, but so far there is only |
vishh
commented
Oct 29, 2015
Without this change, how do you propose that a user will express their intent of using the system defaults? |
hqhq
commented
Oct 30, 2015
@vishh Except exception like |
cyphar
commented
Oct 30, 2015
Requiring to explicitly set If we had to do this, surely a better way would be to set them to |
vishh
commented
Oct 30, 2015
Hmm. Considering that the Spec is still not v1.0, do we really care about The general issue here is the fact that the Spec is wrapping the linux APIs On Fri, Oct 30, 2015 at 7:07 AM, Aleksa Sarai notifications@github.com
|
wking
commented
Oct 30, 2015
On Fri, Oct 30, 2015 at 09:42:51AM -0700, Vish Kannan wrote:
Using pointers in the Go types so ‘null’ and missing are valid JSON |
cyphar
commented
Oct 31, 2015
Ah, fair enough. But there are other reasons why I don't agree with using
TBH, I feel like |
wking
commented
Oct 31, 2015
On Fri, Oct 30, 2015 at 05:44:34PM -0700, Aleksa Sarai wrote:
I may be misunderstanding, but it sounds like you're saying: { would mean “don't touch memory.limit_in_bytes”. That makes sense to { through an empty/missing runtime.json would mean “set For example, say the 1.0 spec defines cgroups that are pretty much |
cyphar
commented
Oct 31, 2015
@wking No, I agree with the proposal of using pointers so that using
i was referring specifically to the current state of this PR (using I don't agree this is how it should work, and I'm all for making both setting a value to |
- add information to cgroup resources controllers with examples - add pids cgroup information and example - reflect kernel types Signed-off-by: Antonio Murdaca <runcom@linux.com>
crosbymichael
commented
Nov 9, 2015
I'm ok with nil for values where the zero value means something for our settings. @vishh what do you think? |
vishh
commented
Nov 9, 2015
SGTM. On Mon, Nov 9, 2015 at 2:29 PM, Michael Crosby notifications@github.com
|
cyphar
commented
Nov 10, 2015
@crosbymichael Weren't we talking about making all settings have |
crosbymichael
commented
Nov 10, 2015
All or only the ones that make sense. Its so we don't end up with things like memory swap where you have to set it to -1 if your system does not support it or your containers will fail |
wking
commented
Nov 10, 2015
On Mon, Nov 09, 2015 at 05:07:36PM -0800, Michael Crosby wrote:
I think “don't set this value” or “don't create this cgroup” are |
cyphar
commented
Nov 10, 2015
@crosbymichael setting memory swap as |
mrunalp
commented
Nov 13, 2015
crosbymichael
commented
Dec 18, 2015
LGTM |
There was a problem hiding this comment.
Since these are pointers now, shouldn't we match the kernel data types and have these be unsigned?
If it is nil, it means that we don't touch the value. There is no need for setting these to negative values.
cyphar
commented
Dec 18, 2015
@crosbymichael I'm not a maintainer, but NACK. There are still some issues with types that should be unsigned. |
…mpty` json tag. Signed-off-by: Vishnu kannan <vishnuk@google.com>
vishh
commented
Dec 19, 2015
Comments addressed |
mrunalp
commented
Dec 19, 2015
LGTM |
Fix cgroups value types in the spec.
philips
commented
Dec 23, 2015
thanks for doing this @vishh |
The general rule seems to be: If Go's default value has the same semantics we'd use for an unset value, don't bother with a pointer. I'm not sure how well that squares with [1]: We want a consistent way to identify unset settings. But if the falsy values count as "unset", maybe the "null is a consistent identifier for unset" approach was never really viable. I'm also not sure if the new style extends to integers where zero has the same semantics as unset values. It sounds like Michael was ok with no pointers for those values [2], but OOMScoreAdj (where zero clearly means "do nothing") got a pointer in opencontainers#233 [3]. More clarity on the threshold would be nice. [1]: opencontainers#233 (comment) [2]: opencontainers#233 (comment) [3]: https://github.com/opencontainers/specs/pull/233/files#diff-34c30be66233f08b447fb608ea0e66bbR206
The general rule seems to be: If Go's default value has the same semantics we'd use for an unset value, don't bother with a pointer. I'm not sure how well that squares with [1]: We want a consistent way to identify unset settings. But if the falsy values count as "unset", maybe the "null is a consistent identifier for unset" approach was never really viable. I'm also not sure if the new style extends to integers where zero has the same semantics as unset values. It sounds like Michael was ok with no pointers for those values [2], but OOMScoreAdj (where zero clearly means "do nothing") got a pointer in opencontainers#233 [3]. More clarity on the threshold would be nice. [1]: opencontainers#233 (comment) [2]: opencontainers#233 (comment) [3]: https://github.com/opencontainers/specs/pull/233/files#diff-34c30be66233f08b447fb608ea0e66bbR206
The general rule seems to be: If Go's default value has the same semantics we'd use for an unset value, don't bother with a pointer. I'm not sure how well that squares with [1]: We want a consistent way to identify unset settings. But if the falsy values count as "unset", maybe the "null is a consistent identifier for unset" approach was never really viable. I'm also not sure if the new style extends to integers where zero has the same semantics as unset values. It sounds like Michael was ok with no pointers for those values [2], but OOMScoreAdj (where zero clearly means "do nothing") got a pointer in opencontainers#233 [3]. More clarity on the threshold would be nice. [1]: opencontainers#233 (comment) [2]: opencontainers#233 (comment) [3]: https://github.com/opencontainers/specs/pull/233/files#diff-34c30be66233f08b447fb608ea0e66bbR206 Signed-off-by: W. Trevor King <wking@tremily.us>
The general rule seems to be: If Go's default value has the same semantics we'd use for an unset value, don't bother with a pointer. I'm not sure how well that squares with [1]: We want a consistent way to identify unset settings. But if the falsy values count as "unset", maybe the "null is a consistent identifier for unset" approach was never really viable. Qiang points out that pointers are required to opt-out of boolean settings where both true and false would require action [2], so I've worded the exception to only apply when the Go default for the type is expicitly a no-op in the spec. I'm also not sure if the new style extends to integers where zero has the same semantics as unset values. It sounds like Michael was ok with no pointers for those values [3], but OOMScoreAdj (where zero clearly means "do nothing") got a pointer in opencontainers#233 [4]. More clarity on the threshold would be nice; in this commit I've laid out the logic and not explicitly listed the types it applies to. [1]: opencontainers#233 (comment) [2]: https://github.com/opencontainers/specs/pull/317/files#r50932706 [3]: opencontainers#233 (comment) [4]: https://github.com/opencontainers/specs/pull/233/files#diff-34c30be66233f08b447fb608ea0e66bbR206 Signed-off-by: W. Trevor King <wking@tremily.us>
The general rule seems to be: If Go's default value has the same semantics we'd use for an unset value, don't bother with a pointer. I'm not sure how well that squares with [1]: We want a consistent way to identify unset settings. But if the falsy values count as "unset", maybe the "null is a consistent identifier for unset" approach was never really viable. Qiang points out that pointers are required to opt-out of boolean settings where both true and false would require action [2], so I've worded the exception to only apply when the Go default for the type is expicitly a no-op in the spec. I'm also not sure if the new style extends to integers where zero has the same semantics as unset values. It sounds like Michael was ok with no pointers for those values [3], but OOMScoreAdj (where zero clearly means "do nothing") got a pointer in opencontainers#233 [4]. More clarity on the threshold would be nice; in this commit I've laid out the logic and not explicitly listed the types it applies to. [1]: opencontainers#233 (comment) [2]: https://github.com/opencontainers/specs/pull/317/files#r50932706 [3]: opencontainers#233 (comment) [4]: https://github.com/opencontainers/specs/pull/233/files#diff-34c30be66233f08b447fb608ea0e66bbR206 Signed-off-by: W. Trevor King <wking@tremily.us>
Follow up of this comment