Received: by 2002:a05:7412:9c07:b0:fa:6e18:a558 with SMTP id lr7csp285773rdb; Sat, 27 Jan 2024 06:34:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IEx7NALw2jAUbCojBfUpKPxrwfqm3HvK9a5s0VXs5/OJMI8sjIiE21rkRUHa9g0xiTjsmDm X-Received: by 2002:a5d:4604:0:b0:337:33a:c880 with SMTP id t4-20020a5d4604000000b00337033ac880mr1239688wrq.26.1706366088533; Sat, 27 Jan 2024 06:34:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706366088; cv=pass; d=google.com; s=arc-20160816; b=ydLnEhS7gGonOToHzi184xZGjiTcaNEWm08bhQ2YHgvx/8OJA6acG/Ob3sLXjqQiFp X5FVWY1zmNuRbx3ZTXccbfKg6rEAasv+UR9g6JLoHTYVI8zD9xycdLSttHruBueKuajq l230YDu5X7PusJZxU0BrcDgd6gu/fikVMUlwNnJ7lqslymkR4qE/P6orqiAHaLGFPPtG POYHghL0JdY+gWkhGvm4Zh2uuufEPn/UHJbIL1QC2HCxKz/LdrZxPj7IGBQKmnBwmh9l JNkVPfDbheNXiCfBGQVSTdjBgJLwD36TdI6ZKCRZG+kFrGlvHT+N8P2Ttka9U98VwbJ8 grvg== 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:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature:message-id; bh=ldE+n6NcSlOlUyv98rKcvvVoi59JjH0e26apZ4K5NdE=; fh=0fOCF8zU/TnN828XeT6cqe90qQYg456+5lb+7zS5w5M=; b=eHqvu31JGQcAKJ6q8qbcVZYYHiEkhVxICdOwP1ajP8WbSlrcqkJ7GwvE3vyTDH1YeT woZtDCiXHfM4nJ5fjTyBm4jJkKXcUR1W5lXApw2Q9P+TLLIXwGDt7x+Mpas/Yq83Zeqa qtSKl5eGFnallDW4GPsd87XfcR2EfzEnJmHBYFVqi5vG6+sbtU/NGva01NzbO4ajMoF6 4EmiDxAUSSKEzZ9Fj0EeGnos8+ZjSg7WvL3Yk2LmVgcwA2beyCtJzH/YAylyJMwlPSS5 4TG7K/rJv3iV/ocxgduZxCI5QDwt0pH4WDCRfS9oUNeNaAZcIsh66idZHzGZXXZYVTWX dVZA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=xY+sW1vP; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-41215-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41215-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id cq16-20020a056402221000b0055c7cd49787si1712865edb.397.2024.01.27.06.34.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jan 2024 06:34:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41215-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=xY+sW1vP; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-41215-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41215-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 48E9B1F22AB3 for ; Sat, 27 Jan 2024 14:34:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1977428DD7; Sat, 27 Jan 2024 14:34:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="xY+sW1vP" Received: from out-172.mta0.migadu.com (out-172.mta0.migadu.com [91.218.175.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C82428DA7 for ; Sat, 27 Jan 2024 14:34:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706366066; cv=none; b=uuvHa/DIhH5nE3eK2fmIFjIvaF1Zce2VbAmPp/0cZGs7y+oQIfYKu8EqIFWgAcxaz9IBSgWSKZFCMJpyf9vlxcbxuKRmp5OvPjB5fcNyyTUUM36P+eoACj2JYC+0+KDO7hpQITa4dI2NaFPnpLhRSpPm5TXiopOen+JkdSfNPqo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706366066; c=relaxed/simple; bh=a/yHEe/OKt09wRGJmHtE8WgIN+jHmTFBcgA8R/Ha908=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=FsF1fNhsFXgzl5f15sNoXQpSbumtA2VRzLNziZv5+gJjyEr0y4RoiMWxwU7OujKUbygR9cdlpDET5ECYamjAb092B97gwUE2RmdZJvwRQyVFy0sqvLqAl3OJtBTloFXM0sMhIM5a+1yB39iFHb4r7229M8pcTSfKKSRzJeg9r4s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=xY+sW1vP; arc=none smtp.client-ip=91.218.175.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Message-ID: <76b9e52a-9b51-4e4d-93ca-24a5aa3c4dca@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1706366061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ldE+n6NcSlOlUyv98rKcvvVoi59JjH0e26apZ4K5NdE=; b=xY+sW1vPLcqLgZzsSoXg8dr0ISiJPof/FCC8QysRWw3p2SZ2FqEMBVnNdRQZ9uhPfrYkLN bTI5kZuDGgbj7am2ufVQM1q/+E8Tuw8VtHKFgSOnm9NV8tuIM1+r9gAGtMPju0098LkrQa ARO9fbq9kW1T3PTP33iWofiLIhPC5bU= Date: Sat, 27 Jan 2024 22:33:49 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH 1/2] mm/zswap: don't return LRU_SKIP if we have dropped lru lock Content-Language: en-US To: Johannes Weiner Cc: yosryahmed@google.com, nphamcs@gmail.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Chengming Zhou References: <20240126083015.3557006-1-chengming.zhou@linux.dev> <20240126142800.GF1567330@cmpxchg.org> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Chengming Zhou In-Reply-To: <20240126142800.GF1567330@cmpxchg.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 2024/1/26 22:28, Johannes Weiner wrote: > On Fri, Jan 26, 2024 at 08:30:14AM +0000, chengming.zhou@linux.dev wrote: >> From: Chengming Zhou >> >> 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. > > Good catch. Can you mention the possible consequences in the log? > > "Otherwise, the iteration might continue from a cursor position that > was freed while the locks were dropped."? Good, will do. > >> 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") >> Signed-off-by: Chengming Zhou > > Acked-by: Johannes Weiner Thanks.