Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp707442rdb; Mon, 29 Jan 2024 16:13:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IGCOGZYXScFPub1GdyqpgCvTm9ZrWwM+OzC14Z6+ZqNw3ZVQBZJgnVZzR6Do8mklkQCRIAy X-Received: by 2002:a05:620a:470c:b0:783:fbce:b30f with SMTP id bs12-20020a05620a470c00b00783fbceb30fmr4050864qkb.40.1706573595983; Mon, 29 Jan 2024 16:13:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706573595; cv=pass; d=google.com; s=arc-20160816; b=udTl5vkm2d1tKxolykr97QMHU3hDAW0CwhDyNNF5/usUwPJgkdM0RUmsPqkerqw4UG 7eFlGFlhkuNLS+5Nikxwa3rQRNPP5DW4ohseVmD+jgZKFYNaDnflF3w7gmChnHt1y/cN JO87O4WX0nK2aaiZPtUxRfQZ7QxgBeBKbXlyGVzknYZQrvUYr3hPYgWP/SHFghMgJpSh 4RqRBJFSrl6CUbAVQBBIXCymKXTBMPuR70/7G6UjZIp4YuY1GI4Z+QruSbjuBWp/9cFl iEv/PZGVYpYqn8I42c8Di1t7Q2q/1exGDKINV1wL58nlsVWiWj0B6EXKAK2p8VHTyA0s EpJg== ARC-Message-Signature: i=2; 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=OXTzc+kkuw+ShG+eg9t0/SuZakj6DjerRaMHogUdVuM=; fh=DeJmOsKlg3aZQlt5BvKv/U3GUkeIRgxPkjv3SE9u4Hs=; b=MbIxlyxuNxMwF9152AwU6W5VkOT2+XZMGmDI+so+zwqLsoiAHnXrUwNgqFSsIF5jgk IBbROApHsk41bsZ032CMCVxWd5rzwDkZZ5TOJaPAAmvwaWxP5nJOkrB1A9npyY9jqW0M EhBUp4jxJPq0hby60qMK9V+hmw1CurMBjmo8TEaH5MZ3usN8G/h87EH2oXBlytzXnrpR XbHnwHxllIqg5UUAz8zDuq/wUpavogp1W5miS+lUEiBRuvVP1IO8iTDG6KwWOx11Jowa U5llZMaVy0hteQ6x4wxINj0pkTiI53D04utWO8RZSHLBtIYxKg8NITLY+IF6EUmzqmz4 WdjA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=CcjkQZow; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-43662-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43662-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c19-20020a05620a165300b0077f4e80e131si1190244qko.692.2024.01.29.16.13.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 16:13:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-43662-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=CcjkQZow; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-43662-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43662-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 5A8651C23328 for ; Tue, 30 Jan 2024 00:13:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B0A24D2FA; Tue, 30 Jan 2024 00:13:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CcjkQZow" Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.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 7537214A92 for ; Tue, 30 Jan 2024 00:13:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706573587; cv=none; b=dnLCZA+lmgqc5rHfOu9ayZi6avcbsIuV4fhQDp8nLOshCBiyhwR5te4LVq8McPkOa5b/ZtIO/7jkUfQsW3LbGIlrE7xWJV/FWMXFQk5KC1sJX0bYwE+pzwi2krPAE5zIab25JjyeoHQkxAmBZtnQ1Zwf4qlSxypIgPRCTAJRqWo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706573587; c=relaxed/simple; bh=OXTzc+kkuw+ShG+eg9t0/SuZakj6DjerRaMHogUdVuM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=WntgpCf77TSaRSQvHKolJHALkZC2B4tt7zFB1SBLD+X84MHbzzD1qzAso8EmqLUBpT7aXmtxWAri1Mnv0/5CZcgMDoZSbxwY7XOQ2rJMtM74Sb6S2csNHyKlF/w3mZrlDfWM1Xmz7WF03H3CSUZuWmC/fRBCcVnJ6PcjNu+zJ1Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CcjkQZow; arc=none smtp.client-ip=209.85.166.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-il1-f172.google.com with SMTP id e9e14a558f8ab-36379bc5d93so4483735ab.1 for ; Mon, 29 Jan 2024 16:13:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706573585; x=1707178385; 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=OXTzc+kkuw+ShG+eg9t0/SuZakj6DjerRaMHogUdVuM=; b=CcjkQZoweurF8L48wc4oDNl1xZlj7p1bAA2lhNeqwS9f5GYCKM7sffmYsNf8q6niRe 9I5dT2iJLODdSz1FUJ3JftVlHjDqaD3PEtA/HHLggrjmuQ1LH+TDn7TgDFINnFr/CGet Do86Nw05FMPE9WCvb4qPF+0fgOPeP7x92JP1cMAzbSd9RC7UqdDs1fSUddonD9ekaOq2 fC0dSVeoeKAP7Jgb/uV00905KdX1e7n33Tt0AAoe+FCogQiNb4yAAIzd5mhkHKF5HmZS mvnD3sEBE0kKVgE7vt3adYchQE0Gj8GvrU4k3dMhEx6d9LBK/E15BLCLDUanP2rM0jeO OOgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706573585; x=1707178385; 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=OXTzc+kkuw+ShG+eg9t0/SuZakj6DjerRaMHogUdVuM=; b=Rh9z9SW490Tfh4IyshrGjAenD/9ESmHq90W4zdbuWYS9+l6MqnwkH74NCgSSaaMCA8 iP5D5Rje4lz8BDB7N41ZYpRLXbwyRAmMOOhYYHsML9+oayZQ/+L2L+sGEWgLNR/0qLF8 44l56Off5uobLVQrQlAj6alYPwLVpTQhVz8LUV56NERYdE3Bmbi8QDLz2skx4CU0eyQ/ 8HsMo2NXT9XF7X2DCaJCWGcgRw7YmM+razkON7pMEtdn4u/50/uDTSSHrzhPxp+hatza SCKvZaDgTJZoob8QOvJqlwfMQHu7249EbmLrgvFwnpuaTh8jTr4HNvIfDu4wv8beC3Xx t0CQ== X-Gm-Message-State: AOJu0YwwXDHlQdqXzMOBuYOS+kCuc0buluUHIs0flAybqTLN8RQsBkxA qj416TxwcnSFqZW3YXS/+2Uld5mc296spyB7HOUwYrOceUsZmB1JfNr5+HM8T5QyOXo+k6a5px1 87RCupug6+G5YLiZqv0YEBdhxUSs= X-Received: by 2002:a92:7312:0:b0:363:7f6e:e868 with SMTP id o18-20020a927312000000b003637f6ee868mr3261356ilc.19.1706573585364; Mon, 29 Jan 2024 16:13:05 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240126-zswap-writeback-race-v2-0-b10479847099@bytedance.com> <20240126-zswap-writeback-race-v2-1-b10479847099@bytedance.com> In-Reply-To: From: Nhat Pham Date: Mon, 29 Jan 2024 16:12:54 -0800 Message-ID: Subject: Re: [PATCH v2 1/3] mm/zswap: don't return LRU_SKIP if we have dropped lru lock To: Yosry Ahmed Cc: Chengming Zhou , Johannes Weiner , Andrew Morton , Chris Li , linux-kernel@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jan 29, 2024 at 4:09=E2=80=AFPM Yosry Ahmed = wrote: > > On Sun, Jan 28, 2024 at 01:28:49PM +0000, Chengming Zhou wrote: > > LRU_SKIP can only be returned if we don't ever dropped lru lock, or > > we need to return LRU_RETRY to restart from the head of lru list. > > > > Otherwise, the iteration might continue from a cursor position that > > was freed while the locks were dropped. > > Does this warrant a stable backport? IUC, the zswap shrinker was merged in 6.8, and we're still in the RC's for 6.8, right? If this patch goes into 6.8 then no need? Otherwise, yeah it should go to 6.8 stable IMHO. > > > > > Actually we may need to introduce another LRU_STOP to really terminate > > the ongoing shrinking scan process, when we encounter a warm page > > already in the swap cache. The current list_lru implementation > > doesn't have this function to early break from __list_lru_walk_one. > > > > Fixes: b5ba474f3f51 ("zswap: shrink zswap pool based on memory pressure= ") > > Acked-by: Johannes Weiner > > Reviewed-by: Nhat Pham > > Signed-off-by: Chengming Zhou > > Acked-by: Yosry Ahmed