Fix misspelled "swappiness" 07/237207/1
authorDongwoo Lee <dwoo08.lee@samsung.com>
Mon, 20 Apr 2020 07:55:52 +0000 (16:55 +0900)
committerDongwoo Lee <dwoo08.lee@samsung.com>
Fri, 26 Jun 2020 02:19:43 +0000 (11:19 +0900)
Memcg attribute "swappiness" is misspelled as "swapness", so this
corrects them.

Change-Id: Ia6cf4774b26af613e344c25dca6591980a183247
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
src/common/memory-common.h
src/memory/lowmem-system.c
src/memory/vmpressure-lowmem-handler.c
src/swap/swap.c
tests/lowmem-system-test.cpp

index 872b87e..1690930 100644 (file)
@@ -90,7 +90,7 @@ enum lowmem_control_type {
 #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"
index 81e0698..f40b0d7 100644 (file)
@@ -74,12 +74,12 @@ static int search_systemd_cgroup(const char *dir)
                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;
@@ -87,10 +87,10 @@ static int search_systemd_cgroup(const char *dir)
        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;
                }
        }
@@ -119,10 +119,10 @@ static int search_systemd_cgroup(const char *dir)
 
                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);
index 5bace7c..0cf9854 100644 (file)
@@ -1682,10 +1682,10 @@ static int write_params_memcg_info(struct memcg_info *mi)
 
        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)
index 1589944..e0f3997 100644 (file)
@@ -381,7 +381,7 @@ static int swap_start_reclaim(char *memcg)
        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;
@@ -395,10 +395,10 @@ static int swap_start_reclaim(char *memcg)
         */
        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;
                }
        }
@@ -412,10 +412,10 @@ static int swap_start_reclaim(char *memcg)
         */
        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;
                }
        }
@@ -458,12 +458,12 @@ static int swap_reclaim_memcg(struct swap_status_msg msg)
                         * swap will be blocked with minimum swappiness.
                         */
                        r = cgroup_read_node_int32(info->name,
-                               MEMCG_SWAPNESS_PATH, &current_swappiness);
+                               MEMCG_SWAPPINESS_PATH, &current_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;
        }
@@ -647,7 +647,7 @@ static void swap_activate_in_module(void)
        static bool early_reclaim;
 
        r = cgroup_read_node_int32(LOWMEM_ROOT_CGROUP,
-               MEMCG_SWAPNESS_PATH, &current_swappiness);
+               MEMCG_SWAPPINESS_PATH, &current_swappiness);
        if (r)
                return;
 
index fd223b5..ad5239a 100644 (file)
@@ -74,11 +74,11 @@ void expect_cgroup_write_node_uint32(const char *cgroup_name, const char *file_n
 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
@@ -89,7 +89,7 @@ void mock_search_systemd_cgroup(const char *dir, int32_t root_swappiness, int32_
 
                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());