Linux NFS development
 help / color / mirror / Atom feed
From: Aaron Straus <aaron-bYFJunmd+ZV8UrSeD/g0lQ@public.gmane.org>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Hans-Peter Jansen <hpj-2x7n3sizJbFeoWH0uzbU5w@public.gmane.org>,
	linux-kernel@vger.kernel.org,
	Chuck Lever <chuck.lever@oracle.com>, Neil Brown <neilb@suse.de>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [NFS] blocks of zeros (NULLs) in NFS files in kernels >= 2.6.20
Date: Mon, 22 Sep 2008 10:45:26 -0700	[thread overview]
Message-ID: <20080922174525.GF12483@merfinllc.com> (raw)
In-Reply-To: <1222104541.7615.23.camel@localhost>

Hi,

On Sep 22 01:29 PM, Trond Myklebust wrote:
> > Anyway, I agree the new writeout semantics are allowed and possibly
> > saner than the previous writeout path.  The problem is that it is
> > __annoying__ for this use case (log files).
> 
> There is always the option of using syslog.

Definitely.  Everything in our control we can work around.... there are
a few applications we cannot easily change... see the follow-up in
another e-mail.

> > I'm not sure if there is an easy solution.  We want the VM to writeout
> > the address space in order.   Maybe we can start the scan for dirty
> > pages at the last page we wrote out i.e. page 0 in the example above?
> 
> You can never guarantee that in a multi-threaded environment.

Definitely.  This is a single writer, single reader case though.

> Two threads may, for instance, force 2 competing fsync() calls: that
> again may cause out-of-order writes.

Yup.

> ...and even if the client doesn't reorder the writes, the _server_ may
> do it, since multiple nfsd threads may race when processing writes to
> the same file.

Yup.  We're definitely not asking for anything like that.

> Anyway, the patch to force a single threaded nfs client to write out the
> data in order is trivial. See attachment...
>
> diff --git a/fs/nfs/write.c b/fs/nfs/write.c
> index 3229e21..eb6b211 100644
> --- a/fs/nfs/write.c
> +++ b/fs/nfs/write.c
> @@ -1428,7 +1428,8 @@ static int nfs_write_mapping(struct address_space *mapping, int how)
>  		.sync_mode = WB_SYNC_NONE,
>  		.nr_to_write = LONG_MAX,
>  		.for_writepages = 1,
> -		.range_cyclic = 1,
> +		.range_start = 0,
> +		.range_end = LLONG_MAX,
>  	};
>  	int ret;
>  

Yeah I was looking at that while debugging.  Would that change have
chance to make it into mainline?  I assume it makes the normal writeout
path more expensive, by forcing a scan of the entire address space.

Also, I should test this, but I thought the VM was calling
nfs_writepages directly i.e. not going through nfs_write_mapping.  Let
me test with this patch.

					Thanks,
					=a=



-- 
===================
Aaron Straus
aaron-bYFJunmd+ZV8UrSeD/g0lQ@public.gmane.org

  reply	other threads:[~2008-09-22 17:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-05 19:19 [NFS] blocks of zeros (NULLs) in NFS files in kernels >= 2.6.20 Aaron Straus
     [not found] ` <20080905191939.GG22796-bYFJunmd+ZV8UrSeD/g0lQ@public.gmane.org>
2008-09-05 19:56   ` Chuck Lever
2008-09-05 20:04     ` Aaron Straus
     [not found]       ` <20080905200455.GH22796-bYFJunmd+ZV8UrSeD/g0lQ@public.gmane.org>
2008-09-05 20:36         ` Chuck Lever
2008-09-05 22:14           ` Aaron Straus
2008-09-06  0:03     ` Aaron Straus
2008-09-08 19:02     ` Aaron Straus
     [not found]       ` <20080908190212.GF28123-bYFJunmd+ZV8UrSeD/g0lQ@public.gmane.org>
2008-09-08 21:15         ` Chuck Lever
     [not found]           ` <76bd70e30809081415h6b55a8dfl8171634c576ac946-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-09-08 22:02             ` Aaron Straus
2008-09-09 19:46             ` Aaron Straus
     [not found]               ` <20080909194644.GI5290-bYFJunmd+ZV8UrSeD/g0lQ@public.gmane.org>
2008-09-11 16:55                 ` Chuck Lever
2008-09-11 17:19                   ` Aaron Straus
     [not found]                     ` <20080911171908.GE12037-bYFJunmd+ZV8UrSeD/g0lQ@public.gmane.org>
2008-09-11 17:48                       ` Chuck Lever
2008-09-11 18:49                         ` Aaron Straus
     [not found]                           ` <20080911184951.GB19054-bYFJunmd+ZV8UrSeD/g0lQ@public.gmane.org>
2008-09-22 16:05                             ` Hans-Peter Jansen
     [not found]                               ` <200809221805.48463.hpj-2x7n3sizJbFeoWH0uzbU5w@public.gmane.org>
2008-09-22 16:35                                 ` Trond Myklebust
2008-09-22 17:04                                   ` Aaron Straus
     [not found]                                     ` <20080922170414.GC12483-bYFJunmd+ZV8UrSeD/g0lQ@public.gmane.org>
2008-09-22 17:26                                       ` Chuck Lever
     [not found]                                         ` <76bd70e30809221026g7bde774pbffa35881682ea4b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-09-22 17:37                                           ` Aaron Straus
2008-09-22 17:29                                       ` Trond Myklebust
2008-09-22 17:45                                         ` Aaron Straus [this message]
     [not found]                                           ` <20080922174525.GF12483-bYFJunmd+ZV8UrSeD/g0lQ@public.gmane.org>
2008-09-22 18:43                                             ` Aaron Straus
2008-09-22 18:45                                             ` Hans-Peter Jansen
2008-09-22 18:45                                   ` Hans-Peter Jansen

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=20080922174525.GF12483@merfinllc.com \
    --to=aaron-byfjunmd+zv8ursed/g0lq@public.gmane.org \
    --cc=chuck.lever@oracle.com \
    --cc=hpj-2x7n3sizJbFeoWH0uzbU5w@public.gmane.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=trond.myklebust@fys.uio.no \
    /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