Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5474478rwb; Tue, 1 Aug 2023 03:16:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlEb6WW8bHx14sCZS4XaJY666ig4Jbjyam+FE8U7oO+rNHPtCv9EAWCiQrtSu04SoICrOYJ1 X-Received: by 2002:a05:6a00:13a5:b0:682:4801:93d3 with SMTP id t37-20020a056a0013a500b00682480193d3mr14643964pfg.31.1690884993647; Tue, 01 Aug 2023 03:16:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690884993; cv=none; d=google.com; s=arc-20160816; b=eQsq+vbiLowdKAFJ8rd4AC+xJssCmX0X9vv0J7zrz6LPeTS0uyo6UkOrJoxojJEOEc K7DA2KD/voQxFGiuPzBMeWQpSOQCl4jyeWD6IhN1oWg8hbZe6PgkO6T46HI4s2Ja5r6M WvWx83JCNjmty6tpUjR4FoQ4ME2RqiezxIOx2EGagoqYlIMllVtPHIIAhtXLfMgDMsAq Tl1shxMqYTNcMBkqg2aCOmvdX/DK7duZcRK77SzrYeQfww/F4jLaBTxphLYbGcnqqFXC 1LHVwjU71IhFa/q7f/rzZ8R/4TeatzsBN8sggAkypPkw9YKFrpB/SH2vJCzTfpl6yFQQ v/cA== 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; bh=HH/T4vgrwIL+ccp7Lj5P7OM1WpeRep5/QS+RrVtGEMw=; fh=PxxAVadtOQjMRcRmDo2Jb4n9TPl92Nihns72TrQ/54E=; b=I0rU9n7jnQ5qJCoixqHEe/rZhlL4vcY8EA0Rvf8+6bVrjbk4B4Tunmu+6Kd7tYuduO HzubpjfmN5My8D62cUQsCsgrYDukMwg7+gqez9hSVmb2Npjt2C6+Pdo03gUqFZmnH7v3 v37Tt/IKS/CV/GRAsrkaHwO5NzvjadDx8ETZvgYCEwPXrjbG8HveHhfWfbS0xCIw/LSL QABcLcv35BxEiQeqw/SSTlK4rld8JLRAc4/8WxotjmMIP7RliHIBNrA78FFcXCV2eUmH 12tQh033LwWw1PsLa8fguSxFrdLZgv007PMTV2GKMfPdIqx08KNFYhvcO94358TzaxqG jIqA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bd8-20020a056a00278800b00686f034ed7fsi8881673pfb.371.2023.08.01.03.16.21; Tue, 01 Aug 2023 03:16:33 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233051AbjHAJef convert rfc822-to-8bit (ORCPT + 99 others); Tue, 1 Aug 2023 05:34:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233039AbjHAJeP (ORCPT ); Tue, 1 Aug 2023 05:34:15 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A89B64227 for ; Tue, 1 Aug 2023 02:32:10 -0700 (PDT) Received: from loongson.cn (unknown [209.85.128.46]) by gateway (Coremail) with SMTP id _____8DxBfEY0chkmgEOAA--.33177S3; Tue, 01 Aug 2023 17:32:08 +0800 (CST) Received: from mail-wm1-f46.google.com (unknown [209.85.128.46]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Ax98wV0chka8pDAA--.25082S3; Tue, 01 Aug 2023 17:32:07 +0800 (CST) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-3fe1fc8768aso20741995e9.1 for ; Tue, 01 Aug 2023 02:32:07 -0700 (PDT) X-Gm-Message-State: ABy/qLYQePvlrahuCV7AzBHk0JBxPow6BT6uBiNdFNS2qGsTrkgi9uWg CyBePHB1tK+rsFIp5/iiF2uo6pXvUUzA6QFogp80OQ== X-Received: by 2002:adf:eec3:0:b0:317:6849:2d39 with SMTP id a3-20020adfeec3000000b0031768492d39mr2061081wrp.10.1690882325216; Tue, 01 Aug 2023 02:32:05 -0700 (PDT) MIME-Version: 1.0 References: <20230801011554.3950435-1-guoren@kernel.org> In-Reply-To: From: WANG Rui Date: Tue, 1 Aug 2023 17:31:54 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] LoongArch: Fixup cmpxchg sematic for memory barrier To: Guo Ren 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: 8BIT X-CM-TRANSID: AQAAf8Ax98wV0chka8pDAA--.25082S3 X-CM-SenderInfo: pzdqw2txl6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBj9xXoW7Jr1xZFyUAr1rWry5GF18Xrc_yoWxCrb_C3 Z7CrWrZr48Jw18JanxWry3ZF4j9FZruFyUJFy7t3Wvqa40q3ZxJFsFyr93Za4rArs2yFn7 C3WDZa98Zw17AosvyTuYvTs0mTUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUj1kv1TuYvT s0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUI cSsGvfJTRUUUbxAYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20x vaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVW8JVW5JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV W8JVWxJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4UJVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44I27w Aqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_JrI_JrylYx0Ex4A2jsIE 14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvEwIxGrwCF04k20xvY0x0EwI xGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwCFI7km07C267AKxVW8ZVWrXwC20s026c02F40E 14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIx kGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVW8JVW5JwCI42IY6xIIjxv20xvEc7CjxVAF wI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F 4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07UWHqcU UUUU= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, 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 Hello, On Tue, Aug 1, 2023 at 5:05 PM 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). Regards, -- WANG Rui