From: Andrea Parri <andrea.parri@amarulasolutions.com>
To: David Howells <dhowells@redhat.com>
Cc: linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] afs: Add missing memory barriers in afs_manage_cell()
Date: Thu, 17 Jan 2019 16:31:32 +0100 [thread overview]
Message-ID: <20190117153132.GA10932@andrea> (raw)
In-Reply-To: <20181126164412.11184-1-andrea.parri@amarulasolutions.com>
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 <andrea.parri@amarulasolutions.com>
Hi David, do you have any feedback on this?
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
>
next prev parent reply other threads:[~2019-01-17 15:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-26 16:44 [PATCH] afs: Add missing memory barriers in afs_manage_cell() Andrea Parri
2019-01-17 15:31 ` Andrea Parri [this message]
2019-01-31 18:23 ` Andrea Parri
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190117153132.GA10932@andrea \
--to=andrea.parri@amarulasolutions.com \
--cc=dhowells@redhat.com \
--cc=linux-afs@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox