Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5515753rwb; Tue, 1 Aug 2023 04:04:08 -0700 (PDT) X-Google-Smtp-Source: APBJJlGhGojyLvgHAYvYFdphdvVb0v4BnlsaW4G3+tZzSD4/lbLz6LTHBENLL1erGrmpCEHXYS0+ X-Received: by 2002:a17:902:a405:b0:1b8:7d0d:5ac5 with SMTP id p5-20020a170902a40500b001b87d0d5ac5mr9182903plq.50.1690887847852; Tue, 01 Aug 2023 04:04:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690887847; cv=none; d=google.com; s=arc-20160816; b=qi66kdlSZ5EehyTsxatonZqI+yAw5u2Dd54gkPMUWozdZ2hRSF+s7xPCecVDIZdX5A hY9zmpKuyirScBhHBuGwgER40iy2NwxY8kffU3nusbOsJ0bTVGtpHGPCxlcYh3bQh6QJ ZnLljfcCaZOLRz7SqLd9DZL1aT3WJvs6HnDbTQ5aufyHFsK+jEgsX0NKizkd0oVImhav uBmbaI8tw9G4lLGlzRkJbatZNno1w+3RoWd1QOImMT2w09rgm3yvFcZsLKJdKKVapt1I ej2QErJOv137I+q44MTpC5WoZLlyAOYnmVDrOK4PeTNGOblvkK/vyKwg4y4RRHfwQ7Cs uYIA== 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=oa5CE/UQORcUlEgISyF1qduo19VgiPMLbtsLDj9rJ5k=; fh=vAoEAjNZCjfQkEcdTrv/sg+0BydeFefaCjHXBJUqZyg=; b=e3Z4Q347eSlbrlQVxm9hJP5MM2voS+ScFarZOcu2F/k99VPTeAqzgAPkiWVQRRjot4 Q/PnerUcfMky02j5Sq0nlAhGZDoCYY0skJ0EZUCWPzRnVjWVN92i7RMdu3Oe2oFKMkUG 2yzw7MlsuVOGlaIXAqp/cy27/pocfV6WSAybRXt1zm1/G9zOwgqN9oHVOQZ7su8ZQ8LU jo4R4EPCGiK8NSMCO8AcvX6XTM2wbLhok5GpKphjG6pg7w31GEZHTKMaj/p3rAm8ue76 /ibMDyZWN1rDKjCQXqxY01iooUvwykT3RjS0q0tZO7pFzUUI2tzXYPvDfbCkamqlYUys 3wSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YEg8q8AG; 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 e9-20020a17090301c900b001b7fd6f95f6si6470117plh.515.2023.08.01.04.03.40; Tue, 01 Aug 2023 04:04:07 -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=YEg8q8AG; 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 S234105AbjHAKxw (ORCPT + 99 others); Tue, 1 Aug 2023 06:53:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234414AbjHAKxV (ORCPT ); Tue, 1 Aug 2023 06:53:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1E6F5587 for ; Tue, 1 Aug 2023 03:50:03 -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) server-digest SHA256) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id ECDAC61519 for ; Tue, 1 Aug 2023 10:49:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50BF3C433CD for ; Tue, 1 Aug 2023 10:49:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690886999; bh=u7I+zdXZxktdq8ChnbQrPRnPNrQrNqrJr3UZE+w6xVM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=YEg8q8AGO7PDRDEJdoUZsaCFcZLFriVWXApTzTAVI4en+f56NOAPhRiRI7jyTg0oh igyeJjI16GfahMSl5ri8osu7DEK1txIPZvIydHfEZ32Ot7cU5t61U9sUUMmx4q2/xc NCH1wbq346XELm23p2LOi8eUTU2+pYpIR6sfDC7Dau3fapXStyv4X7dUoxb2zMygXt eIxvk7ChiKlKyCSRqEdOXXN8OtcGoI3EiMwRUI3REjYEhGwTTcfaL+VlqW4fyDeDvX DfT6aj3Nf0MT+a8JR9Op4KlXpHdOdkzXYI9hqZmmgkQoDFAYJMvsm6SgrtAirccr5V mwZZ9x1VBMiBw== Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-522ab301692so5429551a12.2 for ; Tue, 01 Aug 2023 03:49:59 -0700 (PDT) X-Gm-Message-State: ABy/qLY4JSLdJvQXYrL9JtskoxHER4bMpMIihwEAHZ5eaAiU0sJJ7XJw bxVcZ6sRsuUntaOrENwT9vaPb6lTAafog/LCyig= X-Received: by 2002:aa7:d507:0:b0:522:3a28:feca with SMTP id y7-20020aa7d507000000b005223a28fecamr2581715edq.24.1690886997423; Tue, 01 Aug 2023 03:49:57 -0700 (PDT) MIME-Version: 1.0 References: <20230801011554.3950435-1-guoren@kernel.org> In-Reply-To: From: Guo Ren Date: Tue, 1 Aug 2023 18:49:45 +0800 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=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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 5:32=E2=80=AFPM WANG Rui wrote= : > > Hello, > > On Tue, Aug 1, 2023 at 5:05=E2=80=AFPM Guo Ren wrote: > > > > > The CoRR problem would cause wider problems than this.For this case, > > > do you mean your LL -> LL would be reordered? > > > > > > CPU 0 > > > CPU1 > > > LL(2) (set ex-monitor) > > > > > > store (break the ex-monitor) > > > LL(1) (reordered instruction set ex-monitor > > > SC(3) (successes ?) > > Sorry for the mail client reformat, I mean: > > > > CPU0 LL(2) (set ex-monitor) > > CPU1 STORE (break the ex-monitor) > > CPU0 LL(1) (reordered instruction set ex-monitor > > CPU0 SC(3) (success?) > > No. LL and LL won't reorder because LL implies a memory barrier(though > not acquire semantics). That means we could remove __WEAK_LLSC_MB totally, right? > > Regards, > -- > WANG Rui > --=20 Best Regards Guo Ren