Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp52095pxb; Tue, 12 Apr 2022 16:33:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0TC23Ui+FtqME7qPIjQj9fOwEYRindwZUZp7By2j1pbQ3bIhWeqUtimLxAUeQwmaZ4KAg X-Received: by 2002:a17:902:a40f:b0:14b:61:b19e with SMTP id p15-20020a170902a40f00b0014b0061b19emr39936699plq.20.1649806380900; Tue, 12 Apr 2022 16:33:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649806380; cv=none; d=google.com; s=arc-20160816; b=Pg0Kx2onbPvQvjFsuinwr+50UwhbtMLyy/jqMp6jl3oktykeNjpw4afQ+zCrCPTu5x LCpOhjNHFq7yp/uYJqEWCpLkRrNeShvCJS1jrT4NHdSLa6oeN709cmjLgkDYUbKthLHL kIu/BcGbD+sjrk8NKCMd4Ms7XJZpTlUD9ZFTroUgsa7J1H7H9WhLAL+Y0rLfgcGjVMZM xS+73embFCKbRuAwpZeaYqhxTIPbx+SYXwcKF+JAVdXGHa81wYv+47H0a5jk4Jar/sEk 8+qyzBXqHGoQa4DFZZR0NV3OPnUVTBn6WwKTaEnbXOA6p9Cz/Z6+hVRRSFHYZnamzBUt g4tQ== 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=o5K49f30ubUEO6QwKyX3YUmOgECH15//kHcEfCKWUEM=; b=VSP2PVlYcbu9peatFmFD9Qoh1+LD24KiJB1gTuUA56WfMqTOKhnZ4eRLNi8uME5/7h GQ1KKt1QoeTvkt/HmFQtbkGSBW/SGvh3XkB5wXSfjcm3B9E0hH9pvjDc0mD/frbAqXrG n1lkH1N0u01jyjMO/IfGz44Gu+GAkdMMkarrWSOEzbNpwOPk6pHy4WPuzfxmT5WjSl5W RBhXLf8zlfZKCZm7QHJLJIQsqIlWmcWA4tLpLlojYv4E0UdVzPkIyzJbHvWuApB/7NTz UTeB6A6N7JX3Mc5INhXrkSOR+9QgFSDodC3fRu5fou3VU/HwPCR/zRlbw5NtBHVHeO7m Mfyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dRKJ8Ovt; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id x1-20020a056a00188100b00505929703d3si15543165pfh.56.2022.04.12.16.33.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 16:33:00 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dRKJ8Ovt; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 030711AFE8B; Tue, 12 Apr 2022 14:24:16 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344903AbiDLDwf (ORCPT + 99 others); Mon, 11 Apr 2022 23:52:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345029AbiDLDwc (ORCPT ); Mon, 11 Apr 2022 23:52:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFCD215A3E; Mon, 11 Apr 2022 20:50:16 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 4CA3061735; Tue, 12 Apr 2022 03:50:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6B31C385A6; Tue, 12 Apr 2022 03:50:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649735415; bh=P9+O1kpUptYnKFD23NWAw1Xn9Hh0s8Rg+gBWuVO+Hew=; h=From:To:Cc:Subject:Date:From; b=dRKJ8Ovtpx0hFHCkElq0iMIL9BZ98ES/fbm4BQOSUJP+Ag9nH9qE1JChNSS9cQkRw IC2Fz5AXrSN6R5Kzlq7fB9yKqZwdMRGfxNZS/FzW87ig19Doc/z3rQLrcJl4r2QGqc RySZEYOZq/8CagzXX3CdP/nxKjp9BhJYNKE8MMm/Tz07ebnvNGG2EHgM7j4fY3M9yd YDH7fwe1r9r+ml4VoryrMUHa/ITMSWAGs0z/ZbdN1XYS+BvKXIX2XSI0jYCK4m3MsN I41hxKxwaPFhS5EH5dq7D6C1Hch0SJ4ZO6WEwsNAfQsDmlcY5RhNYMwC586Db4jXlc jOwjOyHOaMV6w== From: guoren@kernel.org To: guoren@kernel.org, arnd@arndb.de, palmer@dabbelt.com, mark.rutland@arm.com, will@kernel.org, peterz@infradead.org, boqun.feng@gmail.com Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Guo Ren Subject: [PATCH V2 0/3] riscv: atomic: Optimize AMO instructions usage Date: Tue, 12 Apr 2022 11:49:54 +0800 Message-Id: <20220412034957.1481088-1-guoren@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guo Ren These patch series contain one cleanup and some optimizations for atomic operations. Changes in V2: - Fixup LR/SC memory barrier semantic problems which pointed by Rutland - Combine patches into one patchset series - Separate AMO optimization & LRSC optimization for convenience patch review Guo Ren (3): riscv: atomic: Cleanup unnecessary definition riscv: atomic: Optimize acquire and release for AMO operations riscv: atomic: Optimize memory barrier semantics of LRSC-pairs arch/riscv/include/asm/atomic.h | 70 ++++++++++++++++++++++++++++++-- arch/riscv/include/asm/cmpxchg.h | 42 +++++-------------- 2 files changed, 76 insertions(+), 36 deletions(-) -- 2.25.1