Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4075996yba; Mon, 29 Apr 2019 13:19:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzo7zZgI/ayjLuPlMvzOI6lN0SE6lM0aIB4sWhT/kikQG3Hb8nsV9cAmvjIbmdZkUvlKN/O X-Received: by 2002:a62:424b:: with SMTP id p72mr63689354pfa.167.1556569171765; Mon, 29 Apr 2019 13:19:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556569171; cv=none; d=google.com; s=arc-20160816; b=AaJxMx0O/pR5011SJUbCPV3auR6HXcdiHLXoFcCeqtzSmTRtyG7h5p/JuA3wpMyht2 nALXfk+DH/6qt8cuWgldKwQmV1UaRvpAJbbsiaqsbDA9DPttU1HYfJOi5JtMKOfZCuOi T2AV17WObb0t3jqr3h5w7uDMq/zhQ4h9ajRHxs2XEK4cYpMU9y4IDfWhBcUV2EIkuZeo OViiYOHnMJg8EbzRL0h9TvW4C8DESDsqx79dJ86+u4yv68AeD440ayRPCHS9FPA7+pnd fxDcmzdt/TTiI1ZhVui+ON5n/YExd1gsl/FaAi7zwwO/l1MqKA30PNU495HNX0S3GNzb 0LLg== 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=Tf7MLbuwm8AwySzke/NOZGkPfHj632yqYUtU8HHCGbc=; b=h1oPdaIjIWlmdLSZgRwxYpqfwUGExN4rc3burRyQGH3EQqupdMq8sBFN0hty1ipHOJ PMTzXjxRouHyquXi2jWQVzLc52ynZNCjLbuBjFPyTSFMIIApevdCqklUS/BRH5P+Q5wh Kxv6rghOersGscjCidWdv8nr3iIrMeMDPz+mBfY83AuGcb8JVJSPkBvRMk3tYociqnKv P2Ppn8pdRPxAYzf7Ao9LT0LPxkzTq4d477FkmO6hSRZHYrJkBTAAd2PJoIoJBBT06yoY iQEoSDrz006Iw6GXVNFhMZsWYPdyEOqmTpXirabEMWnJ+KKjYzZxEmEXcv8Erz5B80A9 nrZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lt2JmU9u; 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 4si35768175ple.415.2019.04.29.13.19.16; Mon, 29 Apr 2019 13:19:31 -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=lt2JmU9u; 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 S1729438AbfD2UQE (ORCPT + 99 others); Mon, 29 Apr 2019 16:16:04 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:38047 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729251AbfD2UQD (ORCPT ); Mon, 29 Apr 2019 16:16:03 -0400 Received: by mail-wr1-f68.google.com with SMTP id k16so17885537wrn.5 for ; Mon, 29 Apr 2019 13:16:02 -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=Tf7MLbuwm8AwySzke/NOZGkPfHj632yqYUtU8HHCGbc=; b=lt2JmU9usNLupk17GENygz8xjZEYXly2t8l41TwQCwNB/wXDK7iOj5DEQUmhzdByfb 3mdulYuOjhKIMLP7Y1bb6H6JQDVOLvM3JhAdlgWC53GJQUEAFdK0HN122obTyWFcvnzl p5eaoNHIlJvKwUhaLPWMn5i8SXw1vHRMH0NLE= 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=Tf7MLbuwm8AwySzke/NOZGkPfHj632yqYUtU8HHCGbc=; b=Xej8S8oYJYHd3jM3AuAzP87fO1KrMCTCYhwuD5JZAl2rEh21FgXNT5KG3eBsx1L6wI wmluIYuZpCBN89tr4vmYW6MCaVIHZn+LAkBeLkNZGaTgBz8zwTGXMpX+4UYMJHh9kYFf C4srf2CiC5/2QmKoQhhwaLJ13j04n4hEQxMSaod1Bc8B9a9rNRUef8gMqqeZC4TGUFN4 0CxmhZdSp/Meq5oKw2teMW2wzFxelp49oH2QpVtOxJ8OvcIH/nQwi4iIJD1hkkj5mzue IMCtDcEiTbwoYz6DtImXBQpxV9zWq5p9HRpD9u84WgnVdgY0vApzGg+TAtR+22L/Cn4b 6m8w== X-Gm-Message-State: APjAAAVB0f1mwKVsByQsaW9fiAts8MkipiAi2TlvfWON5NNe+p4e/2US jGIW2VcaFy33lLkZhRqkWCOF9WuLdT8= X-Received: by 2002:adf:df92:: with SMTP id z18mr6962697wrl.213.1556568961502; Mon, 29 Apr 2019 13:16:01 -0700 (PDT) Received: from localhost.localdomain (ip-93-97.sn2.clouditalia.com. [83.211.93.97]) by smtp.gmail.com with ESMTPSA id k6sm22864019wrd.20.2019.04.29.13.16.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Apr 2019 13:16:00 -0700 (PDT) From: Andrea Parri To: linux-kernel@vger.kernel.org Cc: Andrea Parri , stable@vger.kernel.org, Jens Axboe , Omar Sandoval , linux-block@vger.kernel.org Subject: [PATCH 3/5] sbitmap: fix improper use of smp_mb__before_atomic() Date: Mon, 29 Apr 2019 22:14:59 +0200 Message-Id: <1556568902-12464-4-git-send-email-andrea.parri@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556568902-12464-1-git-send-email-andrea.parri@amarulasolutions.com> References: <1556568902-12464-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: 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 Cc: Jens Axboe Cc: Omar Sandoval Cc: linux-block@vger.kernel.org --- lib/sbitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sbitmap.c b/lib/sbitmap.c index 155fe38756ecf..4a7fc4915dfc6 100644 --- a/lib/sbitmap.c +++ b/lib/sbitmap.c @@ -435,7 +435,7 @@ static void sbitmap_queue_update_wake_batch(struct sbitmap_queue *sbq, * 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); } -- 2.7.4