Skip to contentSkip to conversation

GFS2: Remove unnecessary memory barrier

PATCH New Bob Peterson 2 participants 2 messages Jul 25, 2013 – Sep 4, 2013 1 message not in the archive GFS2 file system

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 GFS2: Remove unnecessary memory barrier

In reply to a message not in the archive

Hi,

Function test_and_clear_bit implies a memory barrier, so subsequent memory barriers are unnecessary.

Regards,

Bob Peterson
Red Hat File Systems

---

fs/gfs2/glock.c +0 -1
index 9435384..a45b1e0 100644
@@ -1411,7 +1411,6 @@ __acquires(&lru_lock)
 		if (demote_ok(gl))
 			handle_callback(gl, LM_ST_UNLOCKED, 0, false);
 		WARN_ON(!test_and_clear_bit(GLF_LOCK, &gl->gl_flags));
-		smp_mb__after_clear_bit();
 		if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0)
 			gfs2_glock_put_nolock(gl);
 		spin_unlock(&gl->gl_spin);
#2 lore raw

PATCH 1/1 GFS2: Remove unnecessary memory barrier

Hi,

Quoted 10 lines · Bob Peterson

Hi,

Function test_and_clear_bit implies a memory barrier, so subsequent memory barriers are unnecessary.

Regards,

Bob Peterson
Red Hat File Systems

Now in the -nmw tree. Thanks,

Steve.

Quoted 15 lines

---

fs/gfs2/glock.c +0 -1
index 9435384..a45b1e0 100644
@@ -1411,7 +1411,6 @@ __acquires(&lru_lock)
 		if (demote_ok(gl))
 			handle_callback(gl, LM_ST_UNLOCKED, 0, false);
 		WARN_ON(!test_and_clear_bit(GLF_LOCK, &gl->gl_flags));
-		smp_mb__after_clear_bit();
 		if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0)
 			gfs2_glock_put_nolock(gl);
 		spin_unlock(&gl->gl_spin);