diff options
author | Nathan Scott <nathans@redhat.com> | 2023-11-21 08:38:27 +1100 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2023-11-21 08:38:27 +1100 |
commit | 2698483444d7d668e790c8e945ccb61a8c4e4df8 (patch) | |
tree | e13fc51ae788d0be414960ca08b0450fdc9a7e06 | |
parent | 452244dc06270aff4872a3c3d9559e7da5f34ad6 (diff) |
Remove unused zswap pool size calculation from commit 71f5a80d9e
Quick discussion with Ivan confirmed this was a left-over from
an earlier version of the zswap code and can be safely removed.
-rw-r--r-- | linux/LinuxMachine.c | 20 | ||||
-rw-r--r-- | linux/ZswapStats.h | 2 | ||||
-rw-r--r-- | pcp/Metric.h | 1 | ||||
-rw-r--r-- | pcp/PCPMachine.c | 3 | ||||
-rw-r--r-- | pcp/Platform.c | 1 |
5 files changed, 0 insertions, 27 deletions
diff --git a/linux/LinuxMachine.c b/linux/LinuxMachine.c index 34cd5d0b..aa1ff5f8 100644 --- a/linux/LinuxMachine.c +++ b/linux/LinuxMachine.c @@ -272,25 +272,6 @@ static void LinuxMachine_scanHugePages(LinuxMachine* this) { closedir(dir); } -static inline void LinuxMachine_scanZswapInfo(LinuxMachine* this) { - const Machine* host = &this->super; - long max_pool_percent = 0; - char buf[256]; - int r; - - r = xReadfile("/sys/module/zswap/parameters/max_pool_percent", buf, 256); - if (r <= 0) { - return; - } - max_pool_percent = strtol(buf, NULL, 10); - if (max_pool_percent < 0 || max_pool_percent > 100) { - return; - } - - this->zswap.totalZswapPool = host->totalMem * max_pool_percent / 100; - /* the rest of the metrics are set in LinuxMachine_scanMemoryInfo() */ -} - static void LinuxMachine_scanZramInfo(LinuxMachine* this) { memory_t totalZram = 0; memory_t usedZramComp = 0; @@ -641,7 +622,6 @@ void Machine_scan(Machine* super) { LinuxMachine_scanHugePages(this); LinuxMachine_scanZfsArcstats(this); LinuxMachine_scanZramInfo(this); - LinuxMachine_scanZswapInfo(this); LinuxMachine_scanCPUTime(this); const Settings* settings = super->settings; diff --git a/linux/ZswapStats.h b/linux/ZswapStats.h index 080f1e2a..29e516f4 100644 --- a/linux/ZswapStats.h +++ b/linux/ZswapStats.h @@ -10,8 +10,6 @@ in the source distribution for its full text. #include "ProcessTable.h" typedef struct ZswapStats_ { - /* maximum size of the zswap pool */ - memory_t totalZswapPool; /* amount of RAM used by the zswap pool */ memory_t usedZswapComp; /* amount of data stored inside the zswap pool */ diff --git a/pcp/Metric.h b/pcp/Metric.h index 914d7d65..e72f6e19 100644 --- a/pcp/Metric.h +++ b/pcp/Metric.h @@ -93,7 +93,6 @@ typedef enum Metric_ { PCP_ZRAM_CAPACITY, /* zram.capacity */ PCP_ZRAM_ORIGINAL, /* zram.mm_stat.data_size.original */ PCP_ZRAM_COMPRESSED, /* zram.mm_stat.data_size.compressed */ - PCP_ZSWAP_MAX_POOL_PERCENT, /* sysfs.module.zswap.max_pool_percent */ PCP_MEM_ZSWAP, /* mem.util.zswap */ PCP_MEM_ZSWAPPED, /* mem.util.zswapped */ PCP_VFS_FILES_COUNT, /* vfs.files.count */ diff --git a/pcp/PCPMachine.c b/pcp/PCPMachine.c index faf3ae96..2e872534 100644 --- a/pcp/PCPMachine.c +++ b/pcp/PCPMachine.c @@ -179,12 +179,9 @@ static void PCPMachine_updatePerCPUReal(PCPMachine* this, Metric metric, CPUMetr } static inline void PCPMachine_scanZswapInfo(PCPMachine* this) { - const Machine* host = &this->super; pmAtomValue value; memset(&this->zswap, 0, sizeof(ZswapStats)); - if (Metric_values(PCP_ZSWAP_MAX_POOL_PERCENT, &value, 1, PM_TYPE_U64)) - this->zswap.totalZswapPool = host->totalMem * value.ull / 100; if (Metric_values(PCP_MEM_ZSWAP, &value, 1, PM_TYPE_U64)) this->zswap.usedZswapComp = value.ull; if (Metric_values(PCP_MEM_ZSWAPPED, &value, 1, PM_TYPE_U64)) diff --git a/pcp/Platform.c b/pcp/Platform.c index 402276ae..6fc2fc51 100644 --- a/pcp/Platform.c +++ b/pcp/Platform.c @@ -197,7 +197,6 @@ static const char* Platform_metricNames[] = { [PCP_ZRAM_CAPACITY] = "zram.capacity", [PCP_ZRAM_ORIGINAL] = "zram.mm_stat.data_size.original", [PCP_ZRAM_COMPRESSED] = "zram.mm_stat.data_size.compressed", - [PCP_ZSWAP_MAX_POOL_PERCENT] = "sysfs.module.zswap.max_pool_percent", [PCP_MEM_ZSWAP] = "mem.util.zswap", [PCP_MEM_ZSWAPPED] = "mem.util.zswapped", [PCP_VFS_FILES_COUNT] = "vfs.files.count", |