Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1609102yba; Thu, 9 May 2019 20:43:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmb+nrVoZUsdxgfKqA+RHYvyqpOlWWpgD5NH+XDSwvl4D03CVJr5zOJtg/ljA7IoBRP2Gl X-Received: by 2002:a63:a1a:: with SMTP id 26mr10485672pgk.11.1557459812173; Thu, 09 May 2019 20:43:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557459812; cv=none; d=google.com; s=arc-20160816; b=S8oEmWCZWKO7e8fIUgX/G8cKLCAwz9AOlcFdKPplVEjjJNeSwzhsi8xqxUa6ZPzjFB GhV8VdQKwpY1N7SlfDzhDKWmNqan+6Noo8wAzRr65q+/k1i3ni+OBoIFbF5yDqZ8KbsX lYTKYrJdz56Ll8xf4oeTiqkluJpUoPc2oqxs/Ul3itmI8X8weGDIwD4TB3DQbZQ4n5yG UqxOGn3ukeyE45OMa8pjXpMQnICdi5/lNH7nIXvasYdGSwP0VqS6FB2giBk8qxPwD1iV 5TZUpUAR7KrWN5U4gWHTXINQWqohavduPTY6OH9ijpUBk/+W9gsUD+uAndklwZwroto7 ybDg== 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; bh=7A1AVrkiPye416owtTFAYHkEzTCIC6WDVzVc1nwj87c=; b=o7yZpLll5QZV+BOAmF1m47XZk1gGXxJgjRcMD3oualMGxgoLP2sc15hv5LmByylhLt xBxZjwnzCRTw+rQqmBQ8zUr2QopcrTbReWjp5uuZHvXQvwAhHaRgVjO3tn1IY7L0bmdZ YFltiEtv4heFxQLLwneZEucRxZA1zewXVqsvTYKiQwZe7abRyRA/tKVe6hCO9PobyIAX SVVp8SIR4UWj1+DOVSS0rB8l6C38uwRqomASaBf3ror4mi1OuyHZfshTRXYFbQPXfGT1 zdH9wZ4APhGVX+0YL4tvdyd94wv2AsRousas0mr9BYUhibsR69CJBXI+Ctchdk0YFziU Syww== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 67si5297108pla.356.2019.05.09.20.43.16; Thu, 09 May 2019 20:43:32 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727033AbfEJDlO (ORCPT + 99 others); Thu, 9 May 2019 23:41:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34182 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726882AbfEJDlO (ORCPT ); Thu, 9 May 2019 23:41:14 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A79E33082E5F; Fri, 10 May 2019 03:41:13 +0000 (UTC) Received: from ming.t460p (ovpn-8-19.pek2.redhat.com [10.72.8.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B12761A267; Fri, 10 May 2019 03:41:07 +0000 (UTC) Date: Fri, 10 May 2019 11:41:02 +0800 From: Ming Lei To: Andrea Parri Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Jens Axboe , Omar Sandoval , linux-block@vger.kernel.org Subject: Re: [PATCH 3/5] sbitmap: fix improper use of smp_mb__before_atomic() Message-ID: <20190510034101.GC27944@ming.t460p> 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.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 10 May 2019 03:41:13 +0000 (UTC) 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 > --- > 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 > sbitmap_queue_update_wake_batch() won't be called in fast path, and the fix is correct too, so: Reviewed-by: Ming Lei thanks, Ming