Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1731724yba; Thu, 9 May 2019 23:30:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+5d8AfKFj3WAyjPt1wHekT92tG2gyCaYqbSv6et0I2LDdJmO7bUr+1n6kAAUZyot1r7ei X-Received: by 2002:a17:902:d88b:: with SMTP id b11mr11050013plz.186.1557469813710; Thu, 09 May 2019 23:30:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557469813; cv=none; d=google.com; s=arc-20160816; b=itoA9BL0G4x73WK3AgnvZrR1y2p1LHhWsJ5nZK5LeXrg3XTKynjTxpeH3gsSAduHdl BxtTqLHclAjEqRGw7Ey0XgPvrhahvcy7Y9X/qQwbz9+eF99W9IUYlfVYNWQXsHH8M6p9 +1NX9UdC30P/A6u1+n64wGdyzvBjqHtjzNDxl92fsDxwsYWyIv7Bu6Hm2SlkuJgKc4HN EBl9sh2Gudq8SDZUAHIWRNXwZon/xDq84GZzD2DF+5pMgINhgZ28Be2rzxc+qaS4gtxb cvJtRFs/MtRKjHRi0caJ7hwrBh+lBv4kOuzgHbp46Pn0ggUxTrZCrmHIskvuVZsYY0X/ YpJA== 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=fXoP+f6QC17xzzktncyb1JK9XYTxg2n/Jos+hr8hflY=; b=tOMOXDxf3pKYltGRjIWlG7cvPWjA2Kp+pnA13cQk0ijaMYc2QIzpmlSDSirb+zpL9r SV8RlHEditvDfyfBu0wmLeiIR4ulrlp0ga1dG2gNAoin7lV71Tb3Vk87bR1zhQ8PD2iT kwXgtQUODcaj/flYzZ8AC28kAt/PQbmvjVbmS4QnYMSqK9iKfvFjeW+s7S9CUUWDXHJi zTQB7oBXBchPxy4f86zTMaF4INHIPyzG/pWjkCkySk3M1NGkBX25Icjjb0UE7tDH6Wmt zT18OQlXV6VKNcviRzq4e9UD//8pcmA4Qtpkx2Tynmv5TnIBDqtn9tAQceumq1bOQZzL ElXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=itdBqCoK; 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 z143si74938pfc.38.2019.05.09.23.29.56; Thu, 09 May 2019 23:30:13 -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=itdBqCoK; 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 S1726940AbfEJG3I (ORCPT + 99 others); Fri, 10 May 2019 02:29:08 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:35294 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726823AbfEJG3I (ORCPT ); Fri, 10 May 2019 02:29:08 -0400 Received: by mail-wr1-f67.google.com with SMTP id w12so6271449wrp.2 for ; Thu, 09 May 2019 23:29:07 -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=fXoP+f6QC17xzzktncyb1JK9XYTxg2n/Jos+hr8hflY=; b=itdBqCoK1ajm7GqCEPGxrB4iEYXPleHImyaPAPsZtPsRwoWDRxpDa4NAhAIe/YjORU oqeRSlllHu/LFz4qLzNU/BtIHxQjE+c0XLCAsitWX5oumvzfiN1VN8S2uYdJdes6QkyI JMYBg7Ls0TpcMqP8QlutVJ1FpirHfsqDQd/dA= 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=fXoP+f6QC17xzzktncyb1JK9XYTxg2n/Jos+hr8hflY=; b=uCVThIky88t8BP5BrAQGUuNdyoodPcWmR9cA1Ykgv6fZYRSzvS5lwX7j3JX/wqc/5b I1mkNUYaXhVVX54DNWG7njczdyFMw2ov11ax5wjr4QkGImwP4Wg+LrfxelST/btfjR6c 6Asr13IZFv2E9T9yAwWunMzYTIHMbzE6YxhQ8eZG+SuUz5lJ962Ydwj1eiZ8mnFDFOtj TgETAjLXA7qnjs4V3Aa5La3SSRdGHfOPw5nx8eJ19PJlStUypdd8luKsyf+JWheI5lZd MNYOPn9HBmHwp7FPWEzQWXd9gXRhhnOw1xNEFmGI8hHVrTnJsO6RnAyQy6OUUJMre79W GoCw== X-Gm-Message-State: APjAAAVBc6UltPgbsPsOoNUX9Dl+d/GN+INMQg2CkfbhwbT4NPnt3KjR QXSyjYmM5kBUn34KymhWGja0gw== X-Received: by 2002:adf:cf05:: with SMTP id o5mr6398927wrj.262.1557469746571; Thu, 09 May 2019 23:29:06 -0700 (PDT) Received: from andrea (86.100.broadband17.iol.cz. [109.80.100.86]) by smtp.gmail.com with ESMTPSA id n17sm3750263wrw.77.2019.05.09.23.29.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 May 2019 23:29:05 -0700 (PDT) Date: Fri, 10 May 2019 08:27:27 +0200 From: Andrea Parri To: Ming Lei Cc: linux-kernel@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: <20190510062727.GA4607@andrea> References: <1556568902-12464-1-git-send-email-andrea.parri@amarulasolutions.com> <1556568902-12464-4-git-send-email-andrea.parri@amarulasolutions.com> <20190510034101.GC27944@ming.t460p> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190510034101.GC27944@ming.t460p> 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 Hi Ming, On Fri, May 10, 2019 at 11:41:02AM +0800, Ming Lei wrote: > 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 Thank you for the review(s), Andrea > thanks, > Ming