Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4661405yba; Tue, 30 Apr 2019 02:10:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqyy8rc3QD1k0NzYBtAVEGMPhEBGWMTDzANCL90WnfqBkCDlSciBqDdhh9bwdLA7HvHNwm79 X-Received: by 2002:a62:4115:: with SMTP id o21mr68832410pfa.153.1556615440257; Tue, 30 Apr 2019 02:10:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556615440; cv=none; d=google.com; s=arc-20160816; b=L6E9Avjs2fH3ydfFkXahLEDjRj6CvPx3Gm/zx05PHtMXKip/ZkwFQEADpxmbHWXb3+ Om+98C841vG0RYtA0PGnx9Jq4jUvsOzoTPSUWWNaQYpScy4RZCJDDPyOGAt88szSseFU yYS/T3ZpJhw7QvkE/w81g212GojehgIjdUZLZ0S/eolqY5uSvY8qSgYV+ohtzVqW/V0i 3XRlNm7YsYbJYbQlFtynpmjFxRCnrnEp6nt4b2dK190N3OZqMgDK0FQo7ZeJY6OTVIeH kAmzIeXl9sb0nU46sktq411Jksu6qKOZIsK8nQiSTYUKu+eVA/ZAdIrYcBVRO53kuFJc 2yQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=LqvnYPQ4d9M13B73C2lxCghPlB6ymNoLCZdoFF0EvzU=; b=zWLoXynKI/qETBOAnS9utp5JfX83Q48mdfcD7NrlkH41sDP872ZLK3kQ6A/La0oLdz N/nWQNm4qp3BwF0rUjBHweLGaHBo5YSKNXyXmXOFpZq+DUzFrCW1CF9Rrirt/V/OupzE TR3YOJFMX8rWr6Db9YXnGOuFmDPqahYZ3hL8Eg7lRN22b35pHUrKad/GCiI5w5GpuKpl RL4uY2pG1zJx34Tk+AOdnOdE9SMGmyeAe654YFEUQXu5XIRQypfyEhe8ou1VWpfFre5u O4IaB/0K5LNoVcNXhAvCenRClGilJTQC4SwO8gbQ8l2BlWp8TfHllsEHhSyo/sknCajE CgAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KZcmA2f4; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p27si16162188pgb.364.2019.04.30.02.10.23; Tue, 30 Apr 2019 02:10:40 -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=@gmail.com header.s=20161025 header.b=KZcmA2f4; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726811AbfD3JI5 (ORCPT + 99 others); Tue, 30 Apr 2019 05:08:57 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:42838 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726262AbfD3JI4 (ORCPT ); Tue, 30 Apr 2019 05:08:56 -0400 Received: by mail-qk1-f195.google.com with SMTP id c190so7674263qke.9; Tue, 30 Apr 2019 02:08:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LqvnYPQ4d9M13B73C2lxCghPlB6ymNoLCZdoFF0EvzU=; b=KZcmA2f4niqqeByEknlgvYCwFcNZ9VP/keiX4wNYO4YWPJhWEv5DbpN4SSJDP1ZgkW fC75jxAiWjQ7tuRjtsR8bAl1a3KRebWwST0xV9C744PnN3EApN4vKEhjJB7MmAV4Y06x Cw8GL4ez5HaU+RtoYR0CfNIZLRhZk8GSP1zBXc3W8zCjGSSydlZdoaxc8/Ob/YvW6/n1 iE4pAW0LmBkb40Gy+gRyAU34G4RkQ1ZThBZzOc2M7OKDzSKrrwKo8xU5aM4FCI7GzTwg GsyiiOB/21Kt7cwbq4QFavJ5uds8u8VaX1mWTr2Yet7d0VChfLKNiJgkcr230zBACriY pV9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LqvnYPQ4d9M13B73C2lxCghPlB6ymNoLCZdoFF0EvzU=; b=GojE6XBEY2rP8JfG77+XSNKwv+cdxdn/YXKJpoK4pzNVJ558meA1HCCwBid5YETzri EH9pJZY/y76gAs5aYP0Q3ycAbNOJ24oBjettwkB9KWQbVtlHKKMheFZBvCLeFCyJYphs 5PEwMrtGuvQAkfKRd0gRx5qLKcZ32xdbGXIuM5ocmEkyJCQ7prCisQX2pOBRzxyMeQHa gQOxc17WqCAkiud/VebWS1lrbabvKJLR48PLYm7x2rZNouUb28Iz5Ue7CSV9giIzvh2o V3GM9/nB8qvbPer1cMvLY7vSrkpUNPChAf9tzf263qJfACFvqZxa7fFJ956XxH87go2z YeCg== X-Gm-Message-State: APjAAAX//3WRRaajd52z4H4AkIpVbFVPaXMJov5cFo1v2Xkn+JSxUENH JMQkBxZUxa3DeVxuv5IUus97FytERy1aS7huchT7sEKPYeY= X-Received: by 2002:a37:6557:: with SMTP id z84mr24988121qkb.221.1556615334948; Tue, 30 Apr 2019 02:08:54 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <20190430082332.GB2677@hirez.programming.kicks-ass.net> From: "Yan, Zheng" Date: Tue, 30 Apr 2019 17:08:43 +0800 Message-ID: Subject: Re: [PATCH 4/5] ceph: fix improper use of smp_mb__before_atomic() To: Peter Zijlstra Cc: Andrea Parri , Linux Kernel Mailing List , stable@vger.kernel.org, "Yan, Zheng" , Sage Weil , Ilya Dryomov , ceph-devel 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 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. > > + smp_mb(); > > > atomic64_set(&ci->i_complete_seq[0], release_count); > > atomic64_set(&ci->i_complete_seq[1], ordered_count); > > } > > -- > > 2.7.4 > >