Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp523315rdb; Thu, 1 Feb 2024 16:15:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IEXWJJ4JuXQ0GOyBhSDJg5sQLtlg9rUWVCEtT6dsdx9Zch8BlMmitAmLgCv7NuIoS9KP6ln X-Received: by 2002:a05:620a:13ea:b0:783:d99e:9f7f with SMTP id h10-20020a05620a13ea00b00783d99e9f7fmr4669539qkl.49.1706832937328; Thu, 01 Feb 2024 16:15:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706832937; cv=pass; d=google.com; s=arc-20160816; b=rLrC2JBsxCxa/o+MlpeIGjCDqVWlihnBdU80rNkdKlvWymzs/1GthpnLhFK+YRtDt/ fL0d5i/ZYCwNWySauBlZ4ASkHMTNYzX77Uyfn8GGjAXmRdssddQvXRtSjJdsxJEWVC1I 07nG+5623Z6uY16b4fg0NUezBd61VqTrqMMBTN6uQp9cbJKQDdI/UCCJchA4RwZSv/Sr grp6b0aBW2jRXdgZMJAQNlE1MwDwxfryZaSWNwtFDVMNCqTtY5wuvyyC3VycovNfbrbK c+4b6qTReN/ZuLL8qbjRd6iIRSgTYOMMUS0NQTDwI5C9mQBXsyVJGAt34r9zFQq4trJP L8eg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=0B2dcyelbSjs2I6WfMab+Sv7WVPwcbYFuCtOi9mUo08=; fh=8IQFRBzmTgk525ifsEnPqIrlMvquFzKhVyUK1iF44po=; b=NfcTBvHXtWTutCh0GLxNr1XcL26fH95iP0lbsXq164+MltgysDnQw/2BNcW/PyS1FT b+h2xDa0a8lMBo2DxGBESKY4hKWPrh+1fxYToxBt8ivCm1nL4Gvzcu/P22ZE1KmHGdIz Wiv/gLwrgoE2GKp9tw4u/AvJjvXDGkf4XPirYq7W9q+IWTLpjwNwOKWbiTU6Q/WhiR1b j51v5KLF+R9+Dw0hH41suVqmbJBsozlhG3MCWC/lsAXMrnUQ/1hBfTrpSVywguv/6iqs mK/LATRnHIV6+veITNYzLXj5/yofdkluPPvk/Inn9yaq60e2P4ccklYusZWUrXae+Smj rbFg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Bn6mQnqU; arc=pass (i=1 spf=pass spfdomain=flex--yosryahmed.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-49026-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49026-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=1; AJvYcCUyIpyGaVYAvuLLMBdTcHT6797xsJMdrB0DW0Xc1sn7Wu+lWqMbLuGA74l0D4C9f8RLCJJqeG0aLRkRD6vZqy8GpMTE5OvSA6RvZzXMDg== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id dt47-20020a05620a47af00b007840d839f84si781008qkb.523.2024.02.01.16.15.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 16:15:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49026-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=@google.com header.s=20230601 header.b=Bn6mQnqU; arc=pass (i=1 spf=pass spfdomain=flex--yosryahmed.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-49026-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49026-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 1092D1C22DED for ; Fri, 2 Feb 2024 00:15:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 14D261396; Fri, 2 Feb 2024 00:15:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Bn6mQnqU" Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (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 CC221ED8 for ; Fri, 2 Feb 2024 00:15:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706832931; cv=none; b=qrplSkpyI1n1KHbwyc0rc5hj2w/lG8HbD6roEGXT8toCkpWdPStvGJeteLCPOPbbub4AKVVOE0jLendg1HkfJ5m3d39AOSdEjvAuL+EFWbiULphDCkLs82dvXVA5jcM5y1+sUTWDB60i97Fp5GjWKBUNpkM/wjFqnAIqkZGYZyc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706832931; c=relaxed/simple; bh=IsM1n2YmjrO7qEqBaiGJ3uY74FQ/tRbSZSo4LQkbjno=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Ddi0fZpKaC2ieGHhJwNIMqfmgAvf//OeeidQ6R13zit9DsWCP44b4dNSI1ZgfEBVl/2y0fmm3H+X/NhUgorYIMR7p9DLBeuQC9YxiYw2xu5skCx4e1Jv8irQJhltMHqipmjiIWGkKcaUTDbr68Wg755yW5t+iU5QeXVPthbCEMk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--yosryahmed.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Bn6mQnqU; arc=none smtp.client-ip=209.85.128.202 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=flex--yosryahmed.bounces.google.com Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-60405c0c9b0so35236897b3.1 for ; Thu, 01 Feb 2024 16:15:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1706832928; x=1707437728; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=0B2dcyelbSjs2I6WfMab+Sv7WVPwcbYFuCtOi9mUo08=; b=Bn6mQnqUm+FpUowC6RxGquOtF8rQ77cF56TofnmKCsm+bsb6vO/NDST0EbvsgojFHE UCuEc82ssOsnXaosvR8doCJM94Kqc2OrgJP+BRwAEU9vzOQEcZ6m5SPh1TsXunRRcq7e CCf5TYmxKNd+Sy6nxi3TkjvDP0oRrxptnTxCoeKvRrmvmmlfsL5IZKTn+WueOE0ZzBeE Hjy1xR2BAwX+VmQjTTZZAnDjcFYeMAO5ILmBk4aWnGVL2bMgUjeEfsD2h9tTdXvS/3qS jz4D18gEp5QWCnfdRhv2gM9OW4mhCW3gqvH4bidt9j96E5PMYeHy6iiFe1sA93GDgZhR fMug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706832928; x=1707437728; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0B2dcyelbSjs2I6WfMab+Sv7WVPwcbYFuCtOi9mUo08=; b=CeuXKhQjUA5oNSDmKn+kYcrPw1Jjv0OrOm/dBtOXDTQyBihZEBzR+Gd9lkxj5asFbZ 4luwLkou4PtI1MlTr1xHEUt+M5MtU+p/pKcyASyQKp9Ajc8EJBc75nSSDh6anFuWu4as VUCM2cgkgjl1XdKdjj1CYk+E230249/bnHbzID1DIx7Ml3qDl4zwUnKaFxqhFAXh/pYE NW5T0+78/d8wY0Tw56AqWBqtjWeVTk6t6hOr3UyqnUkn3h5uzdvCVL/Lvu7yaH85clib tcRqmMjasTcmmMK87yTY5kAdjF95R0ZYdV5ZD3jzEvKIwGr+ab/XbaKsPTS3SYHdibyd UPyw== X-Gm-Message-State: AOJu0Yya5d1H88L31xyWmWELaCRADIzvzaiwlJ2RYDu/C5l3MD8MhiLH btUziL+xRbbenmkZcWpn406lgC1YL/yyJcyAcZ6hUcEXbk1uEwwBTqdgzb1mL9x6Xj1dM6zoqzr Q0zlWne4Oqxs7lBpEmw== X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:29b4]) (user=yosryahmed job=sendgmr) by 2002:a05:690c:9:b0:5d3:5a95:2338 with SMTP id bc9-20020a05690c000900b005d35a952338mr161854ywb.9.1706832928736; Thu, 01 Feb 2024 16:15:28 -0800 (PST) Date: Fri, 2 Feb 2024 00:15:26 +0000 In-Reply-To: <20240201-b4-zswap-invalidate-entry-v1-3-56ed496b6e55@bytedance.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240201-b4-zswap-invalidate-entry-v1-0-56ed496b6e55@bytedance.com> <20240201-b4-zswap-invalidate-entry-v1-3-56ed496b6e55@bytedance.com> Message-ID: Subject: Re: [PATCH 3/6] mm/zswap: stop lru list shrinking when encounter warm region From: Yosry Ahmed To: Chengming Zhou Cc: Nhat Pham , Johannes Weiner , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="us-ascii" 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? > }; > > struct list_lru_one { [..]