All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <mason@suse.com>
To: Andrew Morton <akpm@osdl.org>
Cc: col-pepper@piments.com, linux-kernel@vger.kernel.org
Subject: Re: o_sync in vfat driver
Date: Tue, 28 Feb 2006 14:48:55 -0500	[thread overview]
Message-ID: <200602281448.56666.mason@suse.com> (raw)
In-Reply-To: <20060228111032.559e849b.akpm@osdl.org>

On Tuesday 28 February 2006 14:10, Andrew Morton wrote:

> On a single line, please.
>
Ack.

> > +	if (MSDOS_SB(inode->i_sb)->options.flush) {
>
> Did you consider making `-o flush' a generic mount option rather than
> msdos-only?

Yes, long term I think the generic option is better.  I have three or so ideas 
for a generic patch:

1) When the block device leaves congestion, it asks for more io
2) pdflush operation that tries to constantly keep a given block device 
congested
3) my current patch aggregated to other filesystems that people want -o flush 
on.

I've made a few stabs at #1, but didn't like the end result.  #2 seems like 
the best choice so far.  If I got it working nicely I would add the generic 
option, otherwise with option #3 it's probably best to keep it per FS.

The main goal for my current patch was to find out if this functionality will 
actually make people happy (so far the beta testers like it).  If the 
complaints are low, it's worth the time to add something generic.

>
> I guess there isn't a lot of demand for this for other filesystems, and
> having an ignored option like this is a bit misleading...
>
> > +void
> > +writeback_inode(struct inode *inode)
> > +{
> > +
> > +	struct address_space *mapping = inode->i_mapping;
> > +	struct writeback_control wbc = {
> > +		.sync_mode = WB_SYNC_NONE,
> > +		.nr_to_write = 0,
> > +	};
> > +	sync_inode(inode, &wbc);
> > +	filemap_fdatawrite(mapping);
>
> I think that filemap_fdatawrite() will be a no-op?

This part is nasty, I want to write all of the file data pages and write the 
inode without waiting on it.  The nr_to_write = 0 will make sure that 
sync_inode only writes the inode, and WB_SYNC_NONE makes sure it does not 
wait for that io to finish.

What I really want is WB_SYNC_NONE in mpage_writepages, but I don't want to 
trigger this code:

        if (wbc->sync_mode == WB_SYNC_NONE) {
                index = mapping->writeback_index; /* Start from prev offset */

So, I use filemap_fdatawrite to make sure all of the data pages get written.  
It's not perfect, but I was going for minimal changes outside of fat.

-chris

  reply	other threads:[~2006-02-28 19:49 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-26 23:08 o_sync in vfat driver col-pepper
2006-02-27  0:51 ` Andrew Morton
2006-02-27 22:19   ` col-pepper
2006-02-27 23:12     ` Andrew Morton
2006-02-28 18:47       ` Chris Mason
2006-02-28 19:10         ` Andrew Morton
2006-02-28 19:48           ` Chris Mason [this message]
     [not found]         ` <87u0aiw6pi.fsf@duaron.myhome.or.jp>
2006-03-01 15:23           ` Chris Mason
     [not found]             ` <87mzg9wst0.fsf@duaron.myhome.or.jp>
2006-03-02 13:45               ` Chris Mason
2006-03-02 14:07                 ` OGAWA Hirofumi
2006-03-02 17:01                   ` Chris Mason
2006-03-02 18:14                     ` OGAWA Hirofumi
2006-03-29  2:13         ` Mathis Ahrens
2006-03-30 17:35           ` col-pepper
2006-02-28  0:52     ` Machida, Hiroyuki
  -- strict thread matches above, loose matches on Subject: below --
2006-02-26 22:55 col-pepper
     [not found] <op.s5cj47sxj68xd1@mail.piments.com>
     [not found] ` <op.s5jpqvwhui3qek@mail.piments.com>
     [not found]   ` <op.s5kxhyzgfx0war@mail.piments.com>
     [not found]     ` <op.s5kx7xhfj68xd1@mail.piments.com>
     [not found]       ` <op.s5kya3t0j68xd1@mail.piments.com>
     [not found]         ` <op.s5ky2dbcj68xd1@mail.piments.com>
     [not found]           ` <op.s5ky71nwj68xd1@mail.piments.com>
     [not found]             ` <op.s5kzao2jj68xd1@mail.piments.com>
2006-02-26 22:50               ` col-pepper
2006-02-27 13:28                 ` Lennart Sorensen
2006-02-27 13:50                   ` Arjan van de Ven
2006-02-27 14:06                     ` Anton Altaparmakov
2006-02-27 14:27                       ` Arjan van de Ven
2006-02-27 14:41                         ` Anton Altaparmakov
2006-02-27 21:04                           ` col-pepper
2006-02-27 21:17                             ` Arjan van de Ven
2006-02-27 23:21                               ` col-pepper
2006-02-27 21:32                             ` linux-os (Dick Johnson)
2006-02-27 23:21                               ` col-pepper
2006-02-28 13:10                                 ` linux-os (Dick Johnson)
2006-02-28 13:52                                   ` Sergei Organov
2006-02-28 15:18                                   ` Lennart Sorensen
2006-02-28 16:16                                     ` linux-os (Dick Johnson)
2006-02-28 17:23                                       ` Sergei Organov
2006-02-28 18:09                                       ` Krzysztof Halasa
2006-02-28 17:16                                   ` col-pepper
2006-02-28 22:38                                 ` Pavel Machek
2006-03-01  4:28                                   ` Kyle Moffett
2006-03-02  8:23                                   ` col-pepper
2006-03-02  8:32                                     ` Pavel Machek
2006-02-28 16:11                             ` Helge Hafting
2006-02-28 22:37                             ` Pavel Machek
2006-02-27 14:26                   ` linux-os (Dick Johnson)
2006-02-27 18:53                     ` Jan Engelhardt

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=200602281448.56666.mason@suse.com \
    --to=mason@suse.com \
    --cc=akpm@osdl.org \
    --cc=col-pepper@piments.com \
    --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 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.