zsawp front load freeentry
zsawp front load freeentry
Posted May 17, 2023 12:03 UTC (Wed) by xjtudso (guest, #152064)Parent article: The zswap compressed swap cache
“The entry is not removed from the tree during a load; it remains up-to-date until the entry is invalidated.”
In my understanding, if zpool entry is not freed after a load, zpool will be used up quickly. As I checked in zswap code:
freeentry:
spin_lock(&tree->lock);
/*
this is a local refcnt put, zswap entry refcnt will be 1, after put. And it will not be freed here.
*/
zswap_entry_put(tree, entry);
spin_unlock(&tree->lock);
In my understanding, if zpool entry is not freed after a load, zpool will be used up quickly. As I checked in zswap code:
freeentry:
spin_lock(&tree->lock);
/*
this is a local refcnt put, zswap entry refcnt will be 1, after put. And it will not be freed here.
*/
zswap_entry_put(tree, entry);
spin_unlock(&tree->lock);
return ret;
}
So should zswap entry be freed here with an extra global entry_put just like zswap write back?