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 E721FC4829A for ; Tue, 13 Feb 2024 22:46:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7BC4A6B006E; Tue, 13 Feb 2024 17:46:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 76CB16B0071; Tue, 13 Feb 2024 17:46:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 634646B0078; Tue, 13 Feb 2024 17:46:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 5189B6B006E for ; Tue, 13 Feb 2024 17:46:44 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 160541405AF for ; Tue, 13 Feb 2024 22:46:44 +0000 (UTC) X-FDA: 81788266728.09.FBEAD09 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf25.hostedemail.com (Postfix) with ESMTP id 70026A0015 for ; Tue, 13 Feb 2024 22:46:41 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ZQz7qO0k; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf25.hostedemail.com: domain of chrisl@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=chrisl@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707864402; 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=tahkLbzZJTbPBmfqDNbj8FFCBXbnmSOOSJyiu4ElVQQ=; b=F1kavUGP7HaevBGOm6Yh18d8xd6qYGZE1unPyaBtK0DjCT5uZ4iFVEjqi35p06WESYgUQS 36U/563fylLyeCsYocFHqBaAdr1UF2yIlE0nGc29Ur/uZlFq4s+aCMzPOK4SqnoCtHpq03 UCQzmrLQMmPB8U3FbgwN7krdYHZaMwI= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ZQz7qO0k; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf25.hostedemail.com: domain of chrisl@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=chrisl@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707864402; a=rsa-sha256; cv=none; b=Kp7gV0wCccjDrJw21etvVigmxngqzuP+FUBoQCOBqLuWAY4UI5gKKsPJdOD8vkUkWrTJYP gZE8ewif9FS/STV5iiHOFa+hhYHdhgROw1O9DB4HZ6kKXCBLe3wkvqXg4AWdTv5si7BH+m Y4oGkQwpIk6t+mji+uKx7sJlW35CIVU= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id F3BDCCE1F6B for ; Tue, 13 Feb 2024 22:46:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DFAA0C43330 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-f174.google.com with SMTP id e9e14a558f8ab-363a76d0c71so25656575ab.1 for ; Tue, 13 Feb 2024 14:46:36 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXR5OrwFgWTGxAkiJYJZITX0O7pcFH/g3mOFVrgLNa16u3lLCDMvqeYqjOQEVMNQ238qwfB3P2/YPg1RaN4aNrI9H0= X-Gm-Message-State: AOJu0Yy9ZjTKocmnD9o0Qvkpcf/l9oHlPzWAdKSqrTGRwYMTU1/8D+JR LKyh0/lpANtjH0m85JP4fRaMhWGwseTEeACClnzEelDeiWqxu53cH1MNoUcrUOEk9zv19pnPTQZ Fet3cAVnrJUO/8I3EruisaEqN5eEtJJH5w3ic X-Google-Smtp-Source: AGHT+IFDbwtLxTV96mDLQjJ8ZBY9w+mfkppY90pVw7B1ds6Yr0F4l0ShfF4c2W1GGX2TgYNR2LWQoU0aY0TH7Vb+0NY= 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) 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 X-Rspamd-Queue-Id: 70026A0015 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: wi9jthja3c4cr336drge8m1m43sg7o9j X-HE-Tag: 1707864401-785374 X-HE-Meta: U2FsdGVkX18XWrZDU+u36rNjvBbZAnQmn9E9namHX+hHggNjtJvYUit5c2LqksbTFGT4qQ7Yyh7dc1oEuDuH52C1VszRpMwgy6bBQxRgHY+FF0i6Hj4lVXbKpkVBz0+LGqVE2RLFEY2AxQy3RBSzh5NK6dyv9jSJqCSr970OxGlS226QDuLzojcN6pb/TqmMAKZg3J4HgPdc4yKQ+5xY8l09W8utQlVcBI4NHBEyXqopnpnMVyrJgkqp0SM0XfxAWhO7MjkiGnkaoT+F+HNxOIwPtR6Q/+4m8Ji09Ny857dXsrv/ED7ESbkTwgzAPmIVFElGgT8nXGFvTXRbsyRQObTNp7cMbM2CZRALv2D4jfcT3/R9huL0meChAcgtnjd/eRwa18a2iZuRssJkyPypnHkMRiixFyyGbOJRMGI7Z52JAbAjIftPxVjXhDyB5PRWAOKqVF+42GCgK+0LS03CCOQN4qZowcsn9tCBFQ09EqFWTACvB9TomLU7ei/mLfJ9tp2H1Eq6UocvfNmb2wLl9R9a/OBvCelkOmJVdJh9Dp+Y/EAMg8/8B6JvZxyR53xBu9msS3oPdoOwoPwwLJrDP1o4BltDPmpBp3s4mywtRlBhU2jswHkczbALo+Cg6Thwv49/ajcG2ovivD47h4Om544AjMXVOCuXNhL9zuHXy39QAOtriSl16a/dZyDQbzP0/JqqzZQLRNLsSuaczbJmLN/KMCf9prkHMGlAPYWvNJugksjEpFZnuzU82PTG5ZjNyb2h1WvftiJUulbAt+cXmh7yMNdeavVXUeFGwymO0c+GSuyAS7VV/KuRP+uiouF+sN8rUx8sa+tTtmYq39jY0XQDZMCRdRd6Y55+J8oCeUueVlwZ7nS69QWnmxrlO17NuK1EXrdr8iYpnStyeHSK/X7RqlXhBfzuxU76oXt8gBHJ9Cjlhx9JNONYUpEcUsMowHHST0lniMguwcwBFhX QuFKjMxC wlkxcTlMeTHfLwBBr2TNzGXphu1wBaZdtwQkAN/MYpihgTiM5cFI1OoQwfasFNUnEcd+nJPcOMdPs4ys16Fy0F9dIEyWyjj4zsdeLjKK30xX+JV4tuReAT7+i/n9SFJzGG/Ls+D3dySIPP5+PMP/LTYSpbjBMAGSsPfYPZu8eXP998Irg+ni18SzLk3vx1WQmi97iN0yx1IQW9Oy61Ky/jRtv3If/7/48yvKwnQrMVnXMK6s= 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 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