From patchwork Tue Jul 30 22:47:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nhat Pham X-Patchwork-Id: 13747956 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE45FC3DA49 for ; Tue, 30 Jul 2024 22:47:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 658FF6B0082; Tue, 30 Jul 2024 18:47:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 609246B0083; Tue, 30 Jul 2024 18:47:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4D1986B0085; Tue, 30 Jul 2024 18:47:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 31FDC6B0082 for ; Tue, 30 Jul 2024 18:47:20 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id D7F5514011D for ; Tue, 30 Jul 2024 22:47:19 +0000 (UTC) X-FDA: 82397906598.02.70335EA Received: from mail-yw1-f182.google.com (mail-yw1-f182.google.com [209.85.128.182]) by imf26.hostedemail.com (Postfix) with ESMTP id 1B98D140003 for ; Tue, 30 Jul 2024 22:47:17 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Vr000voL; spf=pass (imf26.hostedemail.com: domain of nphamcs@gmail.com designates 209.85.128.182 as permitted sender) smtp.mailfrom=nphamcs@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722379583; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=15PKFj8shF3ngEYd4PvdNdzLn2bIlUHmbcoq9oTRbEs=; b=j4wrSveg05QqmCooqocTKPjLxbd+8borhFjUxsxva+EscTqHBQotlGFvqp9nY4QIihJgo8 vfXV76WfrIpwBTDt2DtQ/IUW7SRNCdKNr1Tx117ZciHFhkqx5SvSa4+dYDVABV1TF9kJtM p5kcjlJdLqXkqd26XsIuGZR6wOZ9EOs= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722379583; a=rsa-sha256; cv=none; b=LSd6+Yb7hEK5MZSt38qN7U6EZ8gBdo90YbP34+stD5qGW2qh1j+GIbw2bk7U8eMsB6oJFE /csf8/4WGL1Z3XWqax63giqr8rAhpEE7sYca1dXavVmF+/32r8aesJb0YYOFy0fuxa+u7X /p+KNb3cNw4gTCCnMqzvFlAoIqaisJs= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Vr000voL; spf=pass (imf26.hostedemail.com: domain of nphamcs@gmail.com designates 209.85.128.182 as permitted sender) smtp.mailfrom=nphamcs@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-yw1-f182.google.com with SMTP id 00721157ae682-6687f2f0986so34083747b3.0 for ; Tue, 30 Jul 2024 15:47:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722379637; x=1722984437; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=15PKFj8shF3ngEYd4PvdNdzLn2bIlUHmbcoq9oTRbEs=; b=Vr000voLH2od3wuryqIjyogs5wTcSK/MUnWNjHXoHKzcMRCN3V8u03Vx69F/urBYrE rvR1rIL2ghInkOsqFaHVlVZbQMWxoNiBz5qX3PWLmdWUY7NYMhdwtaSISoWjysDERgmn camJB7FtHqnhGZpO/QTTUdIKas6UQ27NrzQKGVL1V/h6684GLMLKYJ4gGO3SBDjlDyUH LiSA7KschaePnM7aB82ZS0MQoQE6NaXr12Ta3jcBauwUmNzk2RZ5sryJuZwEAORYBBdp yPn3JxTJWSmDWLXgR6HthYZJMWzf6CVSeFLgUxDa8Zp/122uqK3/iLuvWoY+amkTFhaC sJVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722379637; x=1722984437; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=15PKFj8shF3ngEYd4PvdNdzLn2bIlUHmbcoq9oTRbEs=; b=SnU7dj4FIL91igiO6WfF1mttB5EGgYsW0AN3X1NvJnhefmmftq5g9bzKNNL5Rlch2e 3fanI4ETJUjW6I6zTM9inbMLoRmdMIhQPzh84kFEXYHr6SPmWQNbPrYDf2Hx6JblbBdR 3V4pFcso/mHI86Kahauw4jx3veqS2rCDbvJ50v3p2QgDoS4uQqBR1iqrE20v3pyPNPtI qpd2CUbvE+TWdVjDB1tMu4WLPlMIOsiwLGjY6ExI4OPOxsDEHmcglOLiQ/0EqRZSCT5k FuYyk/Eb73f+7jvnv1VapkT0J3Is9lYJR3Kzsfuc77T6pdpczcHaTMKaX++dKQgjH5/l 4J6A== X-Forwarded-Encrypted: i=1; AJvYcCXKvtJXlRB2wVfUmzMzTZCH2e5SOJMh0W0F7js5gKSUVlCdkLDg6tfGRAhM/VAbmBZi4xec3YqtgOBaOgeFERY5K7g= X-Gm-Message-State: AOJu0Yz5RyAZVYgznS03xrVTB6wpwsigivu544On+2OlYk9Q8U7Fj5JN 5he4E3lRh44LQLlfhacQnGR/WzWm7/swh5JBWF1yjcFWthJqtXrV X-Google-Smtp-Source: AGHT+IFjcTqdoCR13ox+jYM2hdeniYqCSu8uV5/HJmPbYKUh/pGoE3ca/5m2AFwz7N9b/CRVST4QRA== X-Received: by 2002:a0d:f386:0:b0:61b:df5:7876 with SMTP id 00721157ae682-67a05c8bb3bmr136648857b3.6.1722379636977; Tue, 30 Jul 2024 15:47:16 -0700 (PDT) Received: from localhost (fwdproxy-nha-115.fbsv.net. [2a03:2880:25ff:73::face:b00c]) by smtp.gmail.com with ESMTPSA id 00721157ae682-683bc9b736asm2669857b3.11.2024.07.30.15.47.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jul 2024 15:47:16 -0700 (PDT) From: Nhat Pham To: akpm@linux-foundation.org Cc: hannes@cmpxchg.org, yosryahmed@google.com, shakeel.butt@linux.dev, linux-mm@kvack.org, kernel-team@meta.com, linux-kernel@vger.kernel.org, flintglass@gmail.com, chengming.zhou@linux.dev Subject: [PATCH v2 1/2] zswap: implement a second chance algorithm for dynamic zswap shrinker (fix) Date: Tue, 30 Jul 2024 15:47:16 -0700 Message-ID: <20240730224716.2392068-1-nphamcs@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240730222707.2324536-2-nphamcs@gmail.com> References: <20240730222707.2324536-2-nphamcs@gmail.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 1B98D140003 X-Stat-Signature: r8o6h1xjrheyt8i5td4bzejer7knt1fn X-HE-Tag: 1722379637-258987 X-HE-Meta: U2FsdGVkX1+VWf8IHeRw8c6logWLBP2itWtmQcvJ3NT4i105ulgy0BqvIwOidKHr569vhvLgl/o2rTyaLwg8OQTeJqDhETwfdgTpE1jYFFNGqWE38tQsrJmImoCqI3wbToHGM9sDhhgZdGBLeZvHgw073nFGqdSNWlOgU5J5W/NyaAWgVacoUD8OmnWx3MtnJQcbPkL5AQ+LZq6xn8XY1jT2At7Y4n/MZcHHlYhsF/X2x8ftgJ7pN0pVRFjYzH8V30H2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= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000085, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: I put the referenced bit documentation in the wrong order. Fix this. Signed-off-by: Nhat Pham --- mm/zswap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/zswap.c b/mm/zswap.c index f4e001c9e7e0..f7f6bbb400c4 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -184,13 +184,13 @@ static struct shrinker *zswap_shrinker; * page within zswap. * * swpentry - associated swap entry, the offset indexes into the red-black tree + * length - the length in bytes of the compressed page data. Needed during + * decompression. For a same value filled page length is 0, and both + * pool and lru are invalid and must be ignored. * referenced - true if the entry recently entered the zswap pool. Unset by the * dynamic shrinker. The entry is only reclaimed by the dynamic * shrinker if referenced is unset. See comments in the shrinker * section for context. - * length - the length in bytes of the compressed page data. Needed during - * decompression. For a same value filled page length is 0, and both - * pool and lru are invalid and must be ignored. * pool - the zswap_pool the entry's data is in * handle - zpool allocation handle that stores the compressed page data * value - value of the same-value filled pages which have same content