Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Treat -1 as default value for memory swappiness #654

Conversation

ktraghavendra
Copy link
Contributor

As mentioned in #639 for some older kernels setting swappiness
fails. This happens even when nobody tries to configure swappiness
from docker UI because we would still get some default value from
host config.
With this we treat -1 value as default value and skip the enforcement
of swappiness.

Signed-off-by: Raghavendra K T raghavendra.kt@linux.vnet.ibm.com

As mentioned in #639 for some older kernels setting swappiness
fails. This happens even when nobody tries to configure swappiness
from docker UI because we would still get some default value from
host config.
With this we treat -1 value as default value and skip the enforcement
of swappiness.

Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
} else if cgroup.MemorySwappiness == -1 {
return nil
} else {
return fmt.Errorf("Invalid value:%d. Valid memory swappiness range is 0-100", cgroup.MemorySwappiness)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Go errors start with lowercase. Here and below.

@LK4D4
Copy link
Contributor

LK4D4 commented Jun 29, 2015

I think you should port this PR to opencontainers/runc/libcontainer.

@ktraghavendra ktraghavendra force-pushed the 639_container_swappiness branch from 8e98d8a to 24063ef Compare June 29, 2015 18:26
@ktraghavendra
Copy link
Contributor Author

@LK4D4 Thanks, okay will look into opencontainers' porting

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants