Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp692922rdb; Fri, 2 Feb 2024 00:30:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IHnrKXYh1IiiYmB2gi1MgJphsNJy5heqVh35xAtp9a5Nlk5NGqnbFDE7xm873yVoXS7sgqJ X-Received: by 2002:a05:6358:6f1a:b0:178:92dc:8a32 with SMTP id r26-20020a0563586f1a00b0017892dc8a32mr1449162rwn.20.1706862612577; Fri, 02 Feb 2024 00:30:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706862612; cv=pass; d=google.com; s=arc-20160816; b=Z/ppkhB8RNX6HP825A9bvEYxtPAol9ets2rDnBBxnJ3sYQPVHMhNPlYxJNWk83YtUV dpqC4wDLYusNdRJ3v1LWVBow//qiBKoFQBf4Af9lE2GGDNlzgTUftP1xK+36CWIzjxws MdnRnP2ozM3HKEuXrARDJC2lb7gfxM15kynk007NQGP+ZxsH003sxeWGWIKfUGqE27OF stsK5YkcvdZw+pvEADIrcYj3AbNJUAzqRdQjGsVlaNTR6uhgn4NtjvqkdWkFTgzOR/IX 1UkP0wasw1sNfJqGpmZyflTybG91X8apYI5Y7jyp6/6fY2c36sY1VdYPQHXiVJiW591v RuGg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=MJTlS+Zx0kwsewgmgXrZQpo393YaXW30zOMs0OgwhUg=; fh=GhS5g3nzK4UGwHdtRi8L2QET6JN9erNVj+N3QyXPBgk=; b=I1O2FWxvcyNawflu6dKV4zbrw88o5TEZJ5w+q2bgJ3h+6B3t75SFs2cc5ykQs6r4pf wgYrcf2qtjCzf0/uASxoqlg3OetrUxHGnShw5ZkkC+n0EXI0S+FGGEHN3p/kCl8m5++c z1+LdpLO2XDfhj+esNiRPN4ByPGQn3XCzfl1wELTBToSCNzshBqhFXXLhpt0L87AMRoU oEtdBiZRsmG/pU3+ZyQnqcuO/Muxn4SMuRvoHnedkaIZRuXrw70VXjU9Y+36fpHqxKh8 vdUzIQO/Kkufw/nI/Rzd57HNOSYA35QJvuURxPm90ELGR/lu0ZRPzMSi/8TjGfGHNXbe Q97Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=Fr6d10MH; arc=pass (i=1 spf=pass spfdomain=bytedance.com dkim=pass dkdomain=bytedance.com dmarc=pass fromdomain=bytedance.com); spf=pass (google.com: domain of linux-kernel+bounces-49448-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49448-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com X-Forwarded-Encrypted: i=1; AJvYcCVzfG/M0RyJlEAP7Y8ANVkVSQ4Z2dOUNdrQXNI8GZV2dpWQHTYRxAaLh5AUSpmx9G8/c1UA9KaHeKtW++oYbzcMmGocSXRXw13Yh20lVg== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id y38-20020a631826000000b005bd27be66e1si1176855pgl.719.2024.02.02.00.30.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 00:30:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49448-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=Fr6d10MH; arc=pass (i=1 spf=pass spfdomain=bytedance.com dkim=pass dkdomain=bytedance.com dmarc=pass fromdomain=bytedance.com); spf=pass (google.com: domain of linux-kernel+bounces-49448-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49448-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 61E21B2A4C0 for ; Fri, 2 Feb 2024 08:18:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 50FD517BD8; Fri, 2 Feb 2024 08:13:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="Fr6d10MH" Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) (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 A774C182AF for ; Fri, 2 Feb 2024 08:12:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706861581; cv=none; b=R8QmlwH9dJshnkpT7YeXQJgvaFsmq+wL7pMXOfdTaNdRBCgjn5FG4fEivoae23hm7cfsqzmkrHv05vuSzKjqUCgv93inIcv+zX+NpHRmOgxXyGTJBvgdRGaF+MCJlBRZ7z6WhnPPa9qZUMnOlVUgqpKAeyZjJJAuLijucUkPsd8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706861581; c=relaxed/simple; bh=XmRNWbk1Rw7iRYV0P/z6WjSur6k3KMnUilgGnnht7ho=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Bo6BtmymXJH6fwi8PD3MKlXxoyj+5B9v4bixnVaie88XzWm3Bw0YEdZOEyHk4vqOOzZ6vXUfyzm9UYBFBbpZC0JWVQXvqcJBaHeg4I0vWUdKbXps94zsd2u1PwPaOymsGNa8cyz2q8WpnpgwmV2ASdfzQ5PG6KNwaNBRW08w3fc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=Fr6d10MH; arc=none smtp.client-ip=209.85.210.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-6e11cda9f6fso1049302a34.2 for ; Fri, 02 Feb 2024 00:12:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1706861578; x=1707466378; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=MJTlS+Zx0kwsewgmgXrZQpo393YaXW30zOMs0OgwhUg=; b=Fr6d10MHl4+GofgCOx3iigyz1J67diaZpH63alWUjeT6xNFWpI6iN65jt1904SCcpU yRWhNiQ8dPh4rJsAHUqWFzKGfNvEiEKiEbojgiXm7GZEECEPl3zMnQD3p3CILEQ8Z4oH xnpdDttL9cjFh9jtX7+7d9udO0KRUKEGwz99+LX1VWEoi6YPV518z7ZYO1/1nF+FiXPa y1XerETyuIKs7yD2GE2h2FW8a7ePK+EkkLvvQPQiOTKqj5QVBgmIGlIVIztrYW2jgr2j Jho0E1/izhgH+baor+lzCQq6UqW+eTGjTARJWBCAiptQRuVkmNxzwWeq12JzcPwCzm3n +vaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706861578; x=1707466378; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MJTlS+Zx0kwsewgmgXrZQpo393YaXW30zOMs0OgwhUg=; b=XCbHPLxuViEgrU5/OSe1Iy5lYhbkpRtSR12KfFFgjmMhwjVhzAuKXACrjNm5HiNqfl WBtmtZLFoxpmxjf+fiuyrFA+0UM3osioXdMIUw4O1wywx6r8dwR3xndwbpH766kr6+jh JlV1H320kUUP4+gjpXSGPY/qzHRvoyogbvhBBfLZ7vAVuPISuw+vSJma7muIuCpkR1JK cW0sjg/cOxzLqPUqlAKJXxUP13qk8v9/ySudy3owyERnwoCdEGjwtN0o2FBtogy2Pikc qoVWCQc98s0S+uJql6qU8D/kk3bgjv+UrRFvzy9v0xc4ojM/sAncOx9uUtE7n/rsY9j4 W78Q== X-Gm-Message-State: AOJu0YwmXFYnESl9PkIrRW9RbK7WYOmFY4SZFaNeAehsM7EV99x/q6il 4Hhnz1J1XLjWi9epFpxYD0KSY6gGex0vzmtXip60vzhintpcBJ4FbsVXP5x0GwU= X-Received: by 2002:a05:6358:5bd0:b0:178:756b:6bcb with SMTP id i16-20020a0563585bd000b00178756b6bcbmr1546836rwf.27.1706861578474; Fri, 02 Feb 2024 00:12:58 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCWTDogFDZ7mGbhV1qKTMQGCQyeUhQ/bD4WNRszgYLEfg8aXwVdDANZ1/oHSiIXIgcESI809ivm70xcOC5bWQA0ckgEiewI+n57jCLBNhFVwVAHnxNK7x6clqT9/UZdRVPDdclCfaSOzaIHMdcEl/TnaaOm/EIcnFbhDbwwuuZMKrq3HqoVqeSfgMkH4nRPFLA== Received: from [10.84.152.222] ([203.208.167.154]) by smtp.gmail.com with ESMTPSA id k15-20020a63d10f000000b0059b2316be86sm1049563pgg.46.2024.02.02.00.12.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 Feb 2024 00:12:58 -0800 (PST) Message-ID: <2e6547c6-1bdd-4e27-a573-b866eb8bb305@bytedance.com> Date: Fri, 2 Feb 2024 16:12:52 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/6] mm/zswap: stop lru list shrinking when encounter warm region Content-Language: en-US To: Yosry Ahmed Cc: Nhat Pham , Johannes Weiner , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20240201-b4-zswap-invalidate-entry-v1-0-56ed496b6e55@bytedance.com> <20240201-b4-zswap-invalidate-entry-v1-3-56ed496b6e55@bytedance.com> From: Chengming Zhou In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2024/2/2 08:15, Yosry Ahmed wrote: > On Thu, Feb 01, 2024 at 03:49:03PM +0000, Chengming Zhou wrote: >> When the shrinker encounter an existing folio in swap cache, it means >> we are shrinking into the warmer region. We should terminate shrinking >> if we're in the dynamic shrinker context. >> >> This patch add LRU_STOP to support this, to avoid overshrinking. >> >> Signed-off-by: Chengming Zhou > > LGTM with one comment below. > > Reviewed-by: Yosry Ahmed > >> --- >> include/linux/list_lru.h | 1 + >> mm/list_lru.c | 3 +++ >> mm/zswap.c | 4 +++- >> 3 files changed, 7 insertions(+), 1 deletion(-) >> >> diff --git a/include/linux/list_lru.h b/include/linux/list_lru.h >> index f2882a820690..5633e970144b 100644 >> --- a/include/linux/list_lru.h >> +++ b/include/linux/list_lru.h >> @@ -24,6 +24,7 @@ enum lru_status { >> LRU_SKIP, /* item cannot be locked, skip */ >> LRU_RETRY, /* item not freeable. May drop the lock >> internally, but has to return locked. */ >> + LRU_STOP, /* stop lru list walking */ > > nit: Should we add "May drop the lock internally, but has to return > locked" like LRU_RETRY and LRU_REMOVED_RETRY? Right, will add. Thanks.