提交 54af6233 编写于 作者: N Nick Piggin 提交者: Dave Kleikamp

JFS is missing a memory barrier

JFS is missing a memory barrier needed to close the critical section before
clearing the lock bit. Use lock bitops for this.

unlock_page() has a second barrier after clearing the lock, which is
required because it checks whether the waitqueue is active without locks.
Such a barrier is not required here because the waitqueue spinlock is
always taken (something to think about if performance is an issue).
Signed-off-by: NNick Piggin <npiggin@suse.de>
Signed-off-by: NDave Kleikamp <shaggy@linux.vnet.ibm.com>
上级 67e6682f
......@@ -39,11 +39,11 @@ static struct {
#endif
#define metapage_locked(mp) test_bit(META_locked, &(mp)->flag)
#define trylock_metapage(mp) test_and_set_bit(META_locked, &(mp)->flag)
#define trylock_metapage(mp) test_and_set_bit_lock(META_locked, &(mp)->flag)
static inline void unlock_metapage(struct metapage *mp)
{
clear_bit(META_locked, &mp->flag);
clear_bit_unlock(META_locked, &mp->flag);
wake_up(&mp->wait);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册