Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp215188rdh; Tue, 13 Feb 2024 14:48:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX03XbAKcpaMB5qbhQEuKUu3jqvvjZjthLjxkchr9+M/JdLOWAZLbPL2P/hSgUVyJfoc6dvkkqsQHmqZ4C+KjWkCTWFfegnv/4FuGnJpg== X-Google-Smtp-Source: AGHT+IFhqoDI1ng4qgm8/DLVZCUNMG/OWfUC1+P49IVCV6SVuyixQ3TG/dnu1KMCOLjHmLXMNWss X-Received: by 2002:a05:6870:9a20:b0:219:b163:70d8 with SMTP id fo32-20020a0568709a2000b00219b16370d8mr989015oab.6.1707864519694; Tue, 13 Feb 2024 14:48:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707864519; cv=pass; d=google.com; s=arc-20160816; b=vioAdVf5E82fQlePuD/xSbt7RNA4+6G2p7GbMERbyM7pxM9WC3O0Q5V2bvCiWljFzY K9z6VgLNrsHnRiHc/hTmP0LHP6o4xEQcJg8cwRKFIrAWhocrn8+z85pAO7AoSV/sVK+N 9/C+AKyXQyTPv6S2F1O+xfJ+jKyfc6c8E5ozpdaX3CJc/W1xUY0rCUg8oxfmpFAzviWc RMpnmuZGDFJih3Aep4p4+1kG/BksClrZLvzmTSmTAWsvjUbahscXMBUzD2Y7Iphs6LH/ PHA+44v1bgwy3YzTi4ocLwG2NS0WcJV7FRZEi+UtbfTQQssVfVXUzHv6lvdoujQK0aGk KgFQ== 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=tahkLbzZJTbPBmfqDNbj8FFCBXbnmSOOSJyiu4ElVQQ=; fh=3q8+MBbhvrKdsaAxGMuRrY/2KItqisC+triuj8jB3zs=; b=OPeAoaSVE00N3gV8XDeM+eZSpX333CKiWBPq18z0Mc9wwEj3IjHlZW+fwyNXO4JC3j B4moFC6bkXPk83vMGgIAfwXkTl3834WGuTgdtWMHx66eZB+LmBEuCq3X443sjUaP7Sh8 kca3b2T5GyAe9v/6Zfv3fyNHKoD8JnGHtg556Cp9XEv6t3deptlQuO4OaJa0258KXJox TnqAHM2qWpGzU08fk8fHr6RNYglN8RMmiLU/3lNAFpW2P4m71irPv4A/r8dz3y6yVMjb NqeMrNB0oTF4+1ZE0xoDpsMFnVWIDIJ9OK6esWG9ukro1KQOuk3CLQBuRX8Iwa5NzuIv V0zA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZQz7qO0k; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-64482-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64482-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; AJvYcCX8xcw2uUI1PFBHTCceZyKAKPjNBw7B6F5uL6MbajYSbpUZKrLhcwNdHN5Kb62lnhBaTgcnJeCKkqAAxDxcMrIicQn3S7IyOlVuWqIOaw== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u17-20020a63b551000000b005d4a1e64c7asi2744775pgo.332.2024.02.13.14.48.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 14:48:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64482-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZQz7qO0k; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-64482-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64482-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 2E7DB28D257 for ; Tue, 13 Feb 2024 22:47:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 52FDD6280B; Tue, 13 Feb 2024 22:46:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZQz7qO0k" 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 79AD3627F2 for ; Tue, 13 Feb 2024 22:46:37 +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=1707864397; cv=none; b=fdW7fTnlBSoOKahRdLHhZjjjYYt4xL0+7b4F1YMwYYxZfeLzxRQ5/wkVOGvhnELFbfNnTY4VHVH0kcChwx65O0VxsW9+jIYvq/sR37tcm7nou4GV6YLhCHEH9axcIaOSvBw4RBfDgTmXOXW1zquZaTbyhS02XSiQojnSaSW+hcE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707864397; c=relaxed/simple; bh=XjqRzsF19RiJZQ94exeXbfezzXzSTHX9xuRbZPegwrw=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=OxtjPXv2lfEqI4F1KNqyYTJyKYewhXRY48aBVtrQBNDhs90lVM+dsyFxFLzc3ZAiu2jKamyazib3Ed1LQ4NOieLCPWtp8BwuLx3z9g6UfbI4BREH/RsstgK+ye5z+uSR4tvcl9SpQ/ph8mE8uQWT3MP2+apbaTk3m5k9XbvVqU4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZQz7qO0k; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9212C43142 for ; Tue, 13 Feb 2024 22:46:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707864396; bh=XjqRzsF19RiJZQ94exeXbfezzXzSTHX9xuRbZPegwrw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ZQz7qO0keuO3YBKuMiI6KXcCqx9cI7pjeeHkzz5Loe+3FFlUpsnwbf0FeufA6JIu+ aadbOvzuTwI35MOLhuxbseNVDV982//3cGoDKPlRFHUQl00zVDksBlkKkuckkrVi70 z+F+8f6qrSTaM5YUi2STL5Stpm1FEhK7wDee7vhsziEfXqa616anElLlvn4UXjpu3S WoX6i4zfUPCZ7uRa33VkbpRcJaDLugxR3WMw2HE1CC6Sn3Oje0UylRy9vVThvCD+8G 8Zn9QopcaxvIdj0F0lQW+h2/1qJ3L/Wtjo7FGlzOKmF1UW6SuDzNbNbssGdLori5pQ 1kFreN6hWxC0Q== Received: by mail-il1-f175.google.com with SMTP id e9e14a558f8ab-363c2edac5aso17508375ab.2 for ; Tue, 13 Feb 2024 14:46:36 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCW7E8CCT24EKxa4WtKlBFUi1p7Pcs52J3HVfB2r//g5gvNUUN91FXumQCD1E9fWT4Dwaws1wjYZlg89m1qiPrliOjktQHqAmVTjfKcz X-Gm-Message-State: AOJu0YwOVbekoBIMWjnpYuBHWDQtJSVk39iAp7Rk+vIzEMaZR51MPmk1 YrxkY68aGrtMwQ3JBd+BfycyLGSCdc6/fh/tzDOjwkd9I2KZS/tE/PTZ2DFvY1TPhA9Qm3n6grE +j4YZSrPR35B+GmYoj6w5vIkOcqOe0jWpftl8 X-Received: by 2002:a92:c945:0:b0:364:21ba:c4d2 with SMTP id i5-20020a92c945000000b0036421bac4d2mr1294135ilq.17.1707864395938; Tue, 13 Feb 2024 14:46:35 -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> <4f1d0c0369e3b08cb0c8d2271396277df6e1d37e.camel@linux.intel.com> In-Reply-To: <4f1d0c0369e3b08cb0c8d2271396277df6e1d37e.camel@linux.intel.com> From: Chris Li Date: Tue, 13 Feb 2024 14:46:23 -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 Fri, Feb 9, 2024 at 9:52=E2=80=AFAM Tim Chen wrote: > > 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. > > The original optimization introducing swap_slots target such heavy > swap use cases when we have fast swap backend to allow higher sustainable > swap throughput. We should not ignore it. And I am afraid your current > patch as is will hurt that performance. If you change the direct free > path to free all entries, that could maintain the throughput and I'll > be okay with that. That is great. Thanks for the confirmation. I will send out the V3 soon. In V3, I changed the direct free path to free all entries. I also add the /sys/kernel/swap/swap_slot_async_free to enable the async free behavior. > > > > > 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? > > > > I am not actually proposing doubling the buffer as that proposal have > its own downside. Ack Chris