Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp339966rdb; Thu, 1 Feb 2024 09:55:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IHyl90mU+6EXXnqP6TjjNrYCTtph5Of7dblDb+Gy79BhrtNqjsbgtQz0+mnjSX+NA5+RhAd X-Received: by 2002:a05:6358:7299:b0:176:d2f1:b617 with SMTP id w25-20020a056358729900b00176d2f1b617mr2902129rwf.27.1706810148947; Thu, 01 Feb 2024 09:55:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706810148; cv=pass; d=google.com; s=arc-20160816; b=JfHkeR+Wt7MrxzMR/sEL+Q1GmjZm3SYCWy/ST21DKhl3QqkYJAlBKVjTejf6iBk29y vsfeRTw3m9zqGBnpVYzLABgDnlx4emXi7snwstx4qneTNqLe+swg/B8VbM3RthFiE+C6 ERK8lK4OS3i2S6ecJVxQ70+dUTmHJqL0ZPUdu8FPrW2XMzie5SODJikpIqmhvbsT4bJ1 BIidAAC1XYkvPUQKK7/mLX4TnpW54vw3BuyiDwhPOrGh01v52ZXvcMicVB0kfftgMayv N59XzvnTOM6up88O0WyQ+fjmj7tSlU2WPmbc2h3EJB+eyuycgnbDbLqWM53BuhvD9D2O yFBg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ZyoNn/8wgmrq9VdNQwCp53K+tV+bnZPzOQWmrda9Xp0=; fh=UE1UyxjKZgpdfXT3/OqwwU3uUHFKa3E+ei3OSHf2ZY8=; b=kiSe4pmGdaJaqG5VeXiWFnRgosKhwHsx1qjBaAVLNNZl3WREj3YpLe90x6nCAZGXIH UH0aEefjdsjx9salVp+U2CFrqt2gziwpv90zg1HXhMrAcAI1zD+sL+ZLe/S2BQATxazq 7dPYQapDsQQEv3I91T6XCz+PIQSI4spwAq3eQt/+73uhZHAn9crawced2ukPu+ZzDSZG KFEy2HMh/XIWJWQY2NnjNXQLwyuhqPyFNP+1Xad95M52WHISsAL+Tj5DVnlOpz2g5TkT wQARtwtK/vuUp3hvIbKZKYU4Qzhs+sAcGst01+kfQYumNKwxYgJvXJD7/W3Mfa4U6pVb xViw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=By3zVbF6; arc=pass (i=1 spf=pass spfdomain=cmpxchg.org dkim=pass dkdomain=cmpxchg-org.20230601.gappssmtp.com dmarc=pass fromdomain=cmpxchg.org); spf=pass (google.com: domain of linux-kernel+bounces-48625-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48625-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org X-Forwarded-Encrypted: i=1; AJvYcCXtVesAICFqTi0tbMXzpEU2XJqyhdqHeOqwqpjdMucBMJDHC+GvAbSkXra88Hakyo+vlrPHEzcVqixqCf6NtfjW62d20fmTsKDRL4n42A== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id g9-20020a631109000000b005cf5bf8e7a5si75505pgl.430.2024.02.01.09.55.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 09:55:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48625-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=By3zVbF6; arc=pass (i=1 spf=pass spfdomain=cmpxchg.org dkim=pass dkdomain=cmpxchg-org.20230601.gappssmtp.com dmarc=pass fromdomain=cmpxchg.org); spf=pass (google.com: domain of linux-kernel+bounces-48625-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48625-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 949512913C1 for ; Thu, 1 Feb 2024 17:55:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5916B7C6FB; Thu, 1 Feb 2024 17:55:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg-org.20230601.gappssmtp.com header.i=@cmpxchg-org.20230601.gappssmtp.com header.b="By3zVbF6" Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A74FE7C6E1 for ; Thu, 1 Feb 2024 17:55:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706810141; cv=none; b=ett8U6I+bUgpAt62OjyKfUMg7OAoxhDlBLHni33Hd7LvOzN+nX6fQFNHWNNSfj9GZttUE11MTYX3fPVIJKhTHmg5XNS1dSf8URLtjbY/5KyBfOZOtkeThtLnfeMe9lqvWEjzvfJUpaEHL0ThmhfuL8t7T7b8ZDhutRDDk9bhYHI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706810141; c=relaxed/simple; bh=dV6oNXd+2e/H092Y22BMqRwBAWqrLexmRYZyKWIvM2I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KjUz8nURniRUOBrzIGEvzqnCyaaH2cwuwKKMuVAMRNmmG/2A3nqvGPcT0FgUaBihC2oZCBqQuEbVrdR2TFngPsja0rukiDdfSXhS/+LwhI+Xb0BreFGgKn9rt/7ysco5+6bnF6g/mSpolywKSmeBXuzymE3keBiPxbiF/xlz/Bs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org; spf=pass smtp.mailfrom=cmpxchg.org; dkim=pass (2048-bit key) header.d=cmpxchg-org.20230601.gappssmtp.com header.i=@cmpxchg-org.20230601.gappssmtp.com header.b=By3zVbF6; arc=none smtp.client-ip=209.85.222.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmpxchg.org Received: by mail-qk1-f172.google.com with SMTP id af79cd13be357-78407987510so61889885a.3 for ; Thu, 01 Feb 2024 09:55:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20230601.gappssmtp.com; s=20230601; t=1706810138; x=1707414938; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ZyoNn/8wgmrq9VdNQwCp53K+tV+bnZPzOQWmrda9Xp0=; b=By3zVbF6ZweWVMbfiSLeOirR9fniqX4rmX4loCLyqbGK2I9/OqxUUtn+YIa0gfitoy NzkY/xfV4QImD0lwB6OmRC8X25O0Qdsij8jecHpmfYL2mh0KqwVLD3RXOqPq/6gBHCDk hc6cnhPC5cqRt9SZOSr0I6lyC+ytnemvIZl+7tDZw2QZW+B80uwEK0pCcVoj+E4xEKuf Qrj3u33VZ6IvP8xu2AqEzpWzF/3qXGibqzxDtAJMfJ/CgihLTmplxkHflUM72Qd+JtVu yn60GoPIoZMPxa/xTwuOEm5+KW9BPMAuspTfYSKXHScP9OGuvrAmVkzJvGXCRfaFhoxn Hlmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706810138; x=1707414938; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ZyoNn/8wgmrq9VdNQwCp53K+tV+bnZPzOQWmrda9Xp0=; b=i8je1wgEVIbRJCO5PaxQ/EHXRTchHfdV0SxqiUMXsI6htDuhF+W9dkJxKPpBD2Amom YIOHdE3J7M/3NXDxuuIrcqDawx0aFt6IHkExpB0Dg37g28nYSoLgYu65jEpNNYCmTgZz ex1MzHZIgE6xiYjAuyBz+Gk124zGuQM5PW5jvcxd7FeFhh6HJJ0MjrnnumD/M5ltNlTp w9dUvIHt8WkGF5JsdbzG6NPMaSj42JlLfNZMikcmTpR6Nu7kGQ/hNypGytUhDt536FKF mdjvY40h69+glJbi8e05ZvyxFILEAm+TuVtj00g60NsvlUs82Bt8q0rY/4yYYO1IcXBj aQjg== X-Gm-Message-State: AOJu0YygUtWI0oc+LDETrpM0VkUc9FpCU5GMr1J+/OAsxnreaab/9RQl oxwo5RVGDufKM/HpzBMzabELsD9dgg4SFLyNjpH+nnaSq0C0blRgFZx+mmgknd7xfsM96OLV51y h X-Received: by 2002:a05:620a:851:b0:785:4fff:1265 with SMTP id u17-20020a05620a085100b007854fff1265mr1083706qku.18.1706810138466; Thu, 01 Feb 2024 09:55:38 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCU/A2rYcoz+I+ZynYb27DtPNS60jOEA3ZHELv1W+lsJtgtQqruqW2H1/K2kxF0j591W9a5fPVxo0nVa2J5D/qEvmnLvRr62FygHVw7s1lar+G+x3vND0YSktXfPwWZozAi35cy5Ho2L5b3vrHrMVfGOGaVhuegTOCVMnKIUXyHLRLYbUOKm2VmQD3ossBPn7Oqcfw== Received: from localhost (2603-7000-0c01-2716-97cf-7b55-44af-acd6.res6.spectrum.com. [2603:7000:c01:2716:97cf:7b55:44af:acd6]) by smtp.gmail.com with ESMTPSA id k4-20020a05620a07e400b00783dc450d84sm16978qkk.12.2024.02.01.09.55.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 09:55:37 -0800 (PST) Date: Thu, 1 Feb 2024 12:55:36 -0500 From: Johannes Weiner To: Chengming Zhou Cc: Nhat Pham , Andrew Morton , Yosry Ahmed , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 4/6] mm/zswap: remove duplicate_entry debug value Message-ID: <20240201175536.GD321148@cmpxchg.org> References: <20240201-b4-zswap-invalidate-entry-v1-0-56ed496b6e55@bytedance.com> <20240201-b4-zswap-invalidate-entry-v1-4-56ed496b6e55@bytedance.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240201-b4-zswap-invalidate-entry-v1-4-56ed496b6e55@bytedance.com> On Thu, Feb 01, 2024 at 03:49:04PM +0000, Chengming Zhou 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?) Probably not worth it, especially after the next patch. > 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 Either way, I agree that the WARN_ON() is more useful to point out a bug than a counter. Acked-by: Johannes Weiner