Re: [PATCH 2/2] writeback: use DEFINE_WAIT_BIT instead of DEFINE_WAIT for bit wait queue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Can I have a review?

On 8/13/20 1:05 PM, Jacob Wen wrote:
DEFINE_WAIT_BIT uses wake_bit_function() which is able to avoid
false-wakeups due to possible hash collisions in the bit wait table.

Signed-off-by: Jacob Wen <jian.w.wen@xxxxxxxxxx>
---
  fs/fs-writeback.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index a605c3dddabc..3bf751b33b48 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -1354,16 +1354,16 @@ void inode_wait_for_writeback(struct inode *inode)
  static void inode_sleep_on_writeback(struct inode *inode)
  	__releases(inode->i_lock)
  {
-	DEFINE_WAIT(wait);
+	DEFINE_WAIT_BIT(wait, &inode->i_state, __I_SYNC);
  	wait_queue_head_t *wqh = bit_waitqueue(&inode->i_state, __I_SYNC);
  	int sleep;
- prepare_to_wait(wqh, &wait, TASK_UNINTERRUPTIBLE);
+	prepare_to_wait(wqh, &wait.wq_entry, TASK_UNINTERRUPTIBLE);
  	sleep = inode->i_state & I_SYNC;
  	spin_unlock(&inode->i_lock);
  	if (sleep)
  		schedule();
-	finish_wait(wqh, &wait);
+	finish_wait(wqh, &wait.wq_entry);
  }
/*



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux