Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp1958039rdb; Sun, 24 Dec 2023 09:18:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IFmqsIqQhszH0mOKpLOckCLsU+dWVyOsqFEbSCgXZb6Jye0teggDVTgX/jHNTzKdUMR/ohQ X-Received: by 2002:a05:622a:1744:b0:427:a58d:69fa with SMTP id l4-20020a05622a174400b00427a58d69famr7267750qtk.62.1703438295070; Sun, 24 Dec 2023 09:18:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703438295; cv=none; d=google.com; s=arc-20160816; b=hYBkkh0G7jJjp5ULWnkDIYOeoMdWZdF1+1BLOktT7V2yHrX8Gidc3qyCjze0IvIZPt ng4P6b8X+KFMH5bsGaulK/Ci/1kx41tVse2/TO65PuPp5t2JS5FIGh5CwKtMZdQncrR9 PfA7Bj7hsn7WZPrjT35uCmJQoAKJxLW6BpXXUikNlwr/robMAq2A4wY0tQr5AlOJlz1i cykviT0efQMHaaFgEIcvICBJBHwFfIBNTvGUU0xWruD33TCPvgd8ecw/lZ4ODGG4JkEg Oc19beABRXLknsHKETxx/ZV6oJlsPrWc96YcQlKxixs43CicqI4bIkIbYqsTvvhfAZH+ P6KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=3hFLSnZfOPa4HbeCcp8WZcEpXNOy9FTVGa6+3rCmbwU=; fh=hdRW6+cVQ6G4njdUHIQ5cpURpPgdKR0p7gf4Oti48sI=; b=OMykiCvxio+TY0at5/U4Lo57jtyAX5TQW+yThCVSztLHrrlAhXa/smtnQ7wcGItbWh O9fHMXCrSsUwS8WrQGwNzueM0RZELjmynRStFKkGbLiPfv40ol+VWPLKKQdojBvnwWGc DkM+qDPTzbAndW/RKrA8Fvjf0jWAA64doxhWIoStpXrmw5BLg8cHdtoMBbEX2xJTfM12 yempAn9E3ToX8ynEF5mxkiGvEgeFc4jIQL83lg1IJLfKHztbzXZCWke6PMaoqSAugW0u lBO36f3uGTveg2rZWowxokPWFeBDdfnBcry62lT+EGUkZziwfQW9i2QW6CYv+3E+5sRU tixw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=nkKo198e; spf=pass (google.com: domain of linux-kernel+bounces-10776-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10776-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bp35-20020a05622a1ba300b00425da7bbf14si8608749qtb.641.2023.12.24.09.18.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 09:18:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10776-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=nkKo198e; spf=pass (google.com: domain of linux-kernel+bounces-10776-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10776-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D11C61C20A32 for ; Sun, 24 Dec 2023 17:18:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 486ACCA7D; Sun, 24 Dec 2023 17:18:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="nkKo198e" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (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 37E89C8C7 for ; Sun, 24 Dec 2023 17:18:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-1d422c9f894so14787995ad.3 for ; Sun, 24 Dec 2023 09:18:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1703438285; x=1704043085; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=3hFLSnZfOPa4HbeCcp8WZcEpXNOy9FTVGa6+3rCmbwU=; b=nkKo198ePwmNf8Dz2PjGEjjB/7Pj6LLOxNozL9O88AFRtOOMlPyNBqycQD9Lce29Kx YnsnwguV81kVHHi0LbuKQUFxxr4ixTBlDkk+n9r446r6Izooo3k/Ay10OCPvRJY7vR5v AfRkDdfi95XLoePMuuFcJxfcJlOwIrFSpffbs3Z9KVYZpkEfFJ+Vaep6gVv6JP95AWHS IwlbirQZCwp4UDP5s0xe1Qfx/N04JMozwLjI7FoCtyrhkMvCMDoIRl2LN76isB12GeP5 DFSInkOfN1qWZUXfTVZf1Q4lic566PBvFcmA61wJ5xLyEGtQivTZgAWsNnvRK9wy+SSO CGDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703438285; x=1704043085; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3hFLSnZfOPa4HbeCcp8WZcEpXNOy9FTVGa6+3rCmbwU=; b=saXiWEyhdhCHQNJgNg74IkRO2jdDIVSlh3aEwbyhOeB+HQaI/QNd10Qm3THhXBY/Ms n7vYor7ncNIPN5igqlghcxhP+3gGEAhf/W7r8T0Nih0MZjTecCh3jWf/DMP9wUG5Tn5J kavUEKaQsrdZDPWZ/m8o072H5dW2skbinmvf3W7RgD5oQIuWtoaYMvmnEnQNa94DmRN5 qZG+h/UE+n80HoPFxmJfuHdEtMZTummLSPI2LwalWBenqvqb2VhMa7ObazC5d9vLyj6Z mbx9QqiEMlFJbRk3bw/qfBpNCCFxakS1pG8gH4gs8flveY8xbv5FutslCqvaBXAvGcKO b+HQ== X-Gm-Message-State: AOJu0YwV3hA/GO751N/rzFlQAb9bisQvP0glnBBe9XVGR9a6beBZAM0f VqHEIcv3Ks6QymE55/Zn+ZBMkaHpblEntDK6Z3NMD5byLXGN X-Received: by 2002:a17:902:eb83:b0:1d3:efef:d84b with SMTP id q3-20020a170902eb8300b001d3efefd84bmr5625964plg.70.1703438285308; Sun, 24 Dec 2023 09:18:05 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231207192406.3809579-1-nphamcs@gmail.com> <20231221005725.3446672-1-nphamcs@gmail.com> In-Reply-To: <20231221005725.3446672-1-nphamcs@gmail.com> From: Chris Li Date: Sun, 24 Dec 2023 09:17:54 -0800 Message-ID: Subject: Re: [PATCH v6] zswap: memcontrol: implement zswap writeback disabling (fix) To: Nhat Pham Cc: akpm@linux-foundation.org, tj@kernel.org, lizefan.x@bytedance.com, hannes@cmpxchg.org, cerasuolodomenico@gmail.com, yosryahmed@google.com, sjenning@redhat.com, ddstreet@ieee.org, vitaly.wool@konsulko.com, mhocko@kernel.org, roman.gushchin@linux.dev, shakeelb@google.com, muchun.song@linux.dev, hughd@google.com, corbet@lwn.net, konrad.wilk@oracle.com, senozhatsky@chromium.org, rppt@kernel.org, linux-mm@kvack.org, kernel-team@meta.com, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, david@ixit.cz Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Nhat, Acked-by: Chris Li I think a follow up step would be having some patches to address it rather than document it that oh yes, we have a problem in that situation. Chris On Wed, Dec 20, 2023 at 4:57=E2=80=AFPM Nhat Pham wrote= : > > Add a caveat about recurring zswap store failures leading to reclaim > inefficiency. > > Suggested-by: Yosry Ahmed > Signed-off-by: Nhat Pham > --- > Documentation/admin-guide/cgroup-v2.rst | 5 ++++- > Documentation/admin-guide/mm/zswap.rst | 4 ++++ > 2 files changed, 8 insertions(+), 1 deletion(-) > > diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admi= n-guide/cgroup-v2.rst > index 2b4ac43efdc8..5ec7dd753cd1 100644 > --- a/Documentation/admin-guide/cgroup-v2.rst > +++ b/Documentation/admin-guide/cgroup-v2.rst > @@ -1686,7 +1686,10 @@ PAGE_SIZE multiple when read back. > > When this is set to 0, all swapping attempts to swapping devices > are disabled. This included both zswap writebacks, and swapping d= ue > - to zswap store failure. > + to zswap store failures. If the zswap store failures are recurrin= g > + (for e.g if the pages are incompressible), users can observe > + reclaim inefficiency after disabling writeback (because the same > + pages might be rejected again and again). > > Note that this is subtly different from setting memory.swap.max t= o > 0, as it still allows for pages to be written to the zswap pool. > diff --git a/Documentation/admin-guide/mm/zswap.rst b/Documentation/admin= -guide/mm/zswap.rst > index cfa653130346..b42132969e31 100644 > --- a/Documentation/admin-guide/mm/zswap.rst > +++ b/Documentation/admin-guide/mm/zswap.rst > @@ -159,6 +159,10 @@ zswap itself) on a cgroup-basis as follows: > > echo 0 > /sys/fs/cgroup//memory.zswap.writeback > > +Note that if the store failures are recurring (for e.g if the pages are > +incompressible), users can observe reclaim inefficiency after disabling > +writeback (because the same pages might be rejected again and again). > + > When there is a sizable amount of cold memory residing in the zswap pool= , it > can be advantageous to proactively write these cold pages to swap and re= claim > the memory for other use cases. By default, the zswap shrinker is disabl= ed. > -- > 2.34.1 >