Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1118076pxa; Thu, 13 Aug 2020 00:32:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFavLpN6SqPQJRj/REyJeit1tqehjmsJKDT0VOQ1ykOa7YG+cM60gtya0Xh+NPj+fpPqxS X-Received: by 2002:a17:906:fa15:: with SMTP id lo21mr3664900ejb.42.1597303935463; Thu, 13 Aug 2020 00:32:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597303935; cv=none; d=google.com; s=arc-20160816; b=nyfcl2Z8Hm4TJqNpQ41RId67I63flzRtSzw2wQr5mOFvL4/CLbqlEXtKZp8Oy4UYvJ vkouOHpBqtfJ5/0amJSRaB0UZ5+K+pkVfTzMz+ldaVzkO6ejfw/8eLYovditzSaSR8s/ ZDHSNGWiK64vap8RHLhR+AbNZyWZekFsKSU0DoqfwN4WBFQTdokzwW51DATR8fHAcb0j GbSTJj1HjgcJuDxzakArNdalpY+kS/QmVPpCCCD7UXV9hwOlPH5ygRggVubxNk9PGupx ENhLmOPfNXnWb5cfh1VKUOW/+HB90OjdmL0E/6W6uLQ+suj3mhavabjq2+mJuTHcE1sK lbUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ajCb1YweODRt8vtNgU7fmlorkYYs90KZ1F0rpuEPtl0=; b=urGuU85WTtY1jEAB5YJrFI3iaCf8ppLWi9ilLdIyqwmA6ybZTIljSWMeaBJWWyvWLn i8d+AUMVM24OJ/bLThtzT2XRtBSv4HLLgz7VwIh7Vs8X08gcvVY/2BcbJq2ehzeyxqfV iSgdbbsV4GqA5Zo0oEll15Q9s1nkgWi3zI1e+/IDAfNnKKu5bSDlcRtxjeU2ACMrF/0i WNWPdgVQeZ73Zx7lf181hojHrE6/3ZmF5HC+san8qMreyp3l3FDSilouvtBbIgBiqjxq RwNjl8c3KZlPBh7pNnM64cZC/ulz/0Z5OyChXkZbuPFVQ0b6mkMiy7xoFvbPCNj01ZYG WIJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=YGeTingr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r26si2735811edy.137.2020.08.13.00.31.52; Thu, 13 Aug 2020 00:32:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=YGeTingr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726100AbgHMHbU (ORCPT + 99 others); Thu, 13 Aug 2020 03:31:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726044AbgHMHbU (ORCPT ); Thu, 13 Aug 2020 03:31:20 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 291BCC061757; Thu, 13 Aug 2020 00:31:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ajCb1YweODRt8vtNgU7fmlorkYYs90KZ1F0rpuEPtl0=; b=YGeTingr3glZ1JMMusE7MilLak YI89fMIo2FLGBSdXX9JYBIDTA+JBbbgemHrKTM51+e4gaqUgQylwW6Ii779fE0k0948daKKAI2mHL t6r3HKOoxdEUctwqjLGL0tdfqoa1zbfNg5gLflFt+6j9xBojWz9Eaz8PAi7S78FTGfU/1j4oNnq4j jFnAjhC3driUp+OJ9ybAced0njDwxF8UujHre2BD53vEGAPhtJZqMWIfGGbF4rNFMkJOT3HsZOoUZ 5COFx/sIkzxvnttM7QEXRjlJ2bEI+Q+z0ic/BFsDL9J0FrBmIiXW/E1Q5beEsiq+UsD4e+wyQ1w4r JIfVgb4A==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1k67hj-00049n-W6; Thu, 13 Aug 2020 07:31:16 +0000 Date: Thu, 13 Aug 2020 08:31:15 +0100 From: Christoph Hellwig To: Jacob Wen Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra Subject: Re: [PATCH] block: insert a general SMP memory barrier before wake_up_bit() Message-ID: <20200813073115.GA15436@infradead.org> References: <20200813024438.13170-1-jian.w.wen@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200813024438.13170-1-jian.w.wen@oracle.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 13, 2020 at 10:44:38AM +0800, Jacob Wen wrote: > wake_up_bit() uses waitqueue_active() that needs the explicit smp_mb(). Sounds like the barrier should go into wake_up_bit then.. > > Signed-off-by: Jacob Wen > --- > fs/block_dev.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/fs/block_dev.c b/fs/block_dev.c > index 0ae656e022fd..e74980848a2a 100644 > --- a/fs/block_dev.c > +++ b/fs/block_dev.c > @@ -1175,6 +1175,7 @@ static void bd_clear_claiming(struct block_device *whole, void *holder) > /* tell others that we're done */ > BUG_ON(whole->bd_claiming != holder); > whole->bd_claiming = NULL; > + smp_mb(); > wake_up_bit(&whole->bd_claiming, 0); > } > > -- > 2.17.1 > ---end quoted text---