Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1205483rwe; Sat, 27 Aug 2022 03:09:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR4oJQFPtwLxtYHFNbe0pWOeaT88tZfdYbXfnEVQjOybQ+HCSvjs3jXex/Y0Rumril4iXLg2 X-Received: by 2002:a17:906:9b83:b0:730:b3ae:343 with SMTP id dd3-20020a1709069b8300b00730b3ae0343mr7934192ejc.670.1661594983855; Sat, 27 Aug 2022 03:09:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661594983; cv=none; d=google.com; s=arc-20160816; b=TCWRuUdCioKP3qCpuPHdWwvUE3tjwxMyrtnaswGUqTqzMdMCBa39pCt/LnNvpBtIS9 jc+TAWh+QukOF7c7c9JT78gXR7C/yizw04swwkS2WrdCbguldwvspOg383tBa0ekbv5H 5yp4c2jIJxzVuQVgzQHKKUK8JQy4LTnjAiX/BXmppRK04d0MLQ0HnrRiFh9Df2/3gYcd UTsQ/qk+9J77YKtMWL7zbPn9KUEcGbNw/vPz3Zn0UPpB+76BS5V9N8y9ptB9WZamVGtN bbTkSqV5+SMVgp19IuAHCfhrZP/QAEmBBKOn4FIj6Oy5BtGqKoyoZOsXHxAGP0VhAcag g3fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=aLRH878j8Zmyt+Ev5+0R52Q938fVBjyv5Sf916lIxhg=; b=IOsHnrMvMmZx9tto0OQuE4CCTEsTyiNcL/bLotzm9Z+rzAtCxOgFCA7HgOGdO1BxiT pzM5moWSMW0HIZpx2CrJFYg2xwoCmzB3XKnJfqys/gXik6Ej440++Dx6AHc0IHte1Cio UrV5Da2e+pd9b5H4zcqJ/WXasgjHQQa6B+VVuAChNPVzjU8mx64vFEk91Et0XmLr3VE5 uJliFyPRJQGBSpKEJZJNkYc61Je2s+ysKTJyiN2ytH9q4mupeeJjjMSZlx8wBJp3F6zr PzmsoTvKVhuP2E6kUR1hJ4Oz5TP0iq9bRPFY9rO7E2cU19SokcJwWXJMjvmI7DGFoJUJ c93A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QOI9LDoN; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xb11-20020a170907070b00b0074084f48b41si2605907ejb.998.2022.08.27.03.09.17; Sat, 27 Aug 2022 03:09:43 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QOI9LDoN; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231805AbiH0KHd (ORCPT + 99 others); Sat, 27 Aug 2022 06:07:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230176AbiH0KHa (ORCPT ); Sat, 27 Aug 2022 06:07:30 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BC8B4331C for ; Sat, 27 Aug 2022 03:07:30 -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 ams.source.kernel.org (Postfix) with ESMTPS id A6250B81D45 for ; Sat, 27 Aug 2022 10:07:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 289F9C433C1; Sat, 27 Aug 2022 10:07:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661594847; bh=x4/mGVMacC5xRI5YrwqxL+YnyXrMhkteEEVlNDKVYpY=; h=From:To:Cc:Subject:Date:From; b=QOI9LDoNkrsYJpyEwmZKcrb7VofNKKRStmjAR1DER05HCs3v6ckfZNzg3q318UFuE SKQBRURtBtyz4fCp/hOaAv+hyYUWNobgl0V2gMIzP6sfZXMavzq577wFVN469A1kSf vyGS2T9vMoh5ackyGaxk5etTvY4H+X7nwSpX0n2wEnttG1TepJFiP8zoGW92Kltmx8 z7SUEQlGAVBuZQKioaIe17P7HNyJhlSCw3IxE95IDw/7/V+K74b/TGBPBC277LuW8j fVAC6ODypiiZ3bQPKiCiWqNCGxeLRqtAWjKlDQUBkmDOgXIFawQv0AgkNCy0ZckHPX fXak6rJbJvrqA== From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Andrew Jones Subject: [PATCH v2] riscv: enable THP_SWAP for RV64 Date: Sat, 27 Aug 2022 17:58:15 +0800 Message-Id: <20220827095815.698-1-jszhang@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 I have a Sipeed Lichee RV dock board which only has 512MB DDR, so memory optimizations such as swap on zram are helpful. As is seen in commit d0637c505f8a ("arm64: enable THP_SWAP for arm64") and commit bd4c82c22c367e ("mm, THP, swap: delay splitting THP after swapped out"), THP_SWAP can improve the swap throughput significantly. Enable THP_SWAP for RV64, testing the micro-benchmark which is introduced by commit d0637c505f8a ("arm64: enable THP_SWAP for arm64") shows below numbers on the Lichee RV dock board: thp swp throughput w/o patch: 66908 bytes/ms (mean of 10 tests) thp swp throughput w/ patch: 322638 bytes/ms (mean of 10 tests) Improved by 382%! Signed-off-by: Jisheng Zhang Reviewed-by: Andrew Jones --- Since v1: - collect reviewed-by tag - make ARCH_WANTS_THP_SWAP rely on HAVE_ARCH_TRANSPARENT_HUGEPAGE instead arch/riscv/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index ed66c31e4655..79e52441e18b 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -45,6 +45,7 @@ config RISCV select ARCH_WANT_FRAME_POINTERS select ARCH_WANT_GENERAL_HUGETLB select ARCH_WANT_HUGE_PMD_SHARE if 64BIT + select ARCH_WANTS_THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU select BUILDTIME_TABLE_SORT if MMU select CLONE_BACKWARDS -- 2.34.1