From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 677FFC4828D for ; Wed, 7 Feb 2024 01:51:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 94B5E6B0072; Tue, 6 Feb 2024 20:51:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8FAC36B0075; Tue, 6 Feb 2024 20:51:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 773296B007D; Tue, 6 Feb 2024 20:51:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 6734F6B0072 for ; Tue, 6 Feb 2024 20:51:36 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id DC4C11206DF for ; Wed, 7 Feb 2024 01:51:35 +0000 (UTC) X-FDA: 81763330950.15.9CA1CD7 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf07.hostedemail.com (Postfix) with ESMTP id 1CF9740005 for ; Wed, 7 Feb 2024 01:51:33 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=RtRvJPHD; spf=pass (imf07.hostedemail.com: domain of chrisl@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=chrisl@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707270694; h=from:from:sender: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:dkim-signature; bh=/voQ5qEPn/a5LRCt9po0+5vzg77mq73yzgDRYjHcbPc=; b=w3SRLu1CbQYTkA/1UIklskuSYmorTr+JgqZyW+EaSh30TTyWDRcxYCWqx6p48F5NzGAWHQ OCmjiFzQgjjnCnjeL/6DdkR7coJbCHLpZIqArgFRzNd3ijQ8Ga9/DMlGJ71zIkjDrv8ixJ AReX6DvEZcJhydVlxRwMZRQd84VWvg4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707270694; a=rsa-sha256; cv=none; b=41sxiv1mMMMdliTSzXOm7C2HkH8Tvd4FMqODsnazBNIsGr5Q806I9JhefSJDP2SD7yEQ5b eT5+VkPSdWEBFfcnnjfbxbkuh9SU2sf7oq510igIfVzWwJ7vyWFaoaaTXr6A+qtgnB2QON O2381hNgNESVZxBPu1LeQ8phABq5UKU= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=RtRvJPHD; spf=pass (imf07.hostedemail.com: domain of chrisl@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=chrisl@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 1279A61767 for ; Wed, 7 Feb 2024 01:51:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C694C4166C 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-f51.google.com with SMTP id ca18e2360f4ac-7c3dda2a76eso6234639f.1 for ; Tue, 06 Feb 2024 17:51:32 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCU/56rUCB4B9HLFp2x0oCcFSLDjFrW0OrZItp1p1lIxk8DY4UL6XBEn+Vm9YHBX3k3W8zXFKT58NhLP0mevfLXQv8I= X-Gm-Message-State: AOJu0YyylWsGuMPXbKEguUK/Ajo7X0PY8YF/Zw5rQd46N1rc3iLlnY06 X2FRyj83/GqtBkRtwsp8srfA0huFUYKY/Jxju4W3rKvRbZTIVLtvET9qxic4HiUpobW21GwCrXG sjJZ+BcBMD6zB5585Imtaj9b4jIBVXYz0FHoo X-Google-Smtp-Source: AGHT+IHKa1DtQGiIaDMRysece3Z/Gb66f23Tv+SkqePrw9p9+AEvslkh3C3YT+7QzX+KhkV4kbgSNf2IlmrXerMbkBQ= 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) 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 X-Rspamd-Queue-Id: 1CF9740005 X-Rspam-User: X-Stat-Signature: sz83k6aqqboq8q8my6pnwrowmmcj7jzf X-Rspamd-Server: rspam03 X-HE-Tag: 1707270693-709715 X-HE-Meta: U2FsdGVkX1+fxRmjc/F8nrJpmm//2UsCiYQ520OJhYaDI76+/DxEcBAPX1sSjkA8DUMkfpbg3gpG1XdRXQJZTHr9fpe70bytIrQD7yXNFlSJc3DOeExV/8A46ozHiZYCujBofTwRDE4jZJ2o1fvWkfogag7wrcSCMRn/4zmdEch4/TRf7i6K01bKhmCuN7G7Gl/vDPoqtg56W/UfsF1y1cCdGPqvUtxCDYNqQXzgHF1mdvbIpZH8+f7hgtyeF+piYSuSxdYt7bNLapcqEPARCEU1kmjQZCWmnXuMju+wvuyu3wyEflFUN3lEH7vYeo3fiDGwHbaP4j9dWucJnvIGBJx2KHng13EI2VSa+rrU5M1416FmxtrgfuZirfbth12NKtULSfAdZ9mDflqStxFo3d0IgJBNuQBxj2FbhOr7ja0ognl/gZY0Zj3wZTYyHUJlWjc068GGcG2LJuZtab6i+YIuP2I0OIcdxzfPh18exPBnfoD4dvZeCHDQxbTDYJfflxKUmrasHYGbuuMwCYS3pYEbSPM9+4XHdBmIX0mSYZMyPJJ6MwDWSd8dYvlEIcrvFGDC/Re/jcvYpuMgbtZAIJfgMHpD1A4Emab6OVDbbfCSnXm3BLKKk35o6EHY7aPxJXZ13N/0LOgW2LkNNq4r6PsEL95SPd82R0M5Y/UPSrQBVi0+gyAP+ayE1tJnFl9J2U5VTPqKTY3D+xI59nDOowmJZm03888fBi5rKjQ2seQzf3JV6Fd89DPBrd29rdk84IVvHgbQOin7BqXjKsnaWnAwTA8wlTEt25Thx/2L1su8z/1QeI1bGZfCxlx4W9nHWUxAkpD8wx+re5NY+Z4nDtHoVvTurqsDZMCGftXGyR+7XZGAdzQovUihZUxltozjbiPnZbwyJusf6HRe8qQ4r3Y9pFkEf4IopaxxM5EgZ4s= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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