Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 55345fb9 authored by Wanpeng Li's avatar Wanpeng Li Committed by Greg Kroah-Hartman
Browse files

staging: zcache: fix account foregin counters against zero-filled pages



zero-filled pages won't be compressed and sent to remote system. Monitor
the number ephemeral and persistent pages that Ramster has sent make no
sense. This patch skip account foregin counters against zero-filled pages.

Signed-off-by: default avatarWanpeng Li <liwanp@linux.vnet.ibm.com>
Acked-by: default avatarDan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bc389678
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -415,7 +415,7 @@ static void *zcache_pampd_eph_create(char *data, size_t size, bool raw,
got_pampd:
	inc_zcache_eph_zbytes(clen);
	inc_zcache_eph_zpages();
	if (ramster_enabled && raw)
	if (ramster_enabled && raw && !zero_filled)
		ramster_count_foreign_pages(true, 1);
	if (zero_filled)
		pampd = (void *)ZERO_FILLED;
@@ -500,7 +500,7 @@ static void *zcache_pampd_pers_create(char *data, size_t size, bool raw,
got_pampd:
	inc_zcache_pers_zpages();
	inc_zcache_pers_zbytes(clen);
	if (ramster_enabled && raw)
	if (ramster_enabled && raw && !zero_filled)
		ramster_count_foreign_pages(false, 1);
	if (zero_filled)
		pampd = (void *)ZERO_FILLED;
@@ -681,7 +681,7 @@ static int zcache_pampd_get_data_and_free(char *data, size_t *sizep, bool raw,
		dec_zcache_pers_zpages(zpages);
		dec_zcache_pers_zbytes(zsize);
	}
	if (!is_local_client(pool->client))
	if (!is_local_client(pool->client) && !zero_filled)
		ramster_count_foreign_pages(eph, -1);
	if (page && !zero_filled)
		zcache_free_page(page);
@@ -732,7 +732,7 @@ static void zcache_pampd_free(void *pampd, struct tmem_pool *pool,
		dec_zcache_pers_zpages(zpages);
		dec_zcache_pers_zbytes(zsize);
	}
	if (!is_local_client(pool->client))
	if (!is_local_client(pool->client) && !zero_filled)
		ramster_count_foreign_pages(is_ephemeral(pool), -1);
	if (page && !zero_filled)
		zcache_free_page(page);