All of lore.kernel.org
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: "NeilBrown" <neilb@suse.de>
Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
	"Christoph Hellwig" <hch@infradead.org>
Subject: Re: [PATCH v2] FAT: use schedule_timeout_uninterruptible() instead of congestion_wait()
Date: Sat, 11 Dec 2021 17:27:39 +0900	[thread overview]
Message-ID: <87h7bfmtqc.fsf@mail.parknet.co.jp> (raw)
In-Reply-To: <163911016975.9928.6568675782275129@noble.neil.brown.name> (NeilBrown's message of "Fri, 10 Dec 2021 15:22:49 +1100")

"NeilBrown" <neilb@suse.de> writes:

> congestion_wait() in this context is just a sleep - block devices do not
> in general support congestion signalling any more.
>
> The goal here is to wait for any recently written data to get to
> storage.  blkdev_issue_flush() is thought to be too expensive, so
> replace congestion_wait() with an explicit timeout.

If just replace, the following looks better

	set_current_state(TASK_UNINTERRUPTIBLE);
	io_schedule_timeout(HZ/10);

Otherwise,

Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

> Signed-off-by: NeilBrown <neilb@suse.de>
> ---
>  fs/fat/file.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/fat/file.c b/fs/fat/file.c
> index 13855ba49cd9..2321fb3eded5 100644
> --- a/fs/fat/file.c
> +++ b/fs/fat/file.c
> @@ -175,9 +175,9 @@ long fat_generic_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
>  static int fat_file_release(struct inode *inode, struct file *filp)
>  {
>  	if ((filp->f_mode & FMODE_WRITE) &&
> -	     MSDOS_SB(inode->i_sb)->options.flush) {
> +	    MSDOS_SB(inode->i_sb)->options.flush) {
>  		fat_flush_inodes(inode->i_sb, inode, NULL);
> -		congestion_wait(BLK_RW_ASYNC, HZ/10);
> +		schedule_timeout_uninterruptible(HZ/10);
>  	}
>  	return 0;
>  }

-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

  reply	other threads:[~2021-12-11  8:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-17  4:31 [PATCH] FAT: use blkdev_issue_flush() instead of congestion_wait() NeilBrown
2021-11-17 10:52 ` Christoph Hellwig
2021-11-21  9:17 ` OGAWA Hirofumi
2021-11-22  0:51   ` NeilBrown
2021-11-22  5:29     ` OGAWA Hirofumi
2021-12-10  4:21       ` NeilBrown
2021-12-10  4:22         ` [PATCH v2] FAT: use schedule_timeout_uninterruptible() " NeilBrown
2021-12-11  8:27           ` OGAWA Hirofumi [this message]
2021-12-13  2:28             ` NeilBrown
2021-12-13  2:45               ` OGAWA Hirofumi
2021-12-13  2:49                 ` NeilBrown
2021-12-13  3:17                 ` [PATCH v3] FAT: use io_schedule_timeout() " NeilBrown
2021-12-11  8:16         ` [PATCH] FAT: use blkdev_issue_flush() " OGAWA Hirofumi

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=87h7bfmtqc.fsf@mail.parknet.co.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=hch@infradead.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.