Re: [PATCH v3 1/7] mm: zswap: add pool shrinking mechanism

From: Sergey Senozhatsky
Date: Sun Jun 18 2023 - 00:39:14 EST


On (23/06/12 11:38), Domenico Cerasuolo wrote:
> +static int zswap_reclaim_entry(struct zswap_pool *pool)
> +{
> + struct zswap_header *zhdr;
> + struct zswap_entry *entry;
> + struct zswap_tree *tree;
> + pgoff_t swpoffset;
> + int ret;
> +
> + /* Get an entry off the LRU */
> + spin_lock(&pool->lru_lock);
> + if (list_empty(&pool->lru)) {
> + spin_unlock(&pool->lru_lock);
> + return -EINVAL;
> + }
> + entry = list_last_entry(&pool->lru, struct zswap_entry, lru);
> + list_del_init(&entry->lru);

A quick question: should we zswap_entry_get() here?