From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24986C04AA7 for ; Mon, 13 May 2019 13:04:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EABAB208C2 for ; Mon, 13 May 2019 13:04:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730059AbfEMNET (ORCPT ); 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 >>>>