Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1730325rdh; Sat, 25 Nov 2023 00:34:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IF2ErhbT8TBSBxPw0LV77WxqxXV0faqLvqMDGpww3Uvvdy9ytIRV6zDPdQQvthW29B8kcO4 X-Received: by 2002:a05:6a00:2d07:b0:6be:2991:d878 with SMTP id fa7-20020a056a002d0700b006be2991d878mr6715303pfb.15.1700901282546; Sat, 25 Nov 2023 00:34:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700901282; cv=none; d=google.com; s=arc-20160816; b=DWS17drccwhhAIIJq/pyYaJPx39koFfCozne0vnSyR0x0PfbeRvtjSV6JouCKZIicl sznUZj5o2eG8HKf+CkkQULTd2rYUD06kEXqLlOsUZ0a6kKZgfHVBrBUpYeVX7CGv/teW /z20jlXL83V/moG636R4K7KuRVW9DFwXR2ZTiAxqFQdD7I0hVm1V47+RfJF5fI01mlZw qqvWVKsP80U9k6JMwIiEaPxTvCvcOoBlzWzl6ZDp38Yo0VQwtX6ERUYlTz9RSX/OebuQ y3P0/csVFKiHGQGOsftN0ROoQhn6yn106AWlVe06JfLtq+ThPPwxC8Fv2fiIPVV9uyWJ LV6w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8xOH8CZs+MHvtOlIEJ1Rh77Uh9U9MMtSDv8JEUlcj2c=; fh=srb/EijQIrMEdOeqn3qQX6qrsAGyqHAqeSFkl/qDdLM=; b=Rp3aV4DfMr6obg8nrpJ+OuegKYZ5v82n7i1UbapFJjB769DjuZcBpqaAnm1vE6i+FL JRBnZSO92G/PtzQlzzeG2sK5IWzq9wrCViaAJQb4dilio6oX2A+dHrtEv6Pu+njZhXbK rnAA2EGC7ywWqXAspENwTDt3G1xTpTxZyWQ7bHdYsFslwbhPKOec6eiyWtk6ThUFDaH5 MWKx2JAgpYL+CIOOmmwsq6YPJlFRW9kQWXPgUe3HSPxiIxfwGeFTxpAaxFAtj30v1i3n ud/5x9jrkWuXqdH/78tqk1u1JAGEK7rNpa+HzAMHLob3dDYxR1j53mzO69/2zi2TZYEN IOyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="uHQ/QCse"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id x15-20020a056a00188f00b006c3463c7299si5317034pfh.197.2023.11.25.00.34.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 00:34:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="uHQ/QCse"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id BD73E8053636; Sat, 25 Nov 2023 00:34:38 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231733AbjKYIeR (ORCPT + 99 others); Sat, 25 Nov 2023 03:34:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231799AbjKYIeD (ORCPT ); Sat, 25 Nov 2023 03:34:03 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76F2AE6 for ; Sat, 25 Nov 2023 00:34:09 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6381C433C7; Sat, 25 Nov 2023 08:34:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700901249; bh=sULvz/WSntLYIuz8arrxbKY+JbBMr2OcovMfkGjh65Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uHQ/QCsenj6f9OJf8bInnyQuHu8Hf0uFEnDtugC8O9iL8r0q4Brx28gsrovvT3FAs LhawTxe3j5d8scxzMzbQiGyJZfkVMXpK82I/5XqTPoZ6u3pTdxsvLqRvezbWhDAW2o LVd+SooqmlELp+W3QibQsEqlJfY86m5+zw9VlZNPYDsZ7csQTMorfHtMvpIS+Dq9pe M0dRry6v0rhKpgRVei8IUl7Pcs3dA36MV468JtfYNLs4CN6PPE5CqUCLhI5Hd3bIFv Fbys8DjygX7Hus6H+yoTHr45M9gj5Hyu00GZb7Ow0LkMXz3xwA/WIKfQI2CgQwPJWh TNym1R38OWYZQ== From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] riscv: select ARCH_USE_CMPXCHG_LOCKREF Date: Sat, 25 Nov 2023 16:21:43 +0800 Message-Id: <20231125082144.311-2-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20231125082144.311-1-jszhang@kernel.org> References: <20231125082144.311-1-jszhang@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sat, 25 Nov 2023 00:34:39 -0800 (PST) Select ARCH_USE_CMPXCHG_LOCKREF to enable the cmpxchg-based lockless lockref implementation for riscv. Using Linus' test case[1] on TH1520 platform, I see a 11.2% improvement. On JH7110 platform, I see 12.0% improvement. Link: http://marc.info/?l=linux-fsdevel&m=137782380714721&w=4 [1] 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 433ec617703e..7f8aa25457ba 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -51,6 +51,7 @@ config RISCV select ARCH_SUPPORTS_PAGE_TABLE_CHECK if MMU select ARCH_SUPPORTS_PER_VMA_LOCK if MMU select ARCH_SUPPORTS_SHADOW_CALL_STACK if HAVE_SHADOW_CALL_STACK + select ARCH_USE_CMPXCHG_LOCKREF select ARCH_USE_MEMTEST select ARCH_USE_QUEUED_RWLOCKS select ARCH_USES_CFI_TRAPS if CFI_CLANG -- 2.42.0