diff mbox

NFS: Use smp_mb__{before,after}_atomic()

Message ID 1401440815-4227-1-git-send-email-thierry.reding@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Thierry Reding May 30, 2014, 9:06 a.m. UTC
From: Thierry Reding <treding@nvidia.com>

Commit febdbfe8a91c (arch: Prepare for smp_mb__{before,after}_atomic())
deprecated the smp_mb__{before,after}_{atomic,clear}_{dec,inc,bit}*()
functions in favour of the unified smp_mb__{before,after}_atomic().

While at it, convert the smb_mb__before_atomic()/clear_bit() pattern to
the more idiomatic clear_bit_unlock().

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 fs/nfs/pagelist.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Trond Myklebust May 30, 2014, 11:38 a.m. UTC | #1
On Fri, 2014-05-30 at 11:06 +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> Commit febdbfe8a91c (arch: Prepare for smp_mb__{before,after}_atomic())
> deprecated the smp_mb__{before,after}_{atomic,clear}_{dec,inc,bit}*()
> functions in favour of the unified smp_mb__{before,after}_atomic().

Where is this commit? It doesn't seem to have hit upstream yet.
Thierry Reding May 30, 2014, 12:18 p.m. UTC | #2
On Fri, May 30, 2014 at 06:38:10AM -0500, Trond Myklebust wrote:
> On Fri, 2014-05-30 at 11:06 +0200, Thierry Reding wrote:
> > From: Thierry Reding <treding@nvidia.com>
> > 
> > Commit febdbfe8a91c (arch: Prepare for smp_mb__{before,after}_atomic())
> > deprecated the smp_mb__{before,after}_{atomic,clear}_{dec,inc,bit}*()
> > functions in favour of the unified smp_mb__{before,after}_atomic().
> 
> Where is this commit? It doesn't seem to have hit upstream yet.

It's been in linux-next for over 5 weeks now, so I'd expect it to hit
3.16 during the merge window.

Thierry
diff mbox

Patch

diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index 353331969626..c00d4f1de8ef 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -173,9 +173,8 @@  nfs_page_group_unlock(struct nfs_page *req)
 
 	WARN_ON_ONCE(head != head->wb_head);
 
-	smp_mb__before_clear_bit();
-	clear_bit(PG_HEADLOCK, &head->wb_flags);
-	smp_mb__after_clear_bit();
+	clear_bit_unlock(PG_HEADLOCK, &head->wb_flags);
+	smp_mb__after_atomic();
 	wake_up_bit(&head->wb_flags, PG_HEADLOCK);
 }