Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp1530800rwa; Sun, 21 Aug 2022 10:23:08 -0700 (PDT) X-Google-Smtp-Source: AA6agR4wZVHL7qmsco+uQe4lG2lodzhGV1ZLIqK6FEUB85k0/tvUanEcNsISp1awJ2TIudVXCfdI X-Received: by 2002:a05:6402:3509:b0:43e:d80b:44a8 with SMTP id b9-20020a056402350900b0043ed80b44a8mr13537143edd.255.1661102588420; Sun, 21 Aug 2022 10:23:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661102588; cv=none; d=google.com; s=arc-20160816; b=vqojrmgyCPp2niWOcahURG0UlvpZEUwsxppAGGOf8bdOe5Lc/oUYWyCYhYhLaU1scU GvfzhY37DwqUizcOms7EYAphrvBbgMFB32dKSIhsOefEUd/U0J2iz/ayq/5WeAvmZkq6 59chjKy7+1qzrVvKbVzstMOb96XXu64RhXwSDp2HIp8y0nkVI6aselojU37iMg3aW31R qMCJNPAcdHilO7YeKGhLjgBN6YvAhr+p9jrJLTjYlWBSnU3ilQCETgfOWxj8K4ggMxjY /OtkWbseREtgt13cfSSe6CVPYhVDGnxdaXfswBW5i6n5GGyQXpDgYmoHk3zldrP0jqgB oCaA== 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=hFpX6oTYkvG9iPeXBd73bYumGDzZbeLHsvIyeCmKyaM=; b=Y/IrD6aqQg+Q1JKsHseZCq7xwoLns1UjqzvkoPW6e31xEK8aR4dcCYQD2GxZ+r+2tP 4njNXjbGjqqefp50zz53ijUPdVl3/clc4J9XvyR/ydgie0furDLyAlaY1NrG91mhz6I3 CqcnYrxNZcejo+O5tTnurKCKysA+rjDDJNKX19gwUKjZQdg1E2O0jAgq2WPnWcQVsxDA NV5f2mPXuNt6wX+w5IZ+yJmca07bDzX/tEQ5Q+W7qTWBHGMlQSI5j9g4Of1CEkvJdx+B ikaaOCrfxbR9wCuS7PSKUolgwIAf927pOZAhH98nJa8bUpsU3QTdt92uCND8DYC1mvGs E5Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VaMwGGMG; 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 t15-20020a056402524f00b0043e7a3f96b7si8903725edd.546.2022.08.21.10.22.43; Sun, 21 Aug 2022 10:23:08 -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=VaMwGGMG; 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 S229652AbiHURPS (ORCPT + 99 others); Sun, 21 Aug 2022 13:15:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229491AbiHURPP (ORCPT ); Sun, 21 Aug 2022 13:15:15 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D83211C13C for ; Sun, 21 Aug 2022 10:15:14 -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 sin.source.kernel.org (Postfix) with ESMTPS id 3F528CE0B3C for ; Sun, 21 Aug 2022 17:15:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE896C433D6; Sun, 21 Aug 2022 17:15:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661102111; bh=/YxzEa9cM7Ef+kzrSskBrq6YKw82hJWi2Yi0D4j4i8E=; h=From:To:Cc:Subject:Date:From; b=VaMwGGMGmaGF1+8f7BA8T3jnFyN9Y3T2yRQhqcuc7RHxaIBwXZJuLHqot010sNQkd Dtv6hdBbjmTcW1p40l75tFJ5Onvn/KUl2WCeXWEtQgIuXfgY1+uO9g1Xb+iFa0aIF4 I/HZzurP1wDn+2Y4l11GZvnn6nUYTHPCmMYoXpYy4yxULHbKmHdycQWxC52ROn0Oqo wcRYBRqctC135WPfKMfA+SRpB89PpJWR5QzLWW+bvk3zorwCt4ScVtQZDwonmxLKzk fJ3ertrG9karfXrM7PGTxTzhDr8wyo5uTgc/37s2wk7L/ODNoNyqyg5NugrqokcSVW ExAnTnGmale3Q== From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] riscv: enable THP_SWAP for RV64 Date: Mon, 22 Aug 2022 01:05:59 +0800 Message-Id: <20220821170559.840-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 --- arch/riscv/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index ed66c31e4655..19088c750c7f 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 TRANSPARENT_HUGEPAGE select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU select BUILDTIME_TABLE_SORT if MMU select CLONE_BACKWARDS -- 2.34.1