All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Banks <gnb@sgi.com>
To: Olaf Kirch <okir@suse.de>
Cc: nfs@lists.sourceforge.net
Subject: Re: nfsd write throughput
Date: Tue, 3 Aug 2004 18:28:12 +1000	[thread overview]
Message-ID: <20040803082812.GN5581@sgi.com> (raw)
In-Reply-To: <20040803080913.GC21365@suse.de>

On Tue, Aug 03, 2004 at 10:09:13AM +0200, Olaf Kirch wrote:
> On Tue, Aug 03, 2004 at 05:55:06PM +1000, Greg Banks wrote:
> > I think another useful approach would be to writeback pages which
> > have been written by NFS unstable writes at a faster rate than pages
> > written by local applications, i.e. add a new /proc/vm/ sysctl like
> > nfs_dirty_writeback_centisecs and a per-page flag.
> 
> The problem with this approach is that we have no access to the
> pages. nfsd_write goes through writev.

I understand that the IRIX approach involves passing a special
flag through the equivalent of vfs_writev().  For Linux you
could probably do this with a magic flag in the struct file.
Obviously this is non-trivial.

> > > That may be a useful solution, too. My patch basically does what
> > > fadvise(WONTNEED) does.
> > 
> > Sure, the key question is when and for how many pages.  You don't
> > really have enough information in nfsd_write() to tell that safely.
> 
> Well, for streaming writes "everything we've written so far" is a
> reasonable approximation. Random writes may receive a penalty, I
> admit.

Also reverse writes, and writes of many complete small (too small
to kick in the streaming heuristic) files.  Doing stuff in the page
cache has a better chance of handling those cases.

> > It writes every time `offset' is a multiple of 64 times `cnt' and
> > `cnt' is a multiple of 1024.  At this point `cnt' is the length
> > of the data received in the WRITE call, which has only a vague
> > relationship to the client page size.
> 
> Okay, I should have been more precise: the test tries to make
> sure we're seeing a full wsize worth of data, which is usually a
> good indication of writes being streamed, and tries to lump
> enough of them together to allow the file system to make an
> intelligent decision.

The two problems are:

1.  the heuristic is too simple and can be fooled by a number of
    non-streaming access patterns which won't benefit from the
    early flush.  You could fix this by keeping per-file state
    like the readahead state, but...

2.  even when the heuristic does detect a streaming write it may
    be too early to usefully flush data.

In both cases the page cache has a better chance of getting it right.

> I'm not claiming this is god's wisdom - I'm trying out ideas :)

Sure.

Greg.
-- 
Greg Banks, R&D Software Engineer, SGI Australian Software Group.
I don't speak for SGI.


-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

  reply	other threads:[~2004-08-03  8:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-02 16:24 nfsd write throughput Olaf Kirch
2004-08-03  2:10 ` Greg Banks
2004-08-03  6:02   ` Olaf Kirch
2004-08-03  7:55     ` Greg Banks
2004-08-03  8:09       ` Olaf Kirch
2004-08-03  8:28         ` Greg Banks [this message]
2004-08-03 10:32       ` Olaf Kirch
2004-08-03 10:52         ` Olaf Kirch
2004-08-03 11:24         ` Greg Banks
2004-08-03 13:26           ` Olaf Kirch
2004-08-03  2:23 ` Neil Brown
  -- strict thread matches above, loose matches on Subject: below --
2004-08-04  0:10 Bruce Allan
2004-08-04  8:18 ` Greg Banks

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=20040803082812.GN5581@sgi.com \
    --to=gnb@sgi.com \
    --cc=nfs@lists.sourceforge.net \
    --cc=okir@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.