diff options
author | Johannes Weiner <hannes@cmpxchg.org> | 2024-03-12 11:34:12 -0400 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-04-25 20:55:48 -0700 |
commit | 4196b48ddd382419e51658bf94a25af195ba9450 (patch) | |
tree | d40a1612881356123e6b4896bdb888039dab0822 /mm/zswap.c | |
parent | 91cdcd8d624bfdf05e8db9d572759516f3c786b8 (diff) | |
download | lwn-4196b48ddd382419e51658bf94a25af195ba9450.tar.gz lwn-4196b48ddd382419e51658bf94a25af195ba9450.zip |
mm: zpool: return pool size in pages
All zswap backends track their pool sizes in pages. Currently they
multiply by PAGE_SIZE for zswap, only for zswap to divide again in order
to do limit math. Report pages directly.
Link: https://lkml.kernel.org/r/20240312153901.3441-2-hannes@cmpxchg.org
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Yosry Ahmed <yosryahmed@google.com>
Reviewed-by: Chengming Zhou <chengming.zhou@linux.dev>
Reviewed-by: Nhat Pham <nphamcs@gmail.com>
Cc: Yosry Ahmed <yosryahmed@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/zswap.c')
-rw-r--r-- | mm/zswap.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/zswap.c b/mm/zswap.c index a56b76852664..8721980a2274 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -513,18 +513,18 @@ static unsigned long zswap_accept_thr_pages(void) unsigned long zswap_total_pages(void) { struct zswap_pool *pool; - u64 total = 0; + unsigned long total = 0; rcu_read_lock(); list_for_each_entry_rcu(pool, &zswap_pools, list) { int i; for (i = 0; i < ZSWAP_NR_ZPOOLS; i++) - total += zpool_get_total_size(pool->zpools[i]); + total += zpool_get_total_pages(pool->zpools[i]); } rcu_read_unlock(); - return total >> PAGE_SHIFT; + return total; } /********************************* |