Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp257303rwo; Tue, 1 Aug 2023 16:43:23 -0700 (PDT) X-Google-Smtp-Source: APBJJlGZl54JZNCtkLH+W6k5N/cr3Dbzu5ui2sGGuLfo01Qy1xZTqPvIKcNjW9N1+zj5Ih+XAdP3 X-Received: by 2002:a17:906:29a:b0:992:91ce:4508 with SMTP id 26-20020a170906029a00b0099291ce4508mr3810941ejf.53.1690933403429; Tue, 01 Aug 2023 16:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690933403; cv=none; d=google.com; s=arc-20160816; b=cfdyNHEMckO/Y7SEnOI3IOBr9zMoXTdGA7aiR9RX2Y5f5pAS5cYVM/ts5hlnq0WSvU qdFbF/++jcp3CtEXCE/1mpfUNCsEnlNY4wmt08r+FWapVirYpLxZq7h2u++GBe46BUj1 CiF6H2n+dy5efTz5lqMoSbw4jbd+HNJ0OGeXtorMRC0OarpZfbysI5F7mv9a0NPeZ6UH rUbpVW1Dp85kU+QkbASD42BHFAMDqlU/cAOIqK8c34qdyTATa1b+At1AkNwGfaFYIl0t gWWekYvItGchEkn4SCp45wiSpyfqdcCKkCHfUB+mZSGOqVZpwT2MBu0Z6MrHGo8J6FbC jiHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=xM9+38xkTaN7YlIeDutwYzXFMh5cVl6szD/Pylq4X8c=; fh=vAoEAjNZCjfQkEcdTrv/sg+0BydeFefaCjHXBJUqZyg=; b=WNnA7E8VgQuevjFld84sUlSaIomN5G9F9cLvsyx5mL7Do0SbZnHhCWw0CrUtVjxghh Fjy0xtvnnjK1U0+4uu+CnSL9k9apaVWqwWftkOoA8Mn5rsGE1Jc+oPOu+d6z1g/oGNwE BVj34xuETH9oER9Jdb0CTbwDtQGg8rvQOkLDX1IoRzW50SY3vECGpUWjlt+XvqgUDBLZ PhUVrw4KBa2WqhwR7xBDl2WQlbsOKxpdS1IWStXucf0K1RjK0gygPTpCAnXVeDT9rXbw bWrasc6Ds8v06kM68sGAt/S5ARWrswnAqfmMhcjwDWVfNWWUKWLtr/bcnz1mDv0WzoVA CbfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WrzRq8qL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jo13-20020a170906f6cd00b00991c8af7ba5si9782748ejb.473.2023.08.01.16.42.54; Tue, 01 Aug 2023 16:43:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WrzRq8qL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230057AbjHAXR0 (ORCPT + 99 others); Tue, 1 Aug 2023 19:17:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229499AbjHAXRX (ORCPT ); Tue, 1 Aug 2023 19:17:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C9592103 for ; Tue, 1 Aug 2023 16:17:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C80B26176D for ; Tue, 1 Aug 2023 23:17:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A856C433A9 for ; Tue, 1 Aug 2023 23:17:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690931842; bh=xM9+38xkTaN7YlIeDutwYzXFMh5cVl6szD/Pylq4X8c=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=WrzRq8qLP1GUdOwsqs5cbpqjL+mV23IX8e3uQwhDcMU7RXaeBrsr+J9mqo6FFsY0Z Exi0sgw4Q0aOinGyJGU5RyBeTzFNcXV+eVTasfFRj5PK49SDxbF+GNGsSGS7leFhAf 7x3zBNZSxX+H3kNUtKs9BkllbkGAGec3BgF+0vBL4s9aYxJ5TMMTFgwFAeF0TOncaN qX1n0F1Lf8K21aRZBl+RQ8Wqaw9s9b7KRokhbHLv4tHu0nVhXTgV6s3VsRSp5hfL+9 YXK+vN4dxMSPGIeOxcfVpAyHHn0icLLM/RyhEZAd0mV6D6pE5+GCFvKMNcXbNvrqcM 5L1qREEpa7Q/A== Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-5222b917e0cso8976638a12.0 for ; Tue, 01 Aug 2023 16:17:22 -0700 (PDT) X-Gm-Message-State: ABy/qLZ8ExUDyDOAXZdJMSOVMBcmLidxtWO0a5kTyrELrcT3OjryoKdM i+mHYk7PF6yauUAwn4O9aIV5IufpdyUVPQOJyAM= X-Received: by 2002:a05:6402:1650:b0:522:216a:28d4 with SMTP id s16-20020a056402165000b00522216a28d4mr3598861edx.7.1690931840292; Tue, 01 Aug 2023 16:17:20 -0700 (PDT) MIME-Version: 1.0 References: <20230801011554.3950435-1-guoren@kernel.org> In-Reply-To: From: Guo Ren Date: Tue, 1 Aug 2023 19:17:08 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] LoongArch: Fixup cmpxchg sematic for memory barrier To: WANG Rui Cc: chenhuacai@kernel.or, kernel@xen0n.name, arnd@arndb.de, andi.shyti@linux.intel.com, andrzej.hajda@intel.com, peterz@infradead.org, will@kernel.org, boqun.feng@gmail.com, mark.rutland@arm.com, loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, Guo Ren Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On Tue, Aug 1, 2023 at 12:37=E2=80=AFPM WANG Rui wrot= e: > > On Tue, Aug 1, 2023 at 6:50=E2=80=AFPM Guo Ren wrote: > > > > On Tue, Aug 1, 2023 at 5:32=E2=80=AFPM WANG Rui w= rote: > > > No. LL and LL won't reorder because LL implies a memory barrier(thoug= h > > > not acquire semantics). > > That means we could remove __WEAK_LLSC_MB totally, right? > > More precisely, __WEAK_LLSC_MB is intended to prevent reordering > between LL and normal LD used to fetch the expected value for cmpxchg. Oh, that's unnecessary when cmpxchg fails. Maybe you treat cmpxchg as a CoRR antidote in coincidence. Please solve the CoRR problem by READ_ONCE. See alpha architecture. > > Regards, > -- > WANG Rui > --=20 Best Regards Guo Ren