Received: by 2002:a17:90a:2044:0:0:0:0 with SMTP id n62csp532396pjc; Mon, 20 May 2019 11:21:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGLRMQ/TxN2OBBuNIWhZdfxyFAIGjqR1UFhTL1nzwNRGE6hUVlfGCnFjNDBAJF1IBJzmIQ X-Received: by 2002:a62:4dc5:: with SMTP id a188mr31017972pfb.8.1558376513417; Mon, 20 May 2019 11:21:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558376513; cv=none; d=google.com; s=arc-20160816; b=PC+DXErRzcb5uALvVOdwBTr7gAONjyLkUsm7RFZsN5ErlWpmcFc9q8PXtKhH327EQt xxdmc8ZGg1sCbrCxAZ6/fyKCWLQVTcARuW0ma2Rue/Pi2aIczw4KOhQon/i4YAsRwJdB wUIbQiG8tAl4UwW1X63A1nfa+i9JuCtzlEMgamNH/OwU6tZBZlI1HcqUP/uWcGLsasPu wMbc4yd9G77lM2FUfE2maEnnIQxzk32N/OGD795SQOB8Ze5Nb0RgnmyNaKySkWIdDTqn 4s0Gcvfl2oojkTQebRCCFIiYAFW/8RyCwBX+HfjgrwNpH9AyhvKv0plte8A9QmAOD2Tq DFfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=8JCGP2keOd1v4ZtvnJIPJLCc79LDgGj6QPJ6XqW4/pQ=; b=pvxLWLrW1GC6YJgGV8Bw/AmEeEoqpfNa1dmkfuxwpx8x+mCAOh14yggLcxkkh3PHhy 9M/WMO9GovZTWdpVzL0u7SjcYl7KlARvF19reTek6hda8H0QuKznsorws8QMtJ6oD9d2 E3Q70QmH5k43u0QzvP+MvCTTR6dgyFnL9+fOHdU+L4dnBMikTjYEjrcVUF8oIXY7SeFQ 2h/3yjoTzJ5R5eZ8k9p9fzUZ5pRy6dVFzpOBNHfh0kKc/0FOkU14dYU0yClEF1nQuPpc aL3YQ9XWIVrYFnfoB21N3IC3Ck0DbfPo2gCz1lHCER+Nhq43axFK7FFHil2wuUKGB0n0 Rbbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=i+tc6wIo; 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 j12si19363192pgg.188.2019.05.20.11.21.38; Mon, 20 May 2019 11:21:53 -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=i+tc6wIo; 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 S2392894AbfETRYn (ORCPT + 99 others); Mon, 20 May 2019 13:24:43 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:51053 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392887AbfETRYm (ORCPT ); Mon, 20 May 2019 13:24:42 -0400 Received: by mail-wm1-f66.google.com with SMTP id f204so180518wme.0 for ; Mon, 20 May 2019 10:24:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8JCGP2keOd1v4ZtvnJIPJLCc79LDgGj6QPJ6XqW4/pQ=; b=i+tc6wIoCAm8Fs2rzTAE6lyMnY10bwE3S7lTIkqJZ4wLp9lZCEZJRBRsM8BrFytdhh LhMP4NBM+t13gVQ+nr5MAL77FdB/RHw847SxYmWgnsV5G8YzL+7g9ryybdRAXx6qXTBL Zx0oYhcnH36ZwuiC+JJg0EMqU8kNiHG7ukSDk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8JCGP2keOd1v4ZtvnJIPJLCc79LDgGj6QPJ6XqW4/pQ=; b=JGvkj/tSw6DMA3DllmLS0Y2pmDJO7hMaSesUq15yn11vN1Qq5oP5CvYDRDOTHBrm9N Ru5+8aZ+jTFppYK1xBr4FKpLnS/lOeEWjXYULSgtefntS/MZziafzukcQJb3PDbGUZaA w9SEXdlfTa0wsN4n0X/Lv9qkZWgbBCNI3jpjP67v+GxYdIuBukkwzt9t5PDlTzJYG76C 6gOi61pAAKjMAA6R8ABC3QyMXy28NTF3dJVLLp/F98y3/dZXUXOyzawYLaOIlf2bdxoY CorgaJUGNGvlnzGNYGmfdYtyOtnXJVQs44+GhWyyBHdTK1oT2lOxSdWtI1nHzaEYwz/h qQiQ== X-Gm-Message-State: APjAAAWBon5MKps/Z5CU8xTibuUABiRMtkZmdt9XPa1Zprn6nBl7rpPq FeXRXZV5DbsPtIbgvGZH6NkJMmc8F9DXlg== X-Received: by 2002:a1c:f50a:: with SMTP id t10mr185633wmh.86.1558373080090; Mon, 20 May 2019 10:24:40 -0700 (PDT) Received: from localhost.localdomain ([91.253.179.221]) by smtp.gmail.com with ESMTPSA id b12sm180021wmg.27.2019.05.20.10.24.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 May 2019 10:24:39 -0700 (PDT) From: Andrea Parri To: linux-kernel@vger.kernel.org Cc: Andrea Parri , stable@vger.kernel.org, Jens Axboe , Ming Lei , linux-block@vger.kernel.org, "Paul E. McKenney" , Peter Zijlstra Subject: [PATCH 2/4] bio: fix improper use of smp_mb__before_atomic() Date: Mon, 20 May 2019 19:23:56 +0200 Message-Id: <1558373038-5611-3-git-send-email-andrea.parri@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1558373038-5611-1-git-send-email-andrea.parri@amarulasolutions.com> References: <1558373038-5611-1-git-send-email-andrea.parri@amarulasolutions.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Ming Lei Cc: Jens Axboe Cc: Ming Lei Cc: linux-block@vger.kernel.org Cc: "Paul E. McKenney" Cc: Peter Zijlstra --- 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 ea73df36529ad..0f23b56826403 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -210,7 +210,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