On Thu, Feb 1, 2024 at 7:50 AM Chengming Zhou <zhouchengming@xxxxxxxxxxxxx> wrote: > > cat /sys/kernel/debug/zswap/duplicate_entry > 2086447 > > When testing, the duplicate_entry value is very high, but no warning > message in the kernel log. From the comment of duplicate_entry > "Duplicate store was encountered (rare)", it seems something goes wrong. > > Actually it's incremented in the beginning of zswap_store(), which found > its zswap entry has already on the tree. And this is a normal case, > since the folio could leave zswap entry on the tree after swapin, > later it's dirtied and swapout/zswap_store again, found its original > zswap entry. (Maybe we can reuse it instead of invalidating it?) > > So duplicate_entry should be only incremented in the real bug case, > which already have "WARN_ON(1)", it looks redundant to count bug case, > so this patch just remove it. > > Signed-off-by: Chengming Zhou <zhouchengming@xxxxxxxxxxxxx> Acked-by: Yosry Ahmed <yosryahmed@xxxxxxxxxx>