Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4626602yba; Tue, 30 Apr 2019 01:24:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzxqw+LYx+VGDhwLqg80F1JlpS0ujsgbkUJBVWrb4kSb4ksxLaIQIoS5vw1zCjZGjbHwLiJ X-Received: by 2002:a63:ff04:: with SMTP id k4mr50036464pgi.117.1556612668271; Tue, 30 Apr 2019 01:24:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556612668; cv=none; d=google.com; s=arc-20160816; b=aSbeHLmZd/cEk9hCwUGxi+2gUj/Rqc+BVeAO/EEjIAChDmoAR4A7/OuWUOY6/cp5qm UPBKHLkgS3bFSanRVH3gbvhH/r1pOG9JDiUfB5OB8R09M2vBM7SnVeTtvXc+p+WvRXRP L00JVlzP+ue4rUbyEGfnx871xRCVN27V61ZQ9l/+Rm3P2LFsoiwiFJI81FKMTWXqX7mu XQK4l64vpE2i4fYbFJ5MEZ3hUi1kw4T9mc7CB0K9farm4ZPhzWAHQUv0O8EqHxr1FGoz 0Id/4CIu5KJ1WoNxt6XBgrb/gVpqFIMyMBZSo/z6FtGYsfNG9uEAHO11P0vZYAzxF9vk uc4g== 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=8DM06XtW1FFvD8grPjtHoQFBokiKn/DiGXyZQZQ/fSA=; b=xZGDMZoRQiFBc6WKhjyCW/EICzn9ze94mB5aaBPH+s7nZ/KbwWS9pUg8BN+/Fsd4sM M/Sl7QF8wy0QkIxxLkICrI8PTt5BeDa5jiMRSuEQ2NsoClr/kmD4iHIVWhe3rJzZ9C51 FqrfH0imeymnl33RTKKEEUcpxnxkHt9Il1pVM5Pe7jQs26nYd2m00dEvNh/GxZpEpX7N riudY/yHwl4rlapPzpbu8/W2BUKj92R9z4HRac/HOhLhNvXvm9/ZH3g4uIyEVXR+vgtI BoYB8gILuqVo+7uKBsDgreAOH0V6u/CuL1MhbXcQcowBhYTKAK9MDiVG6tRJqDRjZojn Wreg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=OCxU9UKM; 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 o68si4413700pfo.98.2019.04.30.01.24.13; Tue, 30 Apr 2019 01:24:28 -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=OCxU9UKM; 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 S1726437AbfD3IWD (ORCPT + 99 others); Tue, 30 Apr 2019 04:22:03 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:59850 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725769AbfD3IWC (ORCPT ); Tue, 30 Apr 2019 04:22:02 -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=8DM06XtW1FFvD8grPjtHoQFBokiKn/DiGXyZQZQ/fSA=; b=OCxU9UKMhrzSRxfs1nNcuZD00 g2YUxi2+0w8VH36pCz/hU49ND1rAV5JPO3oWb4v0D0w25K33Z3lAmgV4TW6YEbn7b5WhIQocO/9sx 4/Z+63HVgMF50vKrZ6Su49hQ6ZnPNuFnE8IVdiCviWHJ0uabylm7wlLn/hnY9ltlMUuAFDA3ZlJdH a60OOP071vHOPRHOoM+YDpMPUvlt1HdAHLHOgzIKZJ4xYni19bFoITocYVAq7ZsNk02DB3XY35Aod D/8VamynNxLHKK3ukLVgwXdfJlu+8WsT37ktzeWt7zSVsvLyYcD1FCMoiy2XIRGvGqToqxrRtPmow Cqr8ffS7Q==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hLO1Z-0007yk-J0; Tue, 30 Apr 2019 08:22:01 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 504AE29D2D6D6; Tue, 30 Apr 2019 10:21:58 +0200 (CEST) Date: Tue, 30 Apr 2019 10:21:58 +0200 From: Peter Zijlstra To: Andrea Parri Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Jens Axboe , linux-block@vger.kernel.org Subject: Re: [PATCH 2/5] bio: fix improper use of smp_mb__before_atomic() Message-ID: <20190430082158.GA2677@hirez.programming.kicks-ass.net> References: <1556568902-12464-1-git-send-email-andrea.parri@amarulasolutions.com> <1556568902-12464-3-git-send-email-andrea.parri@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1556568902-12464-3-git-send-email-andrea.parri@amarulasolutions.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 29, 2019 at 10:14:58PM +0200, Andrea Parri wrote: > This barrier only applies to the read-modify-write operations; in > particular, it does not apply to the atomic_set() primitive. > > Replace the barrier with an smp_mb(). > @@ -224,7 +224,7 @@ static inline void bio_cnt_set(struct bio *bio, unsigned int count) > { > if (count != 1) { > bio->bi_flags |= (1 << BIO_REFFED); > - smp_mb__before_atomic(); Maybe also add: /* * XXX the comment that explain this barrier goes here */ > + smp_mb(); > } > atomic_set(&bio->__bi_cnt, count); > }