Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp1178925lqs; Fri, 14 Jun 2024 19:51:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXOH+TCOMYHOxbRfGT2ZvF4v/7eInBKRBH4R2WVxiUkmLs+rMDOxhwWSxe2lf8zfmchOXluA72vPE4md3+Q6JEmslUCeXGdOhltKerN3w== X-Google-Smtp-Source: AGHT+IFllmg3awvwyXSkGg6giVe7sDNthXmpyKE/KweHzvtnRk/3V7pYJZ+lhGT8ysG0yyG/nGm0 X-Received: by 2002:a0d:d408:0:b0:61a:e947:5518 with SMTP id 00721157ae682-63222b58acamr42873427b3.27.1718419890139; Fri, 14 Jun 2024 19:51:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718419890; cv=pass; d=google.com; s=arc-20160816; b=OIw5pp3UZ6PZM8rpSl3hlYcmkYZ2Sqw9AbalazvnO/ps0GajL6mSbs9m4RCs4V+aD7 AV9v3wQdyIg1rcJyPOVM4RJzBr0xlvhAyc3W1jXqceu7iEu7VYn1iT40zL5JONglAsMK yvxlwC2T5nrI+021aQhoCmM+GAyinmDapAkAqr7wJJdGhUGkvjRnNJq/Yh52NcMtrmnM cisVct3TselXxIXZ7p9oNXLidRVHZI5Uik/sCPiQK7uYt1JvagqKPwwn8d72u8qQM8iV E/HLah6su7/SZgQb3AbSGR5K/IzORVOXbzUhGurG+d1QYbjePKJQunxWhUUYLBGBDsj4 zhag== 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=xUNrySc4ZkMgMdDGKOc9NdgW+MNGIt+162yLlWifTWw=; fh=bogQrhqo3Ys5Gp924MYKtbGUQj8GvE+AuGkyU5c6qhE=; b=SWpJvSt2EL6jlN4aKr3b9sG1iK0mesr76YzMU1BfzOw6dcZHi6mqMK8tq+7i3R/aPh ed37DawtrTT7WeWIufOLXMlGRN4K0MBdWT0QqCnB51wLO1C6ut6LgPeg1SX5UHkYAzo3 0RGH/9LQsJqcXYOSjkVnhbIQ6fqYPo8FwsOeTc0pxLvNLjTEXPWitppiGmEWdhKpn1eU g/TStCwcH+6FrX+ODhOmEemsfwvyaLozu7EFLyy7EAGjcMy2sr0fgKEM9/L2c4rFvcD8 LmHa8chin0UJXze7yHVFkIH443LBmrEIO3MFn0T6pQ/lhlS6fCUU3phpQ/w+0NHeHuGY KqoA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uRnHVi6R; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-215673-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215673-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-798ac096dfcsi511754785a.754.2024.06.14.19.51.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 19:51:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215673-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uRnHVi6R; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-215673-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215673-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A699C1C214EE for ; Sat, 15 Jun 2024 02:51:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D1BCCA6F; Sat, 15 Jun 2024 02:51:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uRnHVi6R" 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 87D9A2907 for ; Sat, 15 Jun 2024 02:51:24 +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=1718419884; cv=none; b=avUEodOSJ6osyyIqEoNSmthAlkS/hWddJnabokEIPF7+zRBNd/2yj6YS/aOKma4X5Re/BLWFEBJ53hYJ6KxGRpJtOpAWNwUNNX4OXj5CIXP2xlNkV7e+Fcu6DVhTKYsKUrrsLhucnGHCL3Kjy45zRZ9NgxSoMGE8E7aVN+/WacA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718419884; c=relaxed/simple; bh=hzi5z305rKc8dBhBbV12L+aW0t0uf3vTIaGYA2JEyow=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=I4J9WvVdeNA2ofeklGnWQJmcQBzaThjQmm2zeUdiZ1nG6WJD0XATKD9C1oyNit5nZtWP6+HOlrTh3eQ3vkv6JsqFTemeYyk5RAOdKCGpeEjBYEGvk6Vt/oYoEGKhUjWE7OHnhTm6aaCLCLLRgrRfmpvlOnpjlcRtkrU2O3bs05k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uRnHVi6R; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D837C32786 for ; Sat, 15 Jun 2024 02:51:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718419884; bh=hzi5z305rKc8dBhBbV12L+aW0t0uf3vTIaGYA2JEyow=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=uRnHVi6RJfhc2x1SI9E4uMlPJkB+SthoGu/EV0JstH1PivYbYn8W/dVMBqAmzkMjm h2D8GbDpaXcK0q8B5fx7IVXI0ohO9L9Vu3mhMHuzSRbYF0lmgzULecVE0IjpHOoNVh mIZOadwtUoniRtAxCGa5GNyZCa4eAop448B/fgwCzoq1BRx9SzGA0m9x9PPWubS2/F vQFKaiHpNpiASTCWddXnINLuxrj1nsEqPloBOARPSErkVInvxJI9yLph/Oa5iRNFK+ 9HjnlAB4rzFte3vFBKMg93lkVIXGoYgAJeGyopVZKcVGmh87Yrj7xmkWQzmpzfv8jV SXTdfFv8nFiCw== Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-52c32d934c2so3036916e87.2 for ; Fri, 14 Jun 2024 19:51:24 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCVclL7WSUGq+emkLRQXQo4zEMyErHhn8oJRt4tDz00MmNECFjHhK+1OG1zmzTq1JnlIvjzPzamsZa+NEXNTgXTu2RL5o++CLrZvw3PR X-Gm-Message-State: AOJu0YzGtO21lZARpB/ytZIVAlIfsqNCv9tBexfiDfYjEdKmcypc51PS yYjOMgulFAWsvdNP/ODg9dcZfqMni93CCV3g0gtWl9vGUOfrGr9v63jzsvUQ/aExce0iTXV5QIg hw+zCwQ2oKaXzUZzzyrgs8N6tBA== X-Received: by 2002:a05:6512:20cb:b0:52b:bd97:ffde with SMTP id 2adb3069b0e04-52ca6e55d56mr2574730e87.7.1718419882804; Fri, 14 Jun 2024 19:51:22 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240614-swap-allocator-v2-0-2a513b4a7f2f@kernel.org> <20240614180606.5f3b6f4a6cd515df30b7a0e4@linux-foundation.org> In-Reply-To: <20240614180606.5f3b6f4a6cd515df30b7a0e4@linux-foundation.org> From: Chris Li Date: Fri, 14 Jun 2024 19:51:11 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 0/2] mm: swap: mTHP swap allocator base on swap cluster order To: Andrew Morton Cc: Kairui Song , Ryan Roberts , "Huang, Ying" , Kalesh Singh , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Barry Song Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jun 14, 2024 at 6:06=E2=80=AFPM Andrew Morton wrote: > > On Fri, 14 Jun 2024 16:48:06 -0700 Chris Li wrote: > > > This is the short term solutiolns "swap cluster order" listed > > in my "Swap Abstraction" discussion slice 8 in the recent > > LSF/MM conference. > > > > When commit 845982eb264bc "mm: swap: allow storage of all mTHP > > orders" is introduced, it only allocates the mTHP swap entries > > from new empty cluster list. It has a fragmentation issue > > reported by Barry. > > > > https://lore.kernel.org/all/CAGsJ_4zAcJkuW016Cfi6wicRr8N9X+GJJhgMQdSMp+= Ah+NSgNQ@mail.gmail.com/ > > > > The mTHP allocation failure rate raises to almost 100% after a few > > hours in Barry's test run. > > > > The reason is that all the empty cluster has been exhausted while > > there are planty of free swap entries to in the cluster that is > > not 100% free. > > > > Remember the swap allocation order in the cluster. > > Keep track of the per order non full cluster list for later allocation. > > > > This greatly improve the sucess rate of the mTHP swap allocation. > > > > I'm having trouble understanding the overall impact of this on users. > We fail the mTHP swap allocation and fall back, but things continue to > operate OK? Continue to operate OK in the sense that the mTHP will have to split into 4K pages before the swap out, aka the fall back. The swap out and swap in can continue to work as 4K pages, not as the mTHP. Due to the fallback, the mTHP based zsmalloc compression with 64K buffer will not happen. That is the effect of the fallback. But mTHP swap out and swap in is relatively new, it is not really a regression. > > > There is some test number in the V1 thread of this series: > > https://lore.kernel.org/r/20240524-swap-allocator-v1-0-47861b423b26@ker= nel.org > > Well, please let's get the latest numbers into the latest patchset. > Along with a higher-level (and quantitative) description of the user impa= ct. I will need Barray's help to collect the number. I don't have the setup to reproduce his test result. Maybe a follow up commit message amendment for the test number when I get i= t? > > I'll add this into mm-unstable now for some exposure, but at this point > I'm not able to determine whether it should go in as a hotfix for > 6.10-rcX. Maybe not need to be a hotfix. Not all Barry's mTHP swap out and swap in patch got merged yet. Chris