#define MEMCG_SWAP_USAGE "memory.memsw.usage_in_bytes"
#define MEMCG_LIMIT_PATH "memory.limit_in_bytes"
#define MEMCG_SWAP_LIMIT_PATH "memory.memsw.limit_in_bytes"
-#define MEMCG_SWAPNESS_PATH "memory.swappiness"
+#define MEMCG_SWAPPINESS_PATH "memory.swappiness"
#define MEMPS_LOG_PATH "/var/log"
#define MEMPS_LOG_FILE MEMPS_LOG_PATH"/memps"
return -errno;
}
- ret = cgroup_read_node_int32(LOWMEM_ROOT_CGROUP, MEMCG_SWAPNESS_PATH,
+ ret = cgroup_read_node_int32(LOWMEM_ROOT_CGROUP, MEMCG_SWAPPINESS_PATH,
&rootswappiness);
if (ret != RESOURCED_ERROR_NONE)
return -errno;
- ret = cgroup_read_node_int32(dir, MEMCG_SWAPNESS_PATH,
+ ret = cgroup_read_node_int32(dir, MEMCG_SWAPPINESS_PATH,
&memcgswappiness);
if (ret != RESOURCED_ERROR_NONE)
return -errno;
if ((rootswappiness >=0) && (rootswappiness != memcgswappiness)) {
changeswappiness = rootswappiness;
ret = cgroup_write_node_uint32(dir,
- MEMCG_SWAPNESS_PATH, changeswappiness);
+ MEMCG_SWAPPINESS_PATH, changeswappiness);
if (ret != RESOURCED_ERROR_NONE) {
_I("failed to write %s %d to %s the",
- MEMCG_SWAPNESS_PATH, changeswappiness, dir);
+ MEMCG_SWAPPINESS_PATH, changeswappiness, dir);
return -errno;
}
}
if (changeswappiness >= 0) {
ret = cgroup_write_node_uint32(path,
- MEMCG_SWAPNESS_PATH, changeswappiness);
+ MEMCG_SWAPPINESS_PATH, changeswappiness);
if (ret != RESOURCED_ERROR_NONE)
_I("failed to write %s %d to %s the",
- MEMCG_SWAPNESS_PATH, changeswappiness, path);
+ MEMCG_SWAPPINESS_PATH, changeswappiness, path);
}
lowmem_reassign_limit(path, limit);
if (swappiness >= 0) {
ret = cgroup_write_node_uint32(name,
- MEMCG_SWAPNESS_PATH, swappiness);
+ MEMCG_SWAPPINESS_PATH, swappiness);
if (ret)
_I("failed to write %s %d to %s the",
- MEMCG_SWAPNESS_PATH, swappiness, name);
+ MEMCG_SWAPPINESS_PATH, swappiness, name);
}
if (mi->limit_ratio == LOWMEM_NO_LIMIT)
int r;
int swappiness;
- r = cgroup_read_node_int32(memcg, MEMCG_SWAPNESS_PATH,
+ r = cgroup_read_node_int32(memcg, MEMCG_SWAPPINESS_PATH,
&swappiness);
if (r)
return r;
*/
if (swappiness != SWAP_MEMCG_SWAPPINESS) {
r = cgroup_write_node_uint32(memcg,
- MEMCG_SWAPNESS_PATH, SWAP_MEMCG_SWAPPINESS);
+ MEMCG_SWAPPINESS_PATH, SWAP_MEMCG_SWAPPINESS);
if (r) {
_I("failed to write %s %d to %s the",
- MEMCG_SWAPNESS_PATH, SWAP_MEMCG_SWAPPINESS, memcg);
+ MEMCG_SWAPPINESS_PATH, SWAP_MEMCG_SWAPPINESS, memcg);
return -errno;
}
}
*/
if (current_swappiness != SWAP_MEMCG_SWAPPINESS) {
r = cgroup_write_node_uint32(memcg,
- MEMCG_SWAPNESS_PATH, current_swappiness);
+ MEMCG_SWAPPINESS_PATH, current_swappiness);
if (r) {
_I("failed to write %s %d to %s the",
- MEMCG_SWAPNESS_PATH, SWAP_MEMCG_SWAPPINESS, memcg);
+ MEMCG_SWAPPINESS_PATH, SWAP_MEMCG_SWAPPINESS, memcg);
return -errno;
}
}
* swap will be blocked with minimum swappiness.
*/
r = cgroup_read_node_int32(info->name,
- MEMCG_SWAPNESS_PATH, ¤t_swappiness);
+ MEMCG_SWAPPINESS_PATH, ¤t_swappiness);
if (r)
return r;
r = cgroup_write_node_uint32(info->name,
- MEMCG_SWAPNESS_PATH, SWAP_MIN_SWAPPINESS);
+ MEMCG_SWAPPINESS_PATH, SWAP_MIN_SWAPPINESS);
}
return r;
}
static bool early_reclaim;
r = cgroup_read_node_int32(LOWMEM_ROOT_CGROUP,
- MEMCG_SWAPNESS_PATH, ¤t_swappiness);
+ MEMCG_SWAPPINESS_PATH, ¤t_swappiness);
if (r)
return;
void mock_search_systemd_cgroup(const char *dir, int32_t root_swappiness, int32_t dir_swappiness,
const Subdirs &subdirs = Subdirs())
{
- mock_cgroup_read_node_int32(LOWMEM_ROOT_CGROUP, MEMCG_SWAPNESS_PATH, root_swappiness);
- mock_cgroup_read_node_int32(dir, MEMCG_SWAPNESS_PATH, dir_swappiness);
+ mock_cgroup_read_node_int32(LOWMEM_ROOT_CGROUP, MEMCG_SWAPPINESS_PATH, root_swappiness);
+ mock_cgroup_read_node_int32(dir, MEMCG_SWAPPINESS_PATH, dir_swappiness);
if (root_swappiness >= 0 && root_swappiness != dir_swappiness) {
- expect_cgroup_write_node_uint32(dir, MEMCG_SWAPNESS_PATH, root_swappiness);
+ expect_cgroup_write_node_uint32(dir, MEMCG_SWAPPINESS_PATH, root_swappiness);
}
// subdirs
mock_cgroup_read_node_uint32(subdir.get_subdir_full(), MEMCG_LIMIT_PATH, subdir.get_limit());
if (subdir.get_limit() > 0) {
- expect_cgroup_write_node_uint32(subdir.get_subdir_full(), MEMCG_SWAPNESS_PATH, root_swappiness);
+ expect_cgroup_write_node_uint32(subdir.get_subdir_full(), MEMCG_SWAPPINESS_PATH, root_swappiness);
expect_string(lowmem_reassign_limit, dir, subdir.get_subdir_full());
expect_value(lowmem_reassign_limit, limit, subdir.get_limit());