Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7463549imu; Thu, 31 Jan 2019 10:30:13 -0800 (PST) X-Google-Smtp-Source: ALg8bN5sNH+2hLon7LXYQ/potnBB02aA+PJqcBxKYQAKfYjp1Rya2fudMyCE+0pN63DdA0xpKTsm X-Received: by 2002:a62:5dd1:: with SMTP id n78mr35294240pfj.58.1548959413575; Thu, 31 Jan 2019 10:30:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548959413; cv=none; d=google.com; s=arc-20160816; b=h16Q68xywjcO/AK6o6Ht2ChOmycthd9xSrgulBxd142NlNcjpGFDy1hPDAzIY8J37Y j5WaipjFBjCab8yel20/R5IrRSlBu/BgHU75Qn6MgwcLZWNIKJjdpRfl2L8rvgRDQbh0 x34kCMbCa17CObI47Ua36lJLl1a2riaUJTGNngdV5cgEbSaWU0hDnirpUYdemNWiB224 +LN+bV0QCWR1nwIbK9sz/E/Uq9C+wFvw+1sK1y1pc73arjt6URz21YUiv/WUYdS9xeOt bAJMGssEnmwa3zMuW6anApwO5keIDOf9AA4GvOMVFrHuYnGY2sLDO4yTONNakZEF6z1N mLmA== 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=3kKnYCZxaOl+LKcbycFNrKujZW9Tg4jDb8LtbcdDLSw=; b=hwENRc8U3a1nOhYHqjsnyWVRABmuatOyLhAHO1YvgLdmEHAZoj6Z2cuqi6lv+2iqMt 8SDJ+ocEQa8DDUecrRQZrUPljmk7uQeg1xuBpir9PC/I+MBkWIX3hXX1YcFjXteGe9K/ 9aweWzD/JjaJlhHhR8oI6quDXOyga6tVwuaBM8LJXNwm5F7DoD3m4qF3I1RYJkaLt4BN XRNC9Z+rChTtKe+f/x8mn64EAs5mP3GwQZapz5D8ejBkS/1ZeETMFA9l/J40H/cKUaln j2qSY9RMPvK/cgxIrv0ujSVzhGS5zWiV/0QsXcg27Cj4HtKjdvAYT4/FFivo6KtPV7ns s67Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=b5GUbtW7; 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 g6si4845315pgn.57.2019.01.31.10.29.58; Thu, 31 Jan 2019 10:30:13 -0800 (PST) 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=b5GUbtW7; 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 S1728285AbfAaSXp (ORCPT + 99 others); Thu, 31 Jan 2019 13:23:45 -0500 Received: from mail-ed1-f68.google.com ([209.85.208.68]:38365 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726455AbfAaSXp (ORCPT ); Thu, 31 Jan 2019 13:23:45 -0500 Received: by mail-ed1-f68.google.com with SMTP id h50so3388826ede.5 for ; Thu, 31 Jan 2019 10:23:44 -0800 (PST) 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=3kKnYCZxaOl+LKcbycFNrKujZW9Tg4jDb8LtbcdDLSw=; b=b5GUbtW7MhAlicI5s0cgkMZ0ZcpEhGZliGBO/xRLBz3mcv59Y+rSyqpGt95Zwd8Cfa nB4b6js3PgMn4oxSLp1TMz6khmPOIuR3MfgKp5L2MwIRw9RBdeZP1rISOY9WX5yz4qRB aR6KhDajLQvKGyR2GwRafxFaAp+IM9AwR60+c= 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=3kKnYCZxaOl+LKcbycFNrKujZW9Tg4jDb8LtbcdDLSw=; b=oozLeANS49cOck6R/6O/9CXWtVNTCSZ9XdEngl7YVKL/Yn663E0VQ2gqlKZznnNK9I qMgg2SP1MF7jjAxGUmtRwJIicggkRzrqnxn39xjK2ytIs1LqpcLN9He1fUk5m/588bOP vEsuJl3GomEoT25GjP1h6gRkXC3nQTp77SqmhvHOUc+Ct4tyuRXNWKkoG7XoB0jNzP4a g80giZEzyqk5yx3qarV2NcLrqpuD6rLaCFqg0CO4E4pn/2xphRpyXOuLyau3QeBos+7l MCGRxhRH8eLYP2a20fxc5fpDnitUCJx1w4Z7n8eBZ6otGOk+sY6tDub8y4Am9Zj4X5BO 5pPg== X-Gm-Message-State: AJcUukfdWa5hT1A29/shYx4yYFjH8UAtYAZsRXgAf6S/Rbx1KvR6GXfk Y9Waxaaj85TDp0GQmA5/PhIoDw== X-Received: by 2002:a50:9291:: with SMTP id k17mr35543939eda.243.1548959023158; Thu, 31 Jan 2019 10:23:43 -0800 (PST) Received: from andrea ([91.253.220.247]) by smtp.gmail.com with ESMTPSA id f31sm1512097eda.16.2019.01.31.10.23.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 Jan 2019 10:23:42 -0800 (PST) Date: Thu, 31 Jan 2019 19:23:34 +0100 From: Andrea Parri To: David Howells Cc: linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] afs: Add missing memory barriers in afs_manage_cell() Message-ID: <20190131182334.GA3847@andrea> References: <20181126164412.11184-1-andrea.parri@amarulasolutions.com> <20190117153132.GA10932@andrea> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190117153132.GA10932@andrea> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 17, 2019 at 04:31:32PM +0100, Andrea Parri wrote: > On Mon, Nov 26, 2018 at 05:44:12PM +0100, Andrea Parri wrote: > > As the comments for wake_up_bit() and waitqueue_active() point out, > > the barriers are needed to order the clearing of the _FL_NOT_READY > > bit and the waitqueue_active() load; match the implicit barrier in > > prepare_to_wait(). > > > > Signed-off-by: Andrea Parri > > Hi David, do you have any feedback on this? ping > > Andrea > > > > --- > > fs/afs/cell.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/fs/afs/cell.c b/fs/afs/cell.c > > index cf445dbd5f2e0..a9488abe56029 100644 > > --- a/fs/afs/cell.c > > +++ b/fs/afs/cell.c > > @@ -637,6 +637,7 @@ static void afs_manage_cell(struct work_struct *work) > > cell->state = AFS_CELL_ACTIVE; > > smp_wmb(); > > clear_bit(AFS_CELL_FL_NOT_READY, &cell->flags); > > + smp_mb__after_atomic(); /* see comment for wake_up_bit() */ > > wake_up_bit(&cell->flags, AFS_CELL_FL_NOT_READY); > > goto again; > > > > @@ -678,6 +679,7 @@ static void afs_manage_cell(struct work_struct *work) > > cell->state = AFS_CELL_ACTIVE; > > smp_wmb(); > > clear_bit(AFS_CELL_FL_NOT_READY, &cell->flags); > > + smp_mb__after_atomic(); /* see comment for wake_up_bit() */ > > wake_up_bit(&cell->flags, AFS_CELL_FL_NOT_READY); > > _leave(" [deact->act]"); > > return; > > -- > > 2.17.1 > >