Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp279029ybi; Wed, 29 May 2019 21:15:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxV52/lkllr0lA8F08tpq0tJd8IDrZqkRnrIAyEXX/zJEshYYneaMo2+sdt3/dLu1GrvS/ X-Received: by 2002:a62:5584:: with SMTP id j126mr1636893pfb.251.1559189725041; Wed, 29 May 2019 21:15:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559189725; cv=none; d=google.com; s=arc-20160816; b=ANPglinX0Pbso1PE8oH/Qomt2daG+SRbigYqt0xQUZuuqW/S0Ydh9jaT3sVE0cKq1D VRle+qKQYcM1VeBfuHU3G8bO/LD400B881oz0QY1LU7pWBEgkg/c3ejudDestlARG8hj t5mcXYmYZjC2Sb6AG8kkfECntgdGS99irlGYztYtqES9OhPqtknnAWU2FZm919PKQInB CNnK3EqGj3CbKHI3sCOQpNYqI3sVEBedrjPXLp2HtDnJnp9ovKmYVGYO//vIDuiO7dLT YXuhbTYvKI6Sp1350ZrFgLB56Z5ubGTFOZHWkh1VtPffM1W+UgBv1vvZVGLJM4Z+P43l zhvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LkBFzqF+hxEMbd9SulrjeyE7jIEdlASIrfbwE2iTMxU=; b=gft/aDtko30lHPfVXhN2cB1DhnT4IYoP/EZ7Dfjx4AM9Pp+tL+AGvBTTiWkIVJxppg usUUP65J4YisNBdAKv/FnIoS34VZuDQ9AkZBjp7QIGhb5cAefyrnStpfiZaongcMxVPo 7cluaLkAjl7/TasAWGWbpbt6Zcohs2VMUqL/R3c+pVc0qYJrDG0uYPgkfnLFEOSgPxpO T5302owg5n8JYcqE15ih5/rCkR0lbXpDeOydO1LbrVTuugjjZUJ577hSPKml8dzOq1PQ 9TjhPC0tEl0jINjK84pi6rTre+vEEAXUrMqz+x+5s882TRd3w7iUNlGgXTJZXmbck8Jx EAkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DX6gHY10; 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 i1si2197997pfd.258.2019.05.29.21.15.08; Wed, 29 May 2019 21:15:25 -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=@kernel.org header.s=default header.b=DX6gHY10; 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 S1730699AbfE3EOL (ORCPT + 99 others); Thu, 30 May 2019 00:14:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:41614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730628AbfE3DQO (ORCPT ); Wed, 29 May 2019 23:16:14 -0400 Received: from localhost (ip67-88-213-2.z213-88-67.customer.algx.net [67.88.213.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D1EE22458C; Thu, 30 May 2019 03:16:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186173; bh=nI/XTBVuAqM8axkiFf/VzEf3Bc+uambo+F/BfG6LJJ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DX6gHY10iCkuSwf0n2bw1Rf2XE48MVQOehV+NSaEgAJGS4Ns+bHYcr7pq7oW9v9Na GC2WMOq1fuN59VdQeYI0YoRBmmzTsLGzLLrWwc7x+lmoxUCSj9jpSJTMjLjg8uSTAm wIwUaCnmCufAbLciI+zdnun59RQ71zf7PhHieutw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Paul E. McKenney" , Peter Zijlstra , Andrea Parri , Ming Lei , Jens Axboe , Omar Sandoval , linux-block@vger.kernel.org Subject: [PATCH 4.19 007/276] sbitmap: fix improper use of smp_mb__before_atomic() Date: Wed, 29 May 2019 20:02:45 -0700 Message-Id: <20190530030523.903699362@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030523.133519668@linuxfoundation.org> References: <20190530030523.133519668@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrea Parri commit a0934fd2b1208458e55fc4b48f55889809fce666 upstream. 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: 6c0ca7ae292ad ("sbitmap: fix wakeup hang after sbq resize") 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: Omar Sandoval Cc: Ming Lei Cc: linux-block@vger.kernel.org Cc: "Paul E. McKenney" Cc: Peter Zijlstra Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- lib/sbitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/lib/sbitmap.c +++ b/lib/sbitmap.c @@ -356,7 +356,7 @@ static void sbitmap_queue_update_wake_ba * to ensure that the batch size is updated before the wait * counts. */ - smp_mb__before_atomic(); + smp_mb(); for (i = 0; i < SBQ_WAIT_QUEUES; i++) atomic_set(&sbq->ws[i].wait_cnt, 1); }