Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1258787yba; Thu, 9 May 2019 13:26:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5FjQfPruWoTnSByXfSBRxrxkH8hE6zZ/LhCUTzq5qL9qB4gh1bKxAsjsUqPxYfxdfDZzJ X-Received: by 2002:a62:bd14:: with SMTP id a20mr8185796pff.107.1557433561163; Thu, 09 May 2019 13:26:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557433561; cv=none; d=google.com; s=arc-20160816; b=OvT8feh8/LfSZIPHWbHXy1+v2sif0nyXeRzKB6UPcom/6euy/4t3Wuz599jLb2DD2t TgmauvcxbokHFWXfWwhdeKQIQQxFzR3tDhMV9Iw5GQ64DsCEvWJ5q4Kpms2iDvHgrTsC tzuGwOvubGiPo1KMacbgQfAH5soIvXs82/qR+RrBd9Pr1MrW64oq4XwcnjK9qAp9fCCN 77UeD9oixprXjP3pZYbkdlp7QazWJT/2HcD9xGPW8asqLXQAuJU/ifiA2HaftbodLeE2 yHT42mZEVdRBHyPe8wh9ihzSorQay4doFyhpyeBMZBaPNkZC4jaMIRz/NpZ2xKWbHw7w tznw== 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=/YDXEZRxuV2qTjYMaMahCsdsWUVcw9ZKVZqQOKJAZkg=; b=mIGuQw/FUj11oEwTVMt5tPLTJUQnem5ZCqwrM1ODLU2135lMrFkGSz10wiXS1ydQs+ xRpPlPl7FbkW2SORKDJcnFw4YaMVKvFqdGyObtBW6dNle9J/kaU1J+6a6eUdHbIB91PK ZIj8SGS3yathJHB8qSAHqxlLH423RT1I4xH3rgUv8TONKdRet51Kb2cjAiOA3Ynx4AVY h8P80O1bXH+MJMQWsXuBbj2inPWebwMx8OpkSRACUqsDgQ5oauXod08L1lYzHn69F0Dl HgvXMKcU1qIgwI4cqF4EDh/3wnabf9UY0uikQh7i767kvWVPsZuYAFt11fTvNygCMYsx z5Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=CZVn+TGz; 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 az5si4450241plb.111.2019.05.09.13.25.43; Thu, 09 May 2019 13:26:01 -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=@amarulasolutions.com header.s=google header.b=CZVn+TGz; 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 S1726843AbfEIUYP (ORCPT + 99 others); Thu, 9 May 2019 16:24:15 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:54614 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726710AbfEIUYP (ORCPT ); Thu, 9 May 2019 16:24:15 -0400 Received: by mail-wm1-f65.google.com with SMTP id b203so4817030wmb.4 for ; Thu, 09 May 2019 13:24:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/YDXEZRxuV2qTjYMaMahCsdsWUVcw9ZKVZqQOKJAZkg=; b=CZVn+TGzEZMtIh27kvx0ysv8c1EsfTEJr0B5bBHunc28rWQ/IxylXFx+OUzG0ByYEa 7xAFvdOnVDuecY6AasT0bp5/GgQ4d7wTI9YjYhSqIC3uFBL9WY8n/BVmC81g5XsQG7Qg psJqrD8bjDEQYQhK9NxJlgGXmuslwUWti7EhI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=/YDXEZRxuV2qTjYMaMahCsdsWUVcw9ZKVZqQOKJAZkg=; b=ltKlqvFFEef/thmBbFAHHxsqlKaxzvc+jbVcovNlsxM4gWnofsYJXPHNlln8++SNfL FwFRGSxfb7mpXkx2zbC1XE1BR5hVP5a4/cgHX6BusEKwqnVz94Q8E/DIR0roxn3u8/iO sQOCx8WDlaDFjrV3kzmOINXRBIDq7CiqzvNz8qqw3458nKDkgjN5wgvGoOsfrv/HWlUe EQLg0s6j5LbBh3G9H3uN8imo+RDlPGCVU1aQDrL2AIJCrvrUnISafdKWIdCUK7wOmYco Q26+ThYF9ac0hGriOhsRnZ3JjqNSqaxdV6Q7cTcJx3MINvKaS6M1ZvdxyUIClvlpa9qy x/+w== X-Gm-Message-State: APjAAAX88qy0CE7U9N8xeuqYAvy3g170ptSS1h/8u+3axN8HMMqQH7EX i2D/ZTJuijJACUGLWSjfZ6fe7oFTu1qzRQ== X-Received: by 2002:a7b:c00b:: with SMTP id c11mr4035627wmb.23.1557433453504; Thu, 09 May 2019 13:24:13 -0700 (PDT) Received: from andrea ([91.252.228.170]) by smtp.gmail.com with ESMTPSA id t6sm3238636wmt.8.2019.05.09.13.24.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 May 2019 13:24:12 -0700 (PDT) Date: Thu, 9 May 2019 22:23:56 +0200 From: Andrea Parri To: linux-kernel@vger.kernel.org Cc: Jens Axboe , linux-block@vger.kernel.org, "Paul E. McKenney" , Peter Zijlstra Subject: Re: [PATCH 2/5] bio: fix improper use of smp_mb__before_atomic() Message-ID: <20190509202356.GA4097@andrea> 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.5.24 (2015-08-30) 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 Jens: any suggestions to move this patch forward? Thanx, Andrea > --- > 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 >