#define ZSWAP_FULLNESS_RATIO 0.8
#define DEFAULT_ZSWAP_FILE_SIZE MBYTE_TO_BYTE(30)
-#define ZSWAP_POOL_SIZE "/sys/module/zswap/parameters/max_pool_size"
+#define ZSWAP_POOL_PERCENT "/sys/module/zswap/parameters/max_pool_percent"
#define ZSWAP_WRITTEN_SIZE "/sys/kernel/debug/zswap/written_back_pages"
struct swap_zswap_control {
static int swap_zswap_activate(void *data)
{
struct swap_module_ops *swap = (struct swap_module_ops *)data;
- unsigned int max_pool_size;
int r;
zswap_control.zswap_reclaim_bytes =
if (r < 0)
return r;
- max_pool_size = lowmem_get_ktotalram() * zswap_control.zpool_ratio;
- r = fwrite_int(ZSWAP_POOL_SIZE, max_pool_size);
+ r = fwrite_int(ZSWAP_POOL_PERCENT, zswap_control.zpool_ratio);
if (r < 0) {
- _E("fail to write max_pool_size : %d", max_pool_size);
+ _E("fail to write max_pool_percent : %d", zswap_control.zpool_ratio);
return r;
}
struct swap_module_ops *swap = (struct swap_module_ops *)data;
int r;
- if (access(ZSWAP_POOL_SIZE, R_OK) != 0)
+ if (access(ZSWAP_POOL_PERCENT, R_OK) != 0)
return -ENOENT;
r = swap_zswap_parse_config_file();