From patchwork Tue May 24 07:14:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Barry Song <21cnbao@gmail.com> X-Patchwork-Id: 12859740 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 45670C433EF for ; Tue, 24 May 2022 07:14:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9FA726B0072; Tue, 24 May 2022 03:14:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9AD5A6B0073; Tue, 24 May 2022 03:14:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 872C66B0074; Tue, 24 May 2022 03:14:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 7401B6B0072 for ; Tue, 24 May 2022 03:14:33 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 42D1A61549 for ; Tue, 24 May 2022 07:14:33 +0000 (UTC) X-FDA: 79499773626.27.3C5DD83 Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by imf02.hostedemail.com (Postfix) with ESMTP id 500EB80035 for ; Tue, 24 May 2022 07:14:30 +0000 (UTC) Received: by mail-pg1-f176.google.com with SMTP id f4so333258pgf.4 for ; Tue, 24 May 2022 00:14:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=gRlOyFznhqcllB5R0D5wOECWdS1nzdOx8oGhDl9tP3I=; b=e10b0unVP47GYKpHeoWY60Db5sK3pGatfUwGHps+Me004JE+XQ5wgt4pHfqTY0Q4zU yguGhsmf1gqh1n29RHqLOW8rRvYlrZmToK/pRVG8c79mNZ/jo9PhBzypdgoow+L0WfrL I9NTBGOzqEvkU59WTaIvPczHJVJZe6J25I0R7+cKxXKAUZDAcP/SD+1228HF4MoK4+l9 VDYuvLO3JuCtTqzWMSJMQip6LjGAWRgi1cacdJOUNZC0SCwwzh2fjp0gK+Icu3Y6z7fn udWDWZtQSVM2fOE7n2MyfM9pS/ytyGjJhC74EKgLtHpH5TuSO4dY0hJVRRnwpTb4sqjZ hteA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=gRlOyFznhqcllB5R0D5wOECWdS1nzdOx8oGhDl9tP3I=; b=dZpM9q67Ba7pXZJFr5O+z3MXfhlmf2xgEV2N5A+YrtCeKeRcgL1QJb46eqMAPO0MbI daDkg2sPsTgAgVfGKOBqXxjcnWpJ8b5lGeaqCzEWkzQqBMJ7tM/A3/2Xk+E2hAG4fQcM CzwejdIRi/fx9UOrEJNJVN8quolmtrcdxHRtVcNI9ZAv46mbKqOo3Jx74TaeCD2mvycP +CEGQ60Uzsd3JhWMFApjDWVtEOMekRj/Lq6pyNy0tujjHd7cAuJfqpUuh93HqjMcyZGG XXhX1bjemnc1znG6EdIfUOey0v4+qGHeFxPV+RdOgOjmyRMZBr4m97Sm21zl+LxmfoHH kOOw== X-Gm-Message-State: AOAM530r+JayxJAFDvFXmYK7jhzgcNQuPYK2mHpmK8LncZGMBPL4X81G kkwE9TrWCzhot1S8RUoh5R0= X-Google-Smtp-Source: ABdhPJytRlr+IksNgpeuSKGSxDWVOSNwYOw84XYIQw8jPCJ2dU57bjALquJylUj+j/5CJllp5ajmYQ== X-Received: by 2002:a63:1953:0:b0:3c6:e5e:9190 with SMTP id 19-20020a631953000000b003c60e5e9190mr23049687pgz.286.1653376470773; Tue, 24 May 2022 00:14:30 -0700 (PDT) Received: from localhost.localdomain (47-72-206-164.dsl.dyn.ihug.co.nz. [47.72.206.164]) by smtp.gmail.com with ESMTPSA id f7-20020a170902ce8700b001621c48d6c2sm4409018plg.221.2022.05.24.00.14.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 May 2022 00:14:30 -0700 (PDT) From: Barry Song <21cnbao@gmail.com> To: akpm@linux-foundation.org, catalin.marinas@arm.com, will@kernel.org, linux-mm@kvack.org Cc: 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 Subject: [PATCH] arm64: enable THP_SWAP for arm64 Date: Tue, 24 May 2022 19:14:03 +1200 Message-Id: <20220524071403.128644-1-21cnbao@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 500EB80035 X-Stat-Signature: k84hw68awegwzdrwj9csytk84tkgkwb7 X-Rspam-User: Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=e10b0unV; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf02.hostedemail.com: domain of 21cnbao@gmail.com designates 209.85.215.176 as permitted sender) smtp.mailfrom=21cnbao@gmail.com X-HE-Tag: 1653376470-448669 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: 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 select ARCH_HAS_UBSAN_SANITIZE_ALL select ARM_AMBA select ARM_ARCH_TIMER