Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5465077rwb; Tue, 1 Aug 2023 03:06:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlEVw/sqbyFg1F17kzjStPbA0YMCCLa+YCI4XhUwEitV64M51SwR2VzhJivTCoIQSHwRtwk9 X-Received: by 2002:a05:6a00:2e08:b0:687:472f:5150 with SMTP id fc8-20020a056a002e0800b00687472f5150mr4166382pfb.8.1690884366456; Tue, 01 Aug 2023 03:06:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690884366; cv=none; d=google.com; s=arc-20160816; b=ZSPNrRIABasuOKgM4X+Y5BzXib7hnQ8ui2BNJmxRX7NnUktTwDJt4uEq1bNe8vd1V2 jxrm8z9Vd/OXI2TXUzDnSYbotCm5tIP6vX8M4aQEkwxGQ21A0e/Boz+u/HuWpjdWVFvB r6OMCAo2Cnr9pmpids6KgFKqduyhnt/BP6YZwZNMM0Mn6UtEZWji549ARMEV6qasDUhe I+CDEVLA9zFNoThjsM1zNTa0nFIlBNNg5lnkQBP6+hU3e0qcKt8OxIOgVSl/6MPNsby2 oaVAqEfdGzkJNa4sp2tIc9Wm/FyPjObcGZM6hCU608zZ7wMQx/5IdPPUzgf2g8rS4ddL R/pA== 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=ZgmUexsy8pACqXdYydam8s4BDU9bqAP2P435GbXJDRs=; fh=t9Fc5i8xtOaPZ8qVugMt7fd/RyyT8N2Vdlm51dcmzFQ=; b=YuKo40ZYmLNrpq8QaanI9yUBffWh8oduNNXysahyneYhxcihbQ/PjsiPeFL4LCuMja q9O7mFFvj5jo8ayGTjlXG3cKrbg+TGmlgmoQX+HS4PlXHUHyZkgMWOluZ+a/joY0+GFf SbcbCrCH1dEO+4eBfnT9BC0UiI4dwMmBriYw/RT1iwo4nDwXx+1R4e8s9xKJWw+WTyqZ LVm/WRXVwdKKkYa88LFA0F3Waw4JCsqUzMLbVoP9Ii4y++f88WEjDqQ0iu4upzGoxeZn 4LwXQ+JojbuP7XBYQMWjJFHY9c0o/4tYgkQP6WQMJm0jD/ep4qtmzF3xPmE5qD6K/mlg sXuw== 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 t62-20020a638141000000b00524eef20da6si8697097pgd.642.2023.08.01.03.05.54; Tue, 01 Aug 2023 03:06:06 -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 S231879AbjHAJdl convert rfc822-to-8bit (ORCPT + 99 others); Tue, 1 Aug 2023 05:33:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233101AbjHAJdC (ORCPT ); Tue, 1 Aug 2023 05:33:02 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E87E330F7 for ; Tue, 1 Aug 2023 02:31:00 -0700 (PDT) Received: from loongson.cn (unknown [209.85.128.45]) by gateway (Coremail) with SMTP id _____8BxnuvH0MhkagEOAA--.30785S3; Tue, 01 Aug 2023 17:30:48 +0800 (CST) Received: from mail-wm1-f45.google.com (unknown [209.85.128.45]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxviPF0MhkCMpDAA--.4638S3; Tue, 01 Aug 2023 17:30:46 +0800 (CST) Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-3fe2bc2701bso1395505e9.2 for ; Tue, 01 Aug 2023 02:30:46 -0700 (PDT) X-Gm-Message-State: ABy/qLYXbBfSUqbvyTk0Rz+7e7Xu021HMKtNdggxpVpTwvCx7CdqiOrH TQnyvwZJ4br1e7paWpAmhJyrNkYUJvgcgrGAGe/E6A== X-Received: by 2002:adf:edcd:0:b0:314:8d:7eb5 with SMTP id v13-20020adfedcd000000b00314008d7eb5mr1919533wro.29.1690882244713; Tue, 01 Aug 2023 02:30:44 -0700 (PDT) MIME-Version: 1.0 References: <20230801011554.3950435-1-guoren@kernel.org> <20230801083201.GB26036@willie-the-truck> In-Reply-To: <20230801083201.GB26036@willie-the-truck> From: WANG Rui Date: Tue, 1 Aug 2023 17:30:33 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] LoongArch: Fixup cmpxchg sematic for memory barrier To: Will Deacon Cc: guoren@kernel.org, chenhuacai@kernel.or, kernel@xen0n.name, arnd@arndb.de, andi.shyti@linux.intel.com, andrzej.hajda@intel.com, peterz@infradead.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: AQAAf8DxviPF0MhkCMpDAA--.4638S3 X-CM-SenderInfo: pzdqw2txl6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29K BjDU0xBIdaVrnRJUUUBKb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26c xKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vE j48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxV AFwI0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x02 67AKxVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6x ACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E 87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IY64vIr41l42xK82IYc2 Ij64vIr41l4c8EcI0En4kS14v26r1q6r43MxAqzxv26xkF7I0En4kS14v26r1q6r43MxC2 0s026xCaFVCjc4AY6r1j6r4UMxCIbckI1I0E14v26r1q6r43MI8I3I0E5I8CrVAFwI0_Jr 0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0E wIxGrwCI42IY6xIIjxv20xvE14v26r1I6r4UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJV W8JwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAI cVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU1CPfJUUUUU== 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 4:32 PM Will Deacon wrote: > > Hmm, somehow this one passed me by, but I think that puts you in the naughty > corner with Itanium. It probably also means your READ_ONCE() is broken, > unless the compiler emits barriers for volatile reads (like ia64)? Hmm, I agree with your perspective. Allowing out-of-order loads for the same address in the memory model provides certain performance benefits, but it also poses challenges to software. Fortunately, hardware supports software to disable this feature when needed. Regards, -- WANG Rui