Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1609842yba; Thu, 9 May 2019 20:44:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqy9JFVtUNropSvGMLv34+qrCLo1TixVz4CzlVlR1hVASHTw2gupv8E2prcUgyi6ZxNBcx5l X-Received: by 2002:a63:7146:: with SMTP id b6mr4849081pgn.426.1557459870205; Thu, 09 May 2019 20:44:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557459870; cv=none; d=google.com; s=arc-20160816; b=Dqwjyi1Mp9tCPYYdcFdZjV0yjZx/jEiW61NtWOa98ls/6izt/BHILp8jjxhP6jO/VL Ci7TtW89Ng15L18jeqBjibTqBkS336LFvuv4kcl2RNJt8lPnTmbALa4VUBWcSVfScpD6 3PxQNC/d3wQdf7cMVQj/sLi0F6binSAfHg/8HUAwGg136rUTrqFz05N2/kMHRD2ZQO6/ MlmFijdKzWbRVBj+BmPTaotckfguq8wckPpt3MV9NNATzQYtnB9iItNDdP5E7CPEywoi Vff0UktYX6TvpkCEp248D+vxDanF1hsx6azG7ybh5i/C7iY+Y3GFjifLts3HShe3mFDP y3ZA== 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; bh=HSXxUMdL0izBuURdFfmS3MTOJzhWa/1XXbRIxBm9Bhs=; b=xAhutCLlWkwQIJf8+i5izH/KkpD8Kex4Aqx99nz8lAPsxhk4ENBer8/GSvf8oyPGlv hVJ/ehtKGjj8eimfpe+OAwN5lgLvKIqa7bZHflU8C/3YQoEAUIdXBymKu4IQlEFRghMC aDdQYmYKvM1aZHJdUaLUsFCaBh51ZhEf8byqDe3nZWZPSFYPTWA+O4MeR2KuHkD98APF SwwmGDEx4O6d5hPIfUxJnUT/xso8TiqMWTUub/7UzovlmK5Ua7KCTS3XtQ3AJHhhMtZE d7hVCxTH+HOFEympht/w6ZlM/MduA0Bd302aJol8A4ZGFr0prcFSxy9odnajntUFnq2+ ygLA== 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 3si6210352pgy.200.2019.05.09.20.44.14; Thu, 09 May 2019 20:44:30 -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 S1726989AbfEJDkO (ORCPT + 99 others); Thu, 9 May 2019 23:40:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34044 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726882AbfEJDkN (ORCPT ); Thu, 9 May 2019 23:40:13 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D6E863004156; Fri, 10 May 2019 03:40:13 +0000 (UTC) Received: from ming.t460p (ovpn-8-19.pek2.redhat.com [10.72.8.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C05621001E74; Fri, 10 May 2019 03:40:06 +0000 (UTC) Date: Fri, 10 May 2019 11:40:02 +0800 From: Ming Lei 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: <20190510034001.GB27944@ming.t460p> 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.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 10 May 2019 03:40:13 +0000 (UTC) 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(). > > Fixes: dac56212e8127 ("bio: skip atomic inc/dec of ->bi_cnt for most use cases") > Cc: stable@vger.kernel.org > Reported-by: "Paul E. McKenney" > Reported-by: Peter Zijlstra > Signed-off-by: Andrea Parri > Cc: Jens Axboe > Cc: linux-block@vger.kernel.org > --- > include/linux/bio.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/bio.h b/include/linux/bio.h > index e584673c18814..5becbafb84e8a 100644 > --- a/include/linux/bio.h > +++ b/include/linux/bio.h > @@ -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(); > + smp_mb(); > } > atomic_set(&bio->__bi_cnt, count); > } > -- > 2.7.4 > Looks fine, Reviewed-by: Ming Lei Thanks, Ming