Received: by 2002:a05:7412:8d11:b0:fa:4934:9f with SMTP id bj17csp606103rdb; Mon, 15 Jan 2024 07:40:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IGaforw3VMbdGquKscMOkA8i+a5RyhfXwAu3hpCCKFs0Ah3mDYQzh3Sfle0cOgTDxHbVkKF X-Received: by 2002:a05:6122:d8d:b0:4b7:295d:a048 with SMTP id bc13-20020a0561220d8d00b004b7295da048mr2928761vkb.29.1705333210792; Mon, 15 Jan 2024 07:40:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705333210; cv=none; d=google.com; s=arc-20160816; b=SipHs2pwn92PhlTjoTQE/C7h8+hk1eZTXY6OsH3KtIfdHN/Qs3JQ/841Xjq/Etu6Ip 2cZOR7rVw4HI2RCy8EqehO0Eh3fe1m22NQYa+GaubBkxUmBTzy3wPZ9wCRadnT2HxDXE Zvwe6GoDNd3cS+iJDm6bpKhaVocG4MIZe+NqyVwAOWyipj/7218++eMo/WdftjYGCRWM 2vgRCNWrBEsieffduNMi6xFefDnbwme5uW/GoPAYhxqqpIh75ahyyntcI/g0UpIRhBM3 yK8f9RjKpyCbs8KQzuFcP5TFEO4l2zuiAbyLQ2rA3TlB3rtr9tsZWxJLbRACUXBv6i+4 1ElQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=TZWeeMkSKDbBY1qxO0WKMfgjkDxXFPye7HRiYjT/Kk8=; fh=H4lu9Z6XU6Z2fZ72kUDEHt69ja1SxY3m2UtCxpu5seg=; b=D+MGGaWu3WnZKbmf7HEW00Uu/lB9r52DsIDX4LSQEs8EHPyQSm4Rpndt37MLGvOeZN oi/b//fR9zXq/7fJzOSRveB0jXpeazvsVq9PylKttkaiNgzqpgWAvErREvMmcIkpVztc cqXW0FNLSVeHgVmns4pn7OKUs/AmckxWxZ6MMSCF3m7Vybu39DQbHFkcPep5EUXSqe+p bgAT3sRrm4VSmgQH5ZLSR1zgyUjqyRmyruiLBFPA4lyhVPXXnQAStg8DS/OlEK7clJD6 RYWkTG6LRtimkjbqO/6Uz3MKVCWpU+V0ZD6/fh0goXfLd1bDS7+5ImkAqdRIfHs0GR3r h4Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OL38mFp7; spf=pass (google.com: domain of linux-kernel+bounces-26184-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26184-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id z17-20020a0cf251000000b00680b1a796c1si8030123qvl.312.2024.01.15.07.40.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 07:40:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26184-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OL38mFp7; spf=pass (google.com: domain of linux-kernel+bounces-26184-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26184-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 89E191C21CE8 for ; Mon, 15 Jan 2024 15:40:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 15F271798C; Mon, 15 Jan 2024 15:40:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OL38mFp7" Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB33C17980 for ; Mon, 15 Jan 2024 15:40:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-55790581457so10074355a12.3 for ; Mon, 15 Jan 2024 07:40:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705333200; x=1705938000; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=TZWeeMkSKDbBY1qxO0WKMfgjkDxXFPye7HRiYjT/Kk8=; b=OL38mFp7O0G+Ur8obMZt3NYurfukjZMqxcF2zW6wVfaTEP/OaYa4xS3N14CwYA+3Lm CScP4mUm7YgHY0KQe5f2QEmiy6zI4CXtxX9llJ7hCPzHuYBj7t3sVjiTg1OObbikV4Id 0fNC7IZ8dSQF83SeNnf/phhlLFBQkK8nX/6zmCaLLbb1yCphzcYV3Aj4HIQlkjaZsHOM ibnZpZ57D2HYR0hS/TrSp/fkkposw4IDkTzUmv3lYgWH4nADk2u8w7CCbWFTBhOPI0mM MpFZX3WVO4qZCQHSZzxdp5qjdfsoUMYXFrBU0ZDNuS9VoDbnxQR1i9McbXseMdQC5F2M vCUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705333200; x=1705938000; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=TZWeeMkSKDbBY1qxO0WKMfgjkDxXFPye7HRiYjT/Kk8=; b=JDI8Dxf1Bz7pYRtVUYAM5pyMdj1eT+sC2++KHjqQTRsSWggGewGKBbmKmbBizF007q w98y35YQbMZ5rCTFgQDUlYjC7OTLwqywq/8bCJ0Q8qgTstg2VJy0kwTWSsMXpUDixq/+ ovafD5XF3/dTPVPj+O3+SWDYQaIUlM82OX9mQVtXRPHM7xFftDzP6WFMbSU5fB/4bwkt UXwEHzkug4LviqhY6GbUjmFX2SE0riQfW9MWSqgbpuk/J2Iqq/Si3JffAaSlD9Qr7PV9 sFYqH8S9fSw7P4d4X/TR7jy1+qbwGpp45LlLtd88b6TALGzIZ5q6WTBygBKinfhXDt7c /bEg== X-Gm-Message-State: AOJu0YwoOHPS+Y6E+C75rq8dRN0dyxhdsy0RgHC2AZCxtb5Dt1ErWigP ulIYu2KMShbB8twwjFl5hAA= X-Received: by 2002:a17:906:c2c1:b0:a28:abfa:dac3 with SMTP id ch1-20020a170906c2c100b00a28abfadac3mr2638964ejb.153.1705333199694; Mon, 15 Jan 2024 07:39:59 -0800 (PST) Received: from andrea ([31.189.8.91]) by smtp.gmail.com with ESMTPSA id vs5-20020a170907a58500b00a2cbbebedc1sm4308824ejc.53.2024.01.15.07.39.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 07:39:59 -0800 (PST) Date: Mon, 15 Jan 2024 16:39:55 +0100 From: Andrea Parri To: Jisheng Zhang Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/2] riscv: enable lockless lockref implementation Message-ID: References: <20231202140323.315-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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231202140323.315-1-jszhang@kernel.org> On Sat, Dec 02, 2023 at 10:03:21PM +0800, Jisheng Zhang wrote: > This series selects ARCH_USE_CMPXCHG_LOCKREF to enable the > cmpxchg-based lockless lockref implementation for riscv. Then, > implement arch_cmpxchg64_{relaxed|acquire|release}. > > After patch1: > Using Linus' test case[1] on TH1520 platform, I see a 11.2% improvement. > On JH7110 platform, I see 12.0% improvement. > > After patch2: > on both TH1520 and JH7110 platforms, I didn't see obvious > performance improvement with Linus' test case [1]. IMHO, this may > be related with the fence and lr.d/sc.d hw implementations. In theory, > lr/sc without fence could give performance improvement over lr/sc plus > fence, so add the code here to leave performance improvement room on > newer HW platforms. > > Link: http://marc.info/?l=linux-fsdevel&m=137782380714721&w=4 [1] > > Since v1: > - only select ARCH_USE_CMPXCHG_LOCKREF if 64BIT > > Jisheng Zhang (2): > riscv: select ARCH_USE_CMPXCHG_LOCKREF > riscv: cmpxchg: implement arch_cmpxchg64_{relaxed|acquire|release} For the series, Reviewed-by: Andrea Parri # code audit, QEMU tests Andrea