The quilt patch titled Subject: zsmalloc: add a LRU to zs_pool to keep track of zspages in LRU order (fix) has been removed from the -mm tree. Its filename was zsmalloc-add-a-lru-to-zs_pool-to-keep-track-of-zspages-in-lru-order-fix.patch This patch was dropped because it was folded into zsmalloc-add-a-lru-to-zs_pool-to-keep-track-of-zspages-in-lru-order.patch ------------------------------------------------------ From: Nhat Pham <nphamcs@xxxxxxxxx> Subject: zsmalloc: add a LRU to zs_pool to keep track of zspages in LRU order (fix) Date: Wed, 23 Nov 2022 11:17:02 -0800 Add a comment explaining the mapping check for LRU update. Link: https://lkml.kernel.org/r/20221123191703.2902079-2-nphamcs@xxxxxxxxx Signed-off-by: Nhat Pham <nphamcs@xxxxxxxxx> Suggested-by: Johannes Weiner <hannes@xxxxxxxxxxx> Suggested-by: Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/zsmalloc.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) --- a/mm/zsmalloc.c~zsmalloc-add-a-lru-to-zs_pool-to-keep-track-of-zspages-in-lru-order-fix +++ a/mm/zsmalloc.c @@ -1289,7 +1289,23 @@ void *zs_map_object(struct zs_pool *pool zspage = get_zspage(page); #ifdef CONFIG_ZPOOL - /* Move the zspage to front of pool's LRU */ + /* + * Move the zspage to front of pool's LRU. + * + * Note that this is swap-specific, so by definition there are no ongoing + * accesses to the memory while the page is swapped out that would make + * it "hot". A new entry is hot, then ages to the tail until it gets either + * written back or swaps back in. + * + * Furthermore, map is also called during writeback. We must not put an + * isolated page on the LRU mid-reclaim. + * + * As a result, only update the LRU when the page is mapped for write + * when it's first instantiated. + * + * This is a deviation from the other backends, which perform this update + * in the allocation function (zbud_alloc, z3fold_alloc). + */ if (mm == ZS_MM_WO) { if (!list_empty(&zspage->lru)) list_del(&zspage->lru); _ Patches currently in -mm which might be from nphamcs@xxxxxxxxx are zsmalloc-consolidate-zs_pools-migrate_lock-and-size_classs-locks.patch zsmalloc-add-a-lru-to-zs_pool-to-keep-track-of-zspages-in-lru-order.patch zsmalloc-add-zpool_ops-field-to-zs_pool-to-store-evict-handlers.patch zsmalloc-implement-writeback-mechanism-for-zsmalloc.patch zsmalloc-implement-writeback-mechanism-for-zsmalloc-fix.patch