Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3213406ioo; Tue, 24 May 2022 16:24:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxB1ZbYqr+QmwxtiuVc6OSgyqWHELXso3qOVRj9g4JV1XLwgoQGMuoNunIYiswPoTdYasv+ X-Received: by 2002:a17:906:4fd4:b0:6fe:d42b:feaf with SMTP id i20-20020a1709064fd400b006fed42bfeafmr12109047ejw.693.1653434646030; Tue, 24 May 2022 16:24:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653434646; cv=none; d=google.com; s=arc-20160816; b=JGNosmDFmctnDf/GlqD6Ks7hBMORJHQmMeHV2+SSsErLpTI/bxUIvlBcXM03Aqb1T/ 9aqbLA4ELVNm/xnv9fK3PqEFbCsv8H9AlQxKQL4eHgaZJttr3OBC0H5S2PD92Jf9eQx9 +gI0GdqDNc+tkuxAAdS0iTeLVnBLRAKCTDn6nqqD7h/9I6JaBDfzhBM9PqPX90RA/Z4R HVKG63jE9atM6IX5HJoWwbR3CXxrzs1AAHzimjpH3VhFjf0EFWoNCZ/+c51Zn2HaynyO WdrIvnQWr3ZyF+IA0PxOsiwv/0wOf+slGMVLn1y40MwHfNa1tJxcksCz54/+YmyHrgl5 99Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=zD7Smwb3nbpoiExoAlCo8WYAg1B9HnucW0L3dIneTdk=; b=z2OTlLPyH88vY9H4S52xfmKiDbICIGl/DXpi2iwpVXyDtLQZOZZr1H8UEnNkzCiqqN ezVeneaL7mG1MXhuDqTdEzOVHpZ6CDdrr08vpjoaWoE65tbn0xKoRtUo2Rl6nD4+AY/R aVUeDjc7UOcdJgkQYA/JZy+JvGw6a0thwVdfYOVumFyxSpr7hX58hwwEiKtGFTMV8ZZ4 8J53mDf+fi7fQStrVjwLPq97PaOnh/QyWkZZNamhAmB1Is9FblaxYZvvPQLpl2r0C7Xm /MKjzTi7JNmaQlidzxficCInFZygHan2hQXA6wlDEpmSWGpcciQ74fwteb0rAUzJhB0l Aa1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dp12-20020a170906c14c00b006fee26c864csi7321656ejc.246.2022.05.24.16.23.40; Tue, 24 May 2022 16:24:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231741AbiEXIMZ (ORCPT + 99 others); Tue, 24 May 2022 04:12:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231636AbiEXIMV (ORCPT ); Tue, 24 May 2022 04:12:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0830660BBB for ; Tue, 24 May 2022 01:12:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id ED0CE6153B for ; Tue, 24 May 2022 08:12:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6214CC385AA; Tue, 24 May 2022 08:12:13 +0000 (UTC) Date: Tue, 24 May 2022 09:12:09 +0100 From: Catalin Marinas To: Barry Song <21cnbao@gmail.com> Cc: akpm@linux-foundation.org, will@kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, hanchuanhua@oppo.com, zhangshiming@oppo.com, guojian@oppo.com, Barry Song , "Huang, Ying" , Minchan Kim , Johannes Weiner , Hugh Dickins , Shaohua Li , Rik van Riel , Andrea Arcangeli , Steven Price Subject: Re: [PATCH] arm64: enable THP_SWAP for arm64 Message-ID: References: <20220524071403.128644-1-21cnbao@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220524071403.128644-1-21cnbao@gmail.com> X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 24, 2022 at 07:14:03PM +1200, Barry Song wrote: > From: Barry Song > > THP_SWAP has been proved to improve the swap throughput significantly > on x86_64 according to commit bd4c82c22c367e ("mm, THP, swap: delay > splitting THP after swapped out"). > As long as arm64 uses 4K page size, it is quite similar with x86_64 > by having 2MB PMD THP. So we are going to get similar improvement. > For other page sizes such as 16KB and 64KB, PMD might be too large. > Negative side effects such as IO latency might be a problem. Thus, > we can only safely enable the counterpart of X86_64. > > Cc: "Huang, Ying" > Cc: Minchan Kim > Cc: Johannes Weiner > Cc: Hugh Dickins > Cc: Shaohua Li > Cc: Rik van Riel > Cc: Andrea Arcangeli > Signed-off-by: Barry Song > --- > arch/arm64/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > index d550f5acfaf3..8e3771c56fbf 100644 > --- a/arch/arm64/Kconfig > +++ b/arch/arm64/Kconfig > @@ -98,6 +98,7 @@ config ARM64 > select ARCH_WANT_HUGE_PMD_SHARE if ARM64_4K_PAGES || (ARM64_16K_PAGES && !ARM64_VA_BITS_36) > select ARCH_WANT_LD_ORPHAN_WARN > select ARCH_WANTS_NO_INSTR > + select ARCH_WANTS_THP_SWAP if ARM64_4K_PAGES I'm not opposed to this but I think it would break pages mapped with PROT_MTE. We have an assumption in mte_sync_tags() that compound pages are not swapped out (or in). With MTE, we store the tags in a slab object (128-bytes per swapped page) and restore them when pages are swapped in. At some point we may teach the core swap code about such metadata but in the meantime that was the easiest way. -- Catalin