Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp27089rdh; Tue, 6 Feb 2024 17:51:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXrQ7/YXhMeheshsRJaoUbGP3E6x0u1LXTSnrzmAy/vHWpNO+kgV02QvwTlLj7/+4rY6lYSadOsdwL15DnWZiPGiZcc+328+dub3wztyA== X-Google-Smtp-Source: AGHT+IGL+zwB5tU3IF2EoPU81kR0s4KVhP0npDyv8/u7aLGdlzeMVyzU/pnNtSvlxn1T6IeyWbxQ X-Received: by 2002:a17:90a:d18b:b0:293:bdef:ce72 with SMTP id fu11-20020a17090ad18b00b00293bdefce72mr1438944pjb.9.1707270700530; Tue, 06 Feb 2024 17:51:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707270700; cv=pass; d=google.com; s=arc-20160816; b=cPpJPgIRGe3XSIUX1FugH5u+sQr7kCMd71m9SjFboKz3/5IkU6KsFCzOC9AP8DCZer xl02ueCzA9k8mHcWRSgaR+/v6i++0NqRKhXzEHuEeBCjCC6Yvvvv9BuN/OjFpaCh3gyq qK4TaVyS6Qy1TRAd0iWK+6FftpbPYqluJmhvw4nCjunH3vDHlyi8odo8aHX+H5Qy57OO i2N4HeMJCFDDl6zwUbdPVcTQaRiCzuIuH+AS7j6Cj6cV8v5lxCRn+MQLRpD2efodEdFi LcoqsMbAw1loxqw+HSRLAqgHWPmnsIn8SvXVg3c65z5BDHmooUCTpczgjfvOavNfYmFD 5FbA== 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=/voQ5qEPn/a5LRCt9po0+5vzg77mq73yzgDRYjHcbPc=; fh=TsSrAI2khMRp2Kg3wczOlYgP2iGbQz/sMPA6AYHv1NM=; b=rLCNwDZjWYBi4l5L/HSb1iIIf3ujd0ubO0+0j+2832vjPtykpfo6VRiw9lJcpum7uF YvGsp75O2U3BMVhwc6BSf7/WPemq4lC0pwm/iZAiVae3qzvrJKp7IyB0XJ/R4e/dgWWh y2GRRPldOhfw3ApJgUI9ZS/uBYDl2l9rlG3VROcXgeV2sXNkSKf0bDX8oLlnnAS2j0Eu D7Ddbbri8Kex8hN4q9u+LP4P1QSfCmaeIXXpTKkqT6hW3jAnpor/5QIEGyP7FgEcVz3d J43gQqn5A12O3198+tvEvw+DGHmq4iICeuAFQTIUVCO2vlommU87gYbT8ntcbn2ogVSn IjtA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RtRvJPHD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-55823-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55823-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCXHwzZbNWjQiZLmZ/G2P2MZr1TUgtpkvhRTRf1WOMbQDIuRfeyEkITos3E+ZOdDMM8JDSbExf+jgXSc5F+OH6PR1Lh2geWSnzubkGi8yg== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id qe3-20020a17090b4f8300b00296a6136724si2204010pjb.163.2024.02.06.17.51.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 17:51:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55823-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RtRvJPHD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-55823-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55823-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 34EB928C707 for ; Wed, 7 Feb 2024 01:51:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8A338DDCA; Wed, 7 Feb 2024 01:51:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RtRvJPHD" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B4505DDA1 for ; Wed, 7 Feb 2024 01:51:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707270692; cv=none; b=LiVhLJqq5kZXRFLcaW1h1g0/9A86pjYPxhLA2iORpvvqmMc0ddRhWSG0x73d31QzbwYcr6YsSX81T9BSjLak2oxppNzkkPDAeIgLcGNExEAvVNPB3eq+R2Kijeezxc1S6PYoxcCpCAYQg8hGHOnEhpyBj21MJMI2AOqSGmH0wzQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707270692; c=relaxed/simple; bh=DR/f4wmMEO0FHWiT6UWA2tVUbamBflq7aNmEDUILUlo=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ZMWHQb/06v1gm/xzb6b2Cfgy8laVnnDKLwuvEuK9AaLXor4yKqCUmrdBduQoJiq5wou7ueDJvm6FNlfwpnNKnHoukkxLp0rPMUichtxQrnxu/n8sfP5Vpu+yrtonCGqkyVye8cy5r4zQFQokQhog+y5xGrZcD1XJ2YAzJg+/rqo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RtRvJPHD; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E50BC41674 for ; Wed, 7 Feb 2024 01:51:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707270692; bh=DR/f4wmMEO0FHWiT6UWA2tVUbamBflq7aNmEDUILUlo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=RtRvJPHDc8lDdg75nS1ecN5vYIqXsSsTE+LTQYqbEu8HHpU9Q2uHD+EGdQa2GoKv7 FSDVHnWbLwcDRJC+37HbWS/G34jPrbBy5KiaPA2XLSgCoViXZ2na20fBczYMSYNQIs VjvMxLoYbmuvy5fm3Kf+S41dq2ZnWYEYqDr4tk0m2WAaFAw6OHBdaj31EPPa9WVtqp AZi08bVxh5Wvq0G0UbqA+XCBdntEAr8n8AMigIP+nsnUnptrtuwbADEnP3yCvdU/nO FuGxU8y+CPdkSbcu9Itcz5STHTE4Tz9ZYjftHieNiGJQZQhM9BqVVt1KDAfTitDDHL fxqd/kLmw/33w== Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-7c3e01a7fe0so5476739f.2 for ; Tue, 06 Feb 2024 17:51:32 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCX4jtaH93noHi+ZL72fKbJfmUE0Q2WU7dFllleTyLyQRWPDO33aIcTf7HVPhWhee6sMMa1Ti4rMRRyVB1kUjh9BX9dsDP9ozdtQ/Q16 X-Gm-Message-State: AOJu0Yzp3OQSboxWNh0gWQGQqF1tyl02Rw2WKwejRv6YO3lKkrFEE8G8 9BluWiuJOvYUICGNNQ0U5hsqmFNtO4p0FTss/VENVuHmQ+tOsStkVQBoDrTIpLa6izazfRpfNKH y67uZezYQQ4LfhGMHkaYJFSHKzpnSGRFEOW3x X-Received: by 2002:a05:6e02:1d04:b0:363:bc92:e4f with SMTP id i4-20020a056e021d0400b00363bc920e4fmr6455830ila.23.1707270691181; Tue, 06 Feb 2024 17:51:31 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240131-async-free-v2-1-525f03e07184@kernel.org> <87sf2ceoks.fsf@yhuang6-desk2.ccr.corp.intel.com> <7f19b4d69ff20efe8260a174c7866b4819532b1f.camel@linux.intel.com> <1fa1da19b0b929efec46bd02a6fc358fef1b9c42.camel@linux.intel.com> In-Reply-To: From: Chris Li Date: Tue, 6 Feb 2024 17:51:19 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] mm: swap: async free swap slot cache entries To: Tim Chen Cc: "Huang, Ying" , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, =?UTF-8?B?V2VpIFh177+8?= , =?UTF-8?B?WXUgWmhhb++/vA==?= , Greg Thelen , Chun-Tse Shao , =?UTF-8?Q?Suren_Baghdasaryan=EF=BF=BC?= , =?UTF-8?B?WW9zcnkgQWhtZWTvv7w=?= , Brain Geffon , Minchan Kim , Michal Hocko , Mel Gorman , Nhat Pham , Johannes Weiner , Kairui Song , Zhongkun He , Kemeng Shi , Barry Song Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Feb 6, 2024 at 5:08=E2=80=AFPM Tim Chen wrote: > > On Mon, 2024-02-05 at 11:10 -0800, Chris Li wrote: > > > > > > In our system, a really heavy swap load is rare and it means something > > is already wrong. At that point the app's SLO is likely at risk, > > regardless of long tail swap latency. It is already too late to > > address it at the swap fault end. We need to address the source of the > > problem which is swapping out too much. > > > > > > Could some usage scenarios put more pressure on swap than your > usage scenario? Say system with limited RAM and rely on zswap? > Of course. In that case what I proposed to do will already doing what I think is the best of this situation. After grabbing the cache lock and finding out async fre hasn't started the freeing yet. Just free all 64 entries in the swap slot cache. It is similar to the old code behavior. Yes, it will have the long tail latency due to batch freeing 64 entries. My point is not that I don't care about heavy swap behavior. My point is that the app will suffer from the swap strom anyway, it is unavoidable. That will be the dominant factor shadowing the batch free optimization effect. Or do I miss your point as you want to purpose the swap cache double buffer so it can perform better under swap storm situations? Chris