Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp22351rdb; Thu, 25 Jan 2024 07:12:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IHa9TuHFqf4pK5P7823xCduyBwLHvE0/qKhG30Fv1fPkZYGxTlE/s1+BB4GX9XYU1CHJKGW X-Received: by 2002:a17:906:710e:b0:a2d:94ff:c9f5 with SMTP id x14-20020a170906710e00b00a2d94ffc9f5mr1208581ejj.68.1706195573901; Thu, 25 Jan 2024 07:12:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706195573; cv=pass; d=google.com; s=arc-20160816; b=irlOPl5TZ+nCaGIeWmZUkDBc7ZJqfi0tHnxCxWZwdsBOkIXvqrj9iD60c+GkL5v/3q mso2WjhtY//WgC78fgdsZNKh+xGgYlSFYzfJkIdwEO/ZlCu91FCc5RAWRCfzkGRmlRBA q/9/A/vO9Pmw9B1ibKixKzJckFUa4HCNuSiXfq9Cg7+T69udJR+Lfl40sldZvoEfNJqi 0dgPMXVS6wZDZte9TLR8kw7AESflAOEjE8WSJXefKWhbQSDZyeUhswEC5vh5cJVgqzLo /8jkd6Om5AVHXmOtoTDgoBDm6unzXwVq8n4U6jpNHFxG3rNHa6i4dYj2JZj7oF7vyGWc OZ6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=mCN1N1vlfyYpuoFeuVzPmMowwKFrbo6J6bJRSI0N2bQ=; fh=q77r3SGtFcw5tD9IkA7hA6mq4WwiMsIO0yD7bT7A5oM=; b=RaPNVMk3OJXIcqmO2OhtvrmypqMuLbxNqxFlVP8XfO3IPpmAvEkVpbBbdNt+6ZqEnj aLq50ygyBHdlE7B8Kul0wFQq0VXzPTsGtNa3AKqbQV88rQUmazaMMZIO7iYg/ROt3qOl fqJ3+9K6O5YmlJZ3GS04T35FdcyjHOewwe2Rc8E2JKi48UbLDVz0XN0W/BRH8dRS7uPa oZOYHmXCMDj6rduYo2kfJ19yuRNJztw45NzaO2JRHYTLK7lRZ7BatYlNeiCPOndiIMXe RlbgvNvASqbn3d2pxfWOMcAtmzxtPTa7dPOW1L9+wT6R+RsWV6VaNGuzVc/9TB3R+lzL HWIw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nSXdWtBR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-38803-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38803-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id lx8-20020a170906af0800b00a3173e1c34asi743494ejb.795.2024.01.25.07.12.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 07:12:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38803-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nSXdWtBR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-38803-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38803-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 9DB661F215C4 for ; Thu, 25 Jan 2024 15:12:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E83B2745C6; Thu, 25 Jan 2024 15:11:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nSXdWtBR" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1FC4C73175 for ; Thu, 25 Jan 2024 15:11:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706195519; cv=none; b=aJg/fH88/Cz3hmnRqk7ygPLaFfX78XyMcOld6VrGJKqF8Xu0qE/aUqiVpr1FX1YelGk8Az5XOMcYqIMSwUzDSLzteHwM0p24IKxp5iYqyt9ex/LDD1rsGBQZziNHuBvQyTq+FrVLK728M5rC57zdiK1PefCUfpyG/cQSqOhF5UE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706195519; c=relaxed/simple; bh=qaC0W89Ij+l6ejUX971u7DsedKgRmIMuV9AHu7Mxo8U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=u6DukLqw02jP4JWaT2gkFSmqArklwz5O8v/Z4woQJWBZRiDsou/+POqZdf/0B4HzOnHr9MdjcyC2fyRGFbbTOH8PHRQJF71GGess7r1bLR4227Ph6o0cgdSHm7gwmq6lyOJcAZsi5Xzr/ENVcfzoo7NQ8THyQ8iXmAh1O6YuCOI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nSXdWtBR; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0FBD0C43390; Thu, 25 Jan 2024 15:11:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706195518; bh=qaC0W89Ij+l6ejUX971u7DsedKgRmIMuV9AHu7Mxo8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nSXdWtBRn7k/oWkIm7gkawOUKqSN1OL4w9QeB24Fl8ZRHsLgAjoCIHhFWXd79Mp/k 3Ywru/xCQb2wY60k7l+yyuii5qOHoNUPxJY9OA4fDUB9tsBI4CKKLva81H4c5Npxko soBi2N+5Uw7UwkYTWpLpjdPKPQ0wBM3LM74JmxAgiScgs4je9bRGpVKtSOL7XfqcrF qK+tHIU3yLfbf+4jshsQqPu95ovDWv9J+0QvFX4IW5ZFrIZ/pWLLCKym8nubIjGZDb ItQ+fc24J9ME0sCIyGDYtuTdbnutgAEV9mcG2Qrx1ywShbrYa9g7szY7BW8Otb0SZs axAz+H2EwRvfA== From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Andrea Parri Subject: [PATCH v3 1/2] riscv: select ARCH_USE_CMPXCHG_LOCKREF Date: Thu, 25 Jan 2024 22:59:06 +0800 Message-ID: <20240125145908.968-2-jszhang@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240125145908.968-1-jszhang@kernel.org> References: <20240125145908.968-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Andrea Parri --- arch/riscv/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index fdd1a595ebd8..248cea3e2749 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.43.0