Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2645984imm; Mon, 10 Sep 2018 04:31:31 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYkDGJMAkeRCPE+LpfM1W7jAVvHXt0V9Q6ctenJ6CTHOTAoufXXAQOlBLChth5ZNTKQA7LN X-Received: by 2002:a62:6d02:: with SMTP id i2-v6mr23625732pfc.218.1536579091322; Mon, 10 Sep 2018 04:31:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536579091; cv=none; d=google.com; s=arc-20160816; b=OpICZJM3d+HIwVSVpLTU7qtJ8z2W+jc44HzYX+Ik0sWdNRxKXnwiGDHFzuUV5OjhDc 4H1CtdBhzP24EnuihJ8vJFNjBzHj5bfKlQS76exY82GNGFna2W/S9ADZQLfb6V65yKVU 4bu3VPkqcZNC8JcDbAvZZ0oFr6sZYi8mRlXv/Tsr1H2R3vCC+CoJwqn8mVBhoy2IUH4H 3xQYOdwDN+PN2esqHEtcDMFC9AshhdwuWDQpydb2AQl81doGg8NUhLNfmDEBPsRzlQQ1 qm8PNv2kRDBNDG3wjrH3F9Fy6T+6C4KAMNpZTjSo2Nu3LBOfM/ALMsXvWK2R/hePNKJ6 8NQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Mk1HL1H+7x4g6lTZivnPI31Ajh6Emm2JYk8arraEwyM=; b=veBj0O/j7KVpkM5/WsGp+BV5QtouVPw3GGaG3tND1s3mewa4zorBywQ1xXKe3GTueK eypEkAfW6vTkz8sFBFRP+XO0yOLgDN+MNN4VgzGKjbWehxKz8yrvdZS2WVv946BUlmw5 IyCd0advF7jhPUT17rsF4XHJkAV+S58NwawBKAwSY2DojhtCd5eTz/k2cTIvn8R/8Ph2 blvwCPbTVELqFBcZdxEzxv0ywn/3A0fKp6isAbXCiATTm9Hk2Wujwo81LeK6apKlXVXp Xs+oeNHc0JXDKhsPUzi2UHE9yldsE40s5lx9OQVkZNHLE7E/YG8hT4kCcAzvkieN+NnH WpPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=eQPVGZae; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p12-v6si15676291pls.53.2018.09.10.04.31.14; Mon, 10 Sep 2018 04:31:31 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=eQPVGZae; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728404AbeIJQUt (ORCPT + 99 others); Mon, 10 Sep 2018 12:20:49 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:54710 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727411AbeIJQUt (ORCPT ); Mon, 10 Sep 2018 12:20:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Mk1HL1H+7x4g6lTZivnPI31Ajh6Emm2JYk8arraEwyM=; b=eQPVGZaeEGlAmOaRLd/AKMpCd QyvSCBbT4ZImvu3chBRwmKTq3TgmLCaedNGsnlrPeTQxTjeofRMFHGccB5k/yPTnIcuOsYIOsdmmu aHRO1D2zTW5xdVwXnvX4jRW+KEmuWuTFCKVSeZ4363u4ubKaLRxVoN8njUCjDQWAiPkYHEk3oCTqw eQhA+hgcg51/8Hgv0pJOO+2Ek++B+KdeePWTCxiU2+5FG6VIxgB4lqcpRaY3xLOqPGq2dVB8qJ021 CYmSqPQBOrT9FEo79SbxEWguGuuVOjG5e4LCimUN0bmeRh3OdkKJhVelIPbtMOa1UT3UNqarOWKgu H/l2LPEng==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fzKLV-00079C-Gz; Mon, 10 Sep 2018 11:27:09 +0000 Date: Mon, 10 Sep 2018 04:27:09 -0700 From: Christoph Hellwig To: Atish Patra Cc: palmer@sifive.com, linux-riscv@lists.infradead.org, hch@infradead.org, anup@brainfault.org, mark.rutland@arm.com, Damien.LeMoal@wdc.com, jason@lakedaemon.net, ard.biesheuvel@linaro.org, marc.zyngier@arm.com, gregkh@linuxfoundation.org, dmitriy@oss-tech.org, linux-kernel@vger.kernel.org, jeremy.linton@arm.com, catalin.marinas@arm.com, tglx@linutronix.de Subject: Re: [PATCH v3 09/12] RISC-V: User WRITE_ONCE instead of direct access Message-ID: <20180910112709.GH12979@infradead.org> References: <1536221135-182613-1-git-send-email-atish.patra@wdc.com> <1536221135-182613-10-git-send-email-atish.patra@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1536221135-182613-10-git-send-email-atish.patra@wdc.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 06, 2018 at 01:05:32AM -0700, Atish Patra wrote: > The secondary harts spin on couple of per cpu variables until both of > these are non-zero so it's not necessary to have any ordering here. > However, WRITE_ONCE should be used to avoid tearing. We normally pair WRITE_ONCE with READ_ONCE. But it seems like the reader side is in assembly code, so this should be ok: Reviewed-by: Christoph Hellwig