mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH 1/2] block: use DEFINE_WAIT_BIT instead of DEFINE_WAIT for bit wait queue
       [not found] <20200813050552.26856-1-jian.w.wen@oracle.com>
@ 2020-08-21  1:32 ` Jacob Wen
       [not found] ` <20200813050552.26856-2-jian.w.wen@oracle.com>
  1 sibling, 0 replies; 2+ messages in thread
From: Jacob Wen @ 2020-08-21  1:32 UTC (permalink / raw)
  To: linux-fsdevel, linux-kernel, linux-block

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@oracle.com>
> ---
>   fs/block_dev.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/block_dev.c b/fs/block_dev.c
> index 0ae656e022fd..ba4fad08cdaf 100644
> --- a/fs/block_dev.c
> +++ b/fs/block_dev.c
> @@ -1062,12 +1062,12 @@ static int bd_prepare_to_claim(struct block_device *bdev,
>   	/* if claiming is already in progress, wait for it to finish */
>   	if (whole->bd_claiming) {
>   		wait_queue_head_t *wq = bit_waitqueue(&whole->bd_claiming, 0);
> -		DEFINE_WAIT(wait);
> +		DEFINE_WAIT_BIT(wait, &whole->bd_claiming, 0);
>   
> -		prepare_to_wait(wq, &wait, TASK_UNINTERRUPTIBLE);
> +		prepare_to_wait(wq, &wait.wq_entry, TASK_UNINTERRUPTIBLE);
>   		spin_unlock(&bdev_lock);
>   		schedule();
> -		finish_wait(wq, &wait);
> +		finish_wait(wq, &wait.wq_entry);
>   		spin_lock(&bdev_lock);
>   		goto retry;
>   	}

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/2] writeback: use DEFINE_WAIT_BIT instead of DEFINE_WAIT for bit wait queue
       [not found] ` <20200813050552.26856-2-jian.w.wen@oracle.com>
@ 2020-08-21  1:33   ` Jacob Wen
  0 siblings, 0 replies; 2+ messages in thread
From: Jacob Wen @ 2020-08-21  1:33 UTC (permalink / raw)
  To: linux-fsdevel, linux-kernel, linux-block

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@oracle.com>
> ---
>   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);
>   }
>   
>   /*

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-21  1:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200813050552.26856-1-jian.w.wen@oracle.com>
2020-08-21  1:32 ` [PATCH 1/2] block: use DEFINE_WAIT_BIT instead of DEFINE_WAIT for bit wait queue Jacob Wen
     [not found] ` <20200813050552.26856-2-jian.w.wen@oracle.com>
2020-08-21  1:33   ` [PATCH 2/2] writeback: " Jacob Wen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®