Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5193106yba; Mon, 13 May 2019 06:58:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlhWZQZO6TYSlHQE9TAV+TAFTFaXY/OVKgggp4qQiVf9CcYKLGgMo+DcsQFCHYcpNPVFRc X-Received: by 2002:aa7:8157:: with SMTP id d23mr6167944pfn.92.1557755923405; Mon, 13 May 2019 06:58:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557755923; cv=none; d=google.com; s=arc-20160816; b=WeowNSOO4hNd4BSvIJYrqwqLDplJMGkLe7lH5YXq+FbgLJ3oZ5UHpiPHl2CC7sbIlV y9dNgrVgzm6HYwFSvRfBdBftP51NGLb/PMnMe1T8KpJiYnT99UUHkWHh2tFgwOjv4BJ5 nnoAWkgnqwsziGspPSsPH/UiT6KQMZTo4MX9Ac/bie0jTAvzZqlLa6NglCZRk9PZ1Fdm 567FepMiRUcLWrYKMysWBOzYxnVaDQTiRvz6BRflyGLwlrKzHCAPdqvdQ6VQD8Y3pm9j LxO+dGRDUrgWvCMemFmtqZMV1DgAt1n5KR/UiZ7nq+RsPmxE0h98AtdnfyVthXAaCZ7R xnjA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=snA1VrFq6Gff/ROHD/wVIKSCFbbLD8IvEGQUXCCdnGg=; b=xwD0SizAHtrq/1ACMTr9P0K6H6GQJGxW4YZcVc2q1hd6PHn0HXw9Y4BZa2iT8rtwO1 xwn7/RxmZTMQChtuCfFwZ+1vMzP47gY4ugpH7SkezbXh6gVYlpqFBWaLSuaAOKLzevW5 k/fCGc+aydTkKmBfroundYdBZbNHx16A7YjxSTE3KSfU/zhSMIB1St4BqRGuGKfzEbw0 F6FjVUPyXvWIzhnVp5tm8bAuRt+DduRoV0o81AG+OfEQPsF0Y/0QhEHTSxOpBXaTA7Zs sPR73Ojm11sqlYNugWd3ll9k/zHcY9VDcAh2F/N8yTRP/WJZ0e6NfaKh6kJY+gjMQbbI 3wRg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a25si16629362pff.119.2019.05.13.06.58.26; Mon, 13 May 2019 06:58:43 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730052AbfEMNET (ORCPT + 99 others); Mon, 13 May 2019 09:04:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59104 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727953AbfEMNET (ORCPT ); Mon, 13 May 2019 09:04:19 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8DAAA3084288; Mon, 13 May 2019 13:04:18 +0000 (UTC) Received: from [10.72.12.50] (ovpn-12-50.pek2.redhat.com [10.72.12.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2A6C618A47; Mon, 13 May 2019 13:04:11 +0000 (UTC) Subject: Re: [PATCH 4/5] ceph: fix improper use of smp_mb__before_atomic() To: Andrea Parri , "Yan, Zheng" Cc: Linux Kernel Mailing List , Sage Weil , Ilya Dryomov , ceph-devel , "Paul E. McKenney" , Peter Zijlstra References: <1556568902-12464-1-git-send-email-andrea.parri@amarulasolutions.com> <1556568902-12464-5-git-send-email-andrea.parri@amarulasolutions.com> <20190430082332.GB2677@hirez.programming.kicks-ass.net> <20190509205452.GA4359@andrea> From: "Yan, Zheng" Message-ID: <6956e700-ef56-7f20-4e6c-3ad86c9fd89e@redhat.com> Date: Mon, 13 May 2019 21:04:10 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190509205452.GA4359@andrea> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Mon, 13 May 2019 13:04:19 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/10/19 4:55 AM, Andrea Parri wrote: > On Tue, Apr 30, 2019 at 05:08:43PM +0800, Yan, Zheng wrote: >> On Tue, Apr 30, 2019 at 4:26 PM Peter Zijlstra wrote: >>> >>> On Mon, Apr 29, 2019 at 10:15:00PM +0200, Andrea Parri wrote: >>>> This barrier only applies to the read-modify-write operations; in >>>> particular, it does not apply to the atomic64_set() primitive. >>>> >>>> Replace the barrier with an smp_mb(). >>>> >>> >>>> @@ -541,7 +541,7 @@ static inline void __ceph_dir_set_complete(struct ceph_inode_info *ci, >>>> long long release_count, >>>> long long ordered_count) >>>> { >>>> - smp_mb__before_atomic(); >>> >>> same >>> /* >>> * XXX: the comment that explain this barrier goes here. >>> */ >>> >> >> makes sure operations that setup readdir cache (update page cache and >> i_size) are strongly ordered with following atomic64_set. > > Thanks for the suggestion, Yan. > > To be clear: would you like me to integrate your comment and resend? > any other suggestions? > Yes, please Regards Yan, Zheng > Thanx, > Andrea > > >> >>>> + smp_mb(); >>> >>>> atomic64_set(&ci->i_complete_seq[0], release_count); >>>> atomic64_set(&ci->i_complete_seq[1], ordered_count); >>>> } >>>> -- >>>> 2.7.4 >>>>