Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp341786imm; Wed, 11 Jul 2018 03:31:01 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfS1z/V9q6jPe9h/nNIao7N/ftTd4b3nBwbZbddSyUKqHLeGALJV9pGviJ1jlE2yS0drMyl X-Received: by 2002:a63:b256:: with SMTP id t22-v6mr26883500pgo.101.1531305061495; Wed, 11 Jul 2018 03:31:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531305061; cv=none; d=google.com; s=arc-20160816; b=dL7VDBj3qOB8I22PGZQBuNWWyAOOj5mZHnoARRJT0ZW6Bhi0vgKQbrkPzqZRtmLNbP +eXvRwbquO2HIeYthXBfAU29zJFbecgiOs9l6FRF4rxWhU3+Xx4Zf7lXCL224VJ5B/Yg pAJ84Eiz5UI0o+QwrGcMu1kPJX52TasNM54R/5Xh12rWF58IJqlfflBQgVdYEka37ERb vpDtM1+admJs9cnsQ3OTqWYFIVO/SDmGZBWPmInVdMDQbpnbS8j3CIa3QUQ83a3Bbs3T 7xVe7Ur3kwzVrOL0gmXcux68p1gm2LkwSoZosjIAL7dF6+QTmjKm8ZqEMWAsKwuy7rX6 xGQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature:arc-authentication-results; bh=XCCe7vZc7GQyW/Uk20RcYER7XQFfgxW8goHDS9VObxA=; b=JXXZ+oFrUmfg37XP+5zBt2vMur8Bpszj/ngVMMkvoq02/jHX/wDZ4i8E/AYkkVwRcb 7Evvbx8pFGLXVrWQjRvOSdmkg1Qq0uBB6pgzlk/4BE0MQ9ozbUGZMlNhU04YWNTZN/UT XozlJn9/SiKhNsVfO4uV/+G3J2Ww2EXuGl97Ks8AjUsDRp9JE7DhB7Kpr23i6lTLlsZ0 jphxsxVFwEN0Bmso7qUIth8O/0EDUxnwwipIOJ+nJ3ZxUXJ2GdgUkrgB6bQ9ec3JzJyc AliMS5wMnvpwS20GU9j54MiZ8YNuxK2Ks6DYQj+tQdbrCDMEMNU7vvsYbsEVaMS4UBo2 XDnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=mail header.b=WbgbahD0; dkim=pass header.i=@flygoat.com header.s=mail header.b=eCSIkuGG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si19000373plu.282.2018.07.11.03.30.45; Wed, 11 Jul 2018 03:31:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=mail header.b=WbgbahD0; dkim=pass header.i=@flygoat.com header.s=mail header.b=eCSIkuGG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726641AbeGKKc7 (ORCPT + 99 others); Wed, 11 Jul 2018 06:32:59 -0400 Received: from forward104p.mail.yandex.net ([77.88.28.107]:54260 "EHLO forward104p.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726440AbeGKKc7 (ORCPT ); Wed, 11 Jul 2018 06:32:59 -0400 X-Greylist: delayed 756 seconds by postgrey-1.27 at vger.kernel.org; Wed, 11 Jul 2018 06:32:56 EDT Received: from mxback1g.mail.yandex.net (mxback1g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:162]) by forward104p.mail.yandex.net (Yandex) with ESMTP id B3C52181BC3; Wed, 11 Jul 2018 13:14:57 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback1g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id QIlY3WS5VM-Eu1G4nPP; Wed, 11 Jul 2018 13:14:57 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; s=mail; t=1531304097; bh=XCCe7vZc7GQyW/Uk20RcYER7XQFfgxW8goHDS9VObxA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References; b=WbgbahD0+vZJfY3jnRlpGa+xI1+WC81hJZdXBnPchpOduLhpn/jZRvMAZ+8rW8vpI KOxfFiGvAOvK9jE9PkbZQ6A4SsUnLCQRSLyy94R808f93VSpN5JhTiPtoU32YX/9dC 9tEgueIFzhdbbd6/DnLpi4KmciYvZ7xscM/3BOHM= Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id fDNQFekDBA-EmhCeUUh; Wed, 11 Jul 2018 13:14:53 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; s=mail; t=1531304094; bh=XCCe7vZc7GQyW/Uk20RcYER7XQFfgxW8goHDS9VObxA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References; b=eCSIkuGGxcPhycRObxIrrwZk4lN1sPuTvO3aqvHXxpZvZefNyJllo4kHv+gkw4dh+ RWbHVp4cBjBxmrYVpnHRPUW6P7P6Zs1xWkn2pgQKiQWB8D75meSOpG0ByfSFOICrVf XwXcAzmMoqMNG+zMQKj0C/EXrL2VcvzYeHMdgeRY= Authentication-Results: smtp3p.mail.yandex.net; dkim=pass header.i=@flygoat.com From: Jiaxun Yang To: linux-mips@linux-mips.org Cc: Peter Zijlstra , =?utf-8?B?6ZmI5Y2O5omN?= , Paul Burton , Ralf Baechle , James Hogan , Fuxin Zhang , wuzhangjin , stable , Alan Stern , Andrea Parri , Will Deacon , Boqun Feng , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , "Paul E. McKenney" , Akira Yokosawa , LKML Subject: Re: [PATCH V2] MIPS: implement smp_cond_load_acquire() for Loongson-3 Date: Wed, 11 Jul 2018 18:05:51 +0800 Message-ID: <5471216.FKXZRxKFUI@flygoat-ry> In-Reply-To: <20180710121727.GK2476@hirez.programming.kicks-ass.net> References: <1531103198-16764-1-git-send-email-chenhc@lemote.com> <20180710121727.GK2476@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-7-10 Tue at 20:17:27=EF=BC=8CPeter Zijlstra Wrote=EF=BC=9A Hi Peter Since Huacai unable to send email via client, I'm going to reply for him=20 =20 > Sure.. we all got that far. And no, this isn't the _real_ problem. This > is a manifestation of the problem. >=20 > The problem is that your SFB is broken (per the Linux requirements). We > require that stores will become visible. That is, they must not > indefinitely (for whatever reason) stay in the store buffer. >=20 > > I don't think this is a hardware bug, in design, SFB will flushed to > > L1 cache in three cases: > >=20 > > 1, data in SFB is full (be a complete cache line); > > 2, there is a subsequent read access in the same cache line; > > 3, a 'sync' instruction is executed. >=20 > And I think this _is_ a hardware bug. You just designed the bug instead > of it being by accident. Yes, we understood that this hardware feature is not supported by LKML, so it should be a hardware bug for LKML. >=20 > It doesn't happen an _any_ other architecture except that dodgy > ARM11MPCore part. Linux hard relies on stores to become available > _eventually_. >=20 > Still, even with the rules above, the best work-around is still the very > same cpu_relax() hack. As you say, SFB makes Loongson not fully SMP-coherent. However, modify cpu_relax can solve the current problem, but not so straight forward. On the other hand, providing a Loongson-specif= ic=20 WRITE_ONCE looks more reasonable, because it the eliminate the "non-cohrenc= y". So we can solve the bug from the root. Thanks. =2D- Jiaxun Yang