mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [EXPERIMENT] Add new "flush" option
Date: Sun, 25 Dec 2005 23:23:06 +0900	[thread overview]
Message-ID: <878xu99rxx.fsf@devron.myhome.or.jp> (raw)
In-Reply-To: <20051225041900.38fdcba7.akpm@osdl.org> (Andrew Morton's message of "Sun, 25 Dec 2005 04:19:00 -0800")

Andrew Morton <akpm@osdl.org> writes:

>> +	if (bdi_write_congested(bdi)) {
>> +		mod_timer(&sb->flush_timer, jiffies + (HZ / 10));
>> +		return;
>> +	}
>
> The bdi_write_congested() test probably isn't doing anything useful: it
> only returns true if there's really heavy writeout in progress.  Possibly
> you could look at the disk queue accounting stats, work out how much I/O
> has been happening lately.

Umm... If queue is too busy, we can't flush immediately. So, this code
is delaying flush, and we can wait the more user's request by it, I think.

> However I wonder if all this code would become simpler if we were to just
> tweak writeback_inodes() a bit: if the superblock was mounted with MS_FLUSH
> then temporarily set wbc->sync_mode to WB_SYNC_ALL.
>
> If we do that, the regular wb_kupdate() will sync all the IS_FLUSH
> filesystems for us at dirty_writeback_centisecs intervals.  That's a bit
> less flexible, but probably less code.
>
> (Alternatively, add a new writeback_control.ms_flush_only boolean.  Set
> that, then reuse some of the code in mm/page-writeback.c in some manner).

Yes, but probably we need to change handling of bd_inode (sb->s_bdev).
The buffer_heads seems to be synced via block_super. And DQUOT_SYNC(sb)
may be needed.

I think it will need big change (and cleanup) after all. (That's no
problem itself I think, but, I would need to make more time)

> You abandoned the flush-file-in-release() idea?  That seemed faily neat. 
> What was the thinking here?

I'm still doing it in the following. I thought the other filesystems
may select other flushing strategy on ->release(), so I didn't do it in VFS.

diff -puN fs/fat/file.c~fat_flush-support fs/fat/file.c
--- linux-2.6/fs/fat/file.c~fat_flush-support	2005-12-25 04:58:16.000000000 +0900
+++ linux-2.6-hirofumi/fs/fat/file.c	2005-12-25 04:58:16.000000000 +0900
@@ -119,6 +119,7 @@ struct file_operations fat_file_operatio
 	.writev		= generic_file_writev,
 	.aio_read	= generic_file_aio_read,
 	.aio_write	= generic_file_aio_write,
+	.release	= fs_flush_sync_fdata,
 	.mmap		= generic_file_mmap,
 	.ioctl		= fat_generic_ioctl,
 	.fsync		= file_fsync,
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

  reply	other threads:[~2005-12-25 14:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-24 20:04 OGAWA Hirofumi
2005-12-25 12:19 ` Andrew Morton
2005-12-25 14:23   ` OGAWA Hirofumi [this message]
2005-12-25 23:05     ` Andrew Morton
2005-12-26 16:37       ` OGAWA Hirofumi
2005-12-26 19:00         ` OGAWA Hirofumi
2005-12-25 16:02   ` 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=878xu99rxx.fsf@devron.myhome.or.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=akpm@osdl.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®