Received: by 2002:ab2:23c8:0:b0:1f2:fdbc:cb93 with SMTP id a8csp154950lqe; Wed, 27 Mar 2024 01:34:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUVO36Kjo6nEB6a8EE1X1WLptznmayhPgnFS2YuwEz/XXLQnYP5Xl7KzxJwD9QgEg8LpWRqWGs8QtA+2Ql2hpFVF7oG0Uxk5rMCyqQtmQ== X-Google-Smtp-Source: AGHT+IGt1Jdreum/uG8Ukr9E6c9xe5JwNg1IxFvQAnp/7JAN035O+H3xXGnZ8EHxemxbl2jWrxLo X-Received: by 2002:a05:6a00:10c3:b0:6ea:7b62:8e6a with SMTP id d3-20020a056a0010c300b006ea7b628e6amr2321206pfu.3.1711528493748; Wed, 27 Mar 2024 01:34:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711528493; cv=pass; d=google.com; s=arc-20160816; b=GkZMTsZezac8zCBAtDDLBwmt46K7UWvpSfkDcFz5tS4ULhGaV9XKF9Ohy7hCmeoLEp NuJylDDiq/jE825T0QclZ7TMlDIzw8ra1ASG8/EwOFVIRu/+ffwONPy/vvtOqhrJiejz B8gHvIPk2j00xec0TjCT6mn5CxJTkh0YM++46GZaIBSeKE79lBCdDKz4u2FS7S9cZjuB X+CLGsGVxUycJSe2aMQjz6ZaXpsHxxfIBZqxLUno1rFxcHomufX4cjQoV1z1NXMwDvxd T5FUJbQBIZoXC2PskkSwC+ppETWhLtg8PGteSPzjF3Xx7PtkzTMMy/xh+2vHbAD8/Sx5 47Dw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=RC9w5LPQ61SNTK0StNOnm30ZrdLpqGFFFBsKI9hog14=; fh=3AK5nYN+TfyjMyBYkC7MurkaTAblI/+q9pILVc0yKRU=; b=OIzVx2HBx/+fls6I/ln3S5OVTqOUpzvM2q3BZE1omdZkVpYYnfdRfSGQVlIXdYIxlR nDsdf/qlM8LE3dwBMRvRD1QflZ/zhcCEYyrBerCB+gA9nh7jlBB723ZbnKiFC/SNHA5q LTH7MEpOu618WZEJqz0eej1qmaVIFmVcXcQGh8sBGEAJo/HqtugfDEz9wceyzxwa6a8b xbP27lCp740u9VsYGwXb8yxVubAUoNQvfMzZc7OmLpDQJk8neo4R2JvreKxumHZvT0fX l3xBB730RSvuQkHuhIVHgfo4Q+rLFt0RWD9LqpIr38eKg47acjqt+TiF0uBiHFPIZEY7 l14A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-120539-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120539-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id g12-20020a056a000b8c00b006eabb33a7f7si2986369pfj.110.2024.03.27.01.34.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 01:34:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-120539-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-120539-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120539-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 7F871B23E7A for ; Wed, 27 Mar 2024 08:29:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 92AE13613E; Wed, 27 Mar 2024 08:27:42 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D0E93611E for ; Wed, 27 Mar 2024 08:27:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711528062; cv=none; b=gN3ciPE3RmWjzLTnAFgzl/ZggvrcdbeQTE1NhrCjiPkNJorgS3WHkSDZS9EnxLAuB0BqKbEHzaNnSrnUrPXvNTZkZ3LIlCA2Bgtj6xqs4vIirR5StmBdgppcx2yc/d1DxjTpQoXh3pwhFN1UoKeYcumWgO1Mt4Lo90Kg1D+1+08= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711528062; c=relaxed/simple; bh=VnH54qkK31OwjzNgwEu2pTHy+0ez5aLtACWBFnYqlmY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=L09gFuiwaSYxKym3AEoSXaZE3IYWra1TkJpLGJkxJCk806vAT3YylEM+vHr9p3/Zm3z+aLY55QQn2cuHqoukVZTOPO0a0gvXfptH7JpH/qJzQl6Ox3tBL/FessOy3seKUA8bo//ZAOQv975aR8I6SFDhdYM5GX/q1hNijkBXJhA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0EA8F2F4; Wed, 27 Mar 2024 01:28:13 -0700 (PDT) Received: from [10.57.72.121] (unknown [10.57.72.121]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 07C4F3F7C5; Wed, 27 Mar 2024 01:27:35 -0700 (PDT) Message-ID: <58e4f0c2-99d1-42b9-ab70-907cf35ac1a7@arm.com> Date: Wed, 27 Mar 2024 08:27:34 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH 00/10] mm/swap: always use swap cache for synchronization Content-Language: en-GB To: Kairui Song , "Huang, Ying" Cc: linux-mm@kvack.org, Chris Li , Minchan Kim , Barry Song , Yu Zhao , SeongJae Park , David Hildenbrand , Yosry Ahmed , Johannes Weiner , Matthew Wilcox , Nhat Pham , Chengming Zhou , Andrew Morton , linux-kernel@vger.kernel.org References: <20240326185032.72159-1-ryncsn@gmail.com> <878r24o07p.fsf@yhuang6-desk2.ccr.corp.intel.com> From: Ryan Roberts In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit [...] >>> Test 1, sequential swapin/out of 30G zero page on ZRAM: >>> >>> Before (us) After (us) >>> Swapout: 33619409 33886008 >>> Swapin: 32393771 32465441 (- 0.2%) >>> Swapout (THP): 7817909 6899938 (+11.8%) >>> Swapin (THP) : 32452387 33193479 (- 2.2%) >> >> If my understanding were correct, we don't have swapin (THP) support, >> yet. Right? > > Yes, this series doesn't change how swapin/swapout works with THP in > general, but now THP swapout will leave shadows with large order, so > it needs to be splitted upon swapin, that will slow down later swapin > by a little bit but I think that's worth it. > > If we can do THP swapin in the future, this split on swapin can be > saved to make the performance even better. I'm confused by this (clearly my understanding of how this works is incorrect). Perhaps you can help me understand: When you talk about "shadows" I assume you are referring to the swap cache? It was my understanding that swapping out a THP would always leave the large folio in the swap cache, so this is nothing new? And on swap-in, if the target page is in the swap cache, even if part of a large folio, why does it need to be split? I assumed the single page would just be mapped? (and if all the other pages subsequently fault, then you end up with a fully mapped large folio back in the process)? Perhaps I'm misunderstanding what "shadows" are?