mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jacob Wen <jian.w.wen@oracle.com>
To: linux-fsdevel@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-block@vger.kernel.org
Subject: Re: [PATCH 2/2] writeback: use DEFINE_WAIT_BIT instead of DEFINE_WAIT for bit wait queue
Date: Fri, 21 Aug 2020 09:33:09 +0800	[thread overview]
Message-ID: <0137e0a8-e5c4-2ea0-12e7-2d5a19f827c1@oracle.com> (raw)
In-Reply-To: <20200813050552.26856-2-jian.w.wen@oracle.com>

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);
>   }
>   
>   /*

      parent reply	other threads:[~2020-08-21  1:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200813050552.26856-1-jian.w.wen@oracle.com>
2020-08-21  1:32 ` [PATCH 1/2] block: " Jacob Wen
     [not found] ` <20200813050552.26856-2-jian.w.wen@oracle.com>
2020-08-21  1:33   ` Jacob Wen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0137e0a8-e5c4-2ea0-12e7-2d5a19f827c1@oracle.com \
    --to=jian.w.wen@oracle.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®