Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1260433yba; Thu, 9 May 2019 13:28:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwIYdRbsa2gN5rHbGXjXa30KFQ1i2jqLN/hbqU/v2XmgutS8pF0IEiB/yzTiaOa0FpneiD2 X-Received: by 2002:a62:5a42:: with SMTP id o63mr8626705pfb.170.1557433682341; Thu, 09 May 2019 13:28:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557433682; cv=none; d=google.com; s=arc-20160816; b=JRiYLu1pCBtw2WqTv/OTFhkD+4VwNEiy/XFThYmTYFy/zorWj+CzngKLK+syBJJvnt axjg1fywCtHHUAKGedWaZvo94vyTKZpPJr1Oiil/PHPVyNv4Qs6rw6mgjam16BnfgoEz qhE4MuOI81go8E0Xu6wAU8V7RTpCU9sVA62G8L5KzDtNAnltKNcepcX2LDXend55r0l8 i/OBdiv0RxdyoOZD1rjGagMtXVcDl4YrUUBrGibqYzRzxeUdUpNzlWxraWZjjz8fyhWa aN39BTZY7+DsyXm3a5Puk8h7N9AUzKR0ngD55v+Yte4yoQfZ55EaOecb0QIvlEB94qs4 Nl0w== 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=ihBJ0/fdU1eA6yYjvazr1eutl37ifhuKRklwOcMnkG4=; b=gsglfKJnC0ta+eMv6NdYVzxUYokLJJ3U+WyNyD8pYYc8g8SFWYOLLejb4PUyL4Hy6B PF/RUpepqTGBzYNURrK13AYKb53f7bcsk1P3KUQtni9EyvlqvWAxSuLqQeE7jCNEj0Qw u+7jjfD/puhrFiOsWSVcyLnOqOoTBWyMNCV5UNNS3tbhpKW5dVctDLO3B2l2jP9oEVPz ee+R5WHRXtmoW/C4zCbihVNunvnqoWyaRfaqXDrGPV/MiQFwFBcCFN/d51rhwgaTyYj4 0mx14pVEgfhVfi+aP29aMArnq1whNvzJV4kMBm2+KSDy4XTcLCiqEkaMKTBpTUJkLzCB CaUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JBSSNJBp; 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.27.45; Thu, 09 May 2019 13:28:02 -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=JBSSNJBp; 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 S1726883AbfEIU0a (ORCPT + 99 others); Thu, 9 May 2019 16:26:30 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:33692 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726749AbfEIU0a (ORCPT ); Thu, 9 May 2019 16:26:30 -0400 Received: by mail-wr1-f67.google.com with SMTP id e11so4813119wrs.0 for ; Thu, 09 May 2019 13:26:29 -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=ihBJ0/fdU1eA6yYjvazr1eutl37ifhuKRklwOcMnkG4=; b=JBSSNJBpVQGLa6UlUwTKhug32nXe/y/VfWJV5O8/qVYhD6bzhR9ILlMSFrdIUsmbMT 18o1C8UyKoh8Fyiz9lTbA48JBLHBD+1SxUxpnc7ZzbLY5WUptPYQaGiZlUeWubgoXBTS Qmd47R7IZjPI0APcYUKvXBXuhBFoRak6OnIig= 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=ihBJ0/fdU1eA6yYjvazr1eutl37ifhuKRklwOcMnkG4=; b=Ie3siTeS5MAMv2FEqXZpW2C2G1flmkX6wZEm1cYermM132Rl43ICmLvJYwR9qX41hj QwmD0/VXrHEInYaeScI4r2IOETvFmfSCwmmjyT/xiQZ8RK3Aeqn/+nZ+Kg18FT4RCwEn KCtzF/N/18yJYNSt2gLghLZL+4+jJLYrBSEPWcZWf6kkE225nAw/EawEA5yTYZcfq7DG RvvWvtxnkrf1DLWx/01Zf50Zs0YXgc2u7Me6QAOTVeQQ4OPNjMfOY9XWnmVnT7GEvK67 bmfmHQf58NKGh4wQ3WWhmkZlXs98QfhfcJas5nEXrycYAC2IpDevz8a8NalWBTndPb44 1RLA== X-Gm-Message-State: APjAAAWvhfdWMNDO3BEbNpNA7WaeDXRjn2OgH74JlEGOnJWG++cYhhOu /Nr+ZatRYJofEDo/bFNZMiDFYMKcTFTtcg== X-Received: by 2002:adf:fe49:: with SMTP id m9mr4396113wrs.73.1557433588348; Thu, 09 May 2019 13:26:28 -0700 (PDT) Received: from andrea ([91.252.228.170]) by smtp.gmail.com with ESMTPSA id n15sm3822470wrp.58.2019.05.09.13.26.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 May 2019 13:26:27 -0700 (PDT) Date: Thu, 9 May 2019 22:26:19 +0200 From: Andrea Parri To: linux-kernel@vger.kernel.org Cc: Jens Axboe , Omar Sandoval , linux-block@vger.kernel.org, "Paul E. McKenney" , Peter Zijlstra Subject: Re: [PATCH 3/5] sbitmap: fix improper use of smp_mb__before_atomic() Message-ID: <20190509202619.GA4201@andrea> References: <1556568902-12464-1-git-send-email-andrea.parri@amarulasolutions.com> <1556568902-12464-4-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-4-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:59PM +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: 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 Jens, Omar: any suggestions to move this patch forward? Thanx, Andrea > --- > 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 >