Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1701041rdb; Sat, 2 Dec 2023 06:16:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IHH4Q2V8yMyQ7S9BO5Th1aNZphnEUkfzt1UB8Qx5BgrcraUhwwce7t8KusEcjSihzeXKPAv X-Received: by 2002:a17:902:6ac5:b0:1d0:6ffd:f230 with SMTP id i5-20020a1709026ac500b001d06ffdf230mr290234plt.134.1701526564201; Sat, 02 Dec 2023 06:16:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701526564; cv=none; d=google.com; s=arc-20160816; b=QffExuxlfr3tUn01l5tIiZNcEE1iMQDlfp5BO4jG3/xVYElNa45I9VgZWRtG/EW94t 9nl/nYKtzigL3gamEy1xKuukB8xHn+NjMsmGAN7sTwAbFyXz3Mdfi4pnFa+r0Rlgt7n+ fZvZXElMOdZn8wWr0FJohHhtAPG5kOkWMEm1S3Mnc1uPAreVc6oQsBa6sY6+I1I81Dtu 1urMJdtXq43Wtii4+09ShSP6aAAsTYexR1FFlUy8OzBNknhdXt93BmDL7c/Tcr6+3IT1 g35Uj4tbxQlwCsESnoObbaDcTbikSPZ24XeIUGgBgFUHSfVRk1+9UYPNLPXXXSUy1wtQ b2fA== 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=uOokWDl+oyaUKWX5QKHg5XCfz8ADRQZshUfy4hkE0cY=; fh=srb/EijQIrMEdOeqn3qQX6qrsAGyqHAqeSFkl/qDdLM=; b=vBkCBFvt0BT8mlE75vQCRr/228F1Zmb1ejqhHAmpY233fZ7/k1YeWTOlxI0KOuCRQU hq2hKIY568T/4SwB0NgUVz40tHTU0hr/oVG9fpQL0j2VLUx8LlDByANzYlMzC8jUdYn4 OyLz2iqqUQhrERPuFp8L6FuyfAUxxE7hhlIy2zpASzlf4iaUkVaDmWoEoqBMAyUovdlg M6SfD5spigdlSAc6lUKMGdBL0Pn7Wp+uPf1k9X9CwxUNlZi1WcmcOYGvKa1HtHkjGXoG ynheAD2Dc8Wgffa/X1pOAbTA7SUthJDp9L7w5WinOHlbqpYDVjOa6PckCMawyL8rK526 XtVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="oQ72I/i6"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id x24-20020a170902b41800b001cc53dbf53dsi4769345plr.648.2023.12.02.06.16.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Dec 2023 06:16:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="oQ72I/i6"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 93C228092220; Sat, 2 Dec 2023 06:16:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232994AbjLBOPr (ORCPT + 99 others); Sat, 2 Dec 2023 09:15:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232975AbjLBOPo (ORCPT ); Sat, 2 Dec 2023 09:15:44 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8563A12E for ; Sat, 2 Dec 2023 06:15:51 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E82F8C433C8; Sat, 2 Dec 2023 14:15:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701526551; bh=fwdhwt3eDeqZRwcBFACwkkWnjPtptuE2Wu5b5bty77c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oQ72I/i6LN9WRbDkrkT9M9kOLmigG1FyWGGpxqvKDzK8Ed7mBok7Xna5Rno92B6gj /XX0nb16HB6UkRBDog/J/WWTPO/5HtSFde3mvKL+Yo4z4M7PJyanFKMRJ0ecX0vpwu kW0h6cCwkSUUIOzNSolHE+92AyLd7syaH+iL98NweXOkA4xA5WEnnmMAVNqHUvYlDN fYOdl/nIa/HYzblmbtfeba1gDN0VzQEY7gta52VNWuc+y4S4MLdaGLanZV9Ne5H8uM yxx/DRCMIs+4u1zB+ol2wV6E7lqNnlKjcWNXa+lYHWlMxDrNxj8nY5kExp7zxqauhT 62de3GKfgbhDQ== From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] riscv: select ARCH_USE_CMPXCHG_LOCKREF Date: Sat, 2 Dec 2023 22:03:22 +0800 Message-Id: <20231202140323.315-2-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20231202140323.315-1-jszhang@kernel.org> References: <20231202140323.315-1-jszhang@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sat, 02 Dec 2023 06:16:02 -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..da4ae76a892c 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 if 64BIT select ARCH_USE_MEMTEST select ARCH_USE_QUEUED_RWLOCKS select ARCH_USES_CFI_TRAPS if CFI_CLANG -- 2.42.0