9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Francisco J Ballesteros" <nemo@lsub.org>
To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu>
Subject: Re: [9fans] About 9P ...
Date: Sat, 23 Jun 2007 15:36:04 +0200	[thread overview]
Message-ID: <8ccc8ba40706230636r2c75ebc9m46bd28f08ebc1fe7@mail.gmail.com> (raw)
In-Reply-To: <5d375e920706230601t6a0ca365pb532b6b07a874620@mail.gmail.com>

It would be fine to just use the same tag as suggested by Russ ans Sape
if you just happen to have several 9P requests that you know that have
to be issued
to serve a particular call. For example, say you add a library
function (or syscall)
get(),
you could send Twalk tag3 nfid F Topen fid F, Tread fid F, Tread fid F, ....
all with the same tag, without waiting for replies, and the server,
knowning they have
the same tag, would sever Topen, Tread, ... only if Twalk worked. That
would batch
all the requests, as intended.

Now, say you have a program that does:
if (stat(afile)){
   open(afile)
   read(afile)
   close(afile)
}

By the time of the stat you could have read the initial part of the
file along with its
metadata (maybe the entire file!, if it's small). Also, some other
program might be using
the same file, and you'd send the RPCs on its behalf.

If instead of changing the protocol, you use intermediate processes
that do this "caching",
this is what happens:

by the time of the stat, the process does a get (even if it has a
cache entry for the file, to
check for cache validity). That get, retrieves initial data for the file.

Because the entry is known valid, any call to read bytes (and any stat
done by any other
process in the mean time) would be served from the local process, no
further RPCs.

In particular, the open() above would use the entry in the cache and
would not walk to the file again. This does not hurt (much) coherency.
Suppose the file was removed after open,
you cannot tell if what happen is that it was removed after read
(going to the server to do the
read) or what happen is that it was removed after open (and data was
served from the the
data just read during open, or during stat).

As this caching thing changes the semantics quite a bit, it seemed ok
to use the simplest
protocol that we could imagine that would implement such behaviour,
instead of batching
9p requests just to have 9p on the wire.

Note that having two programs <file calls> <-> op  and op <-> styx
means that nobody
but these two programs has to be aware of the new protocol. It's
buried deep in the
bad latency communications link, and everyone else thinks that styx is
the protocol spoken
everywhere.

Again, if anyone sees anything wrong if this approach, even though
it's already implemented
and seems to be working fine, I'd love to find out a better way.



On 6/23/07, Uriel <uriel99@gmail.com> wrote:
> I thought russ (and charles and sape?) proposed a good solutions to
> the latency issues in 9P at IWP9. Actually as far as I can remember it
> was the only change to 9P that was accepted as justified.
>
> My memory is bad, probably got the details wrong but I think there
> were two approaches: one by allowing multiple requests with the same
> tag to be grouped, and another with an extra flag filed that indicates
> if more messages in a group are on their way.
>
> I still don't understand what could be wrong with either approach (but
> again, I don't even remember the details of either) and why nemo had
> to invent yet another protocol. Maybe someone can enlighten my usual
> ignorance.
>
> uriel
>
> On 6/23/07, erik quanstrom <quanstro@coraid.com> wrote:
> > > 9P is just great for use when latency is reasonable (or not too bad,
> > > with cfs), but to go further
> > > away and still be comfortable using remote files, I'd say we need
> > > another protocol.
> > > I'd love to be proved wrong :)
> >
> > are there any protocols that deal well with latency?
> >
> > the only way i know to deal with latency is to do some
> > sort of tagged queueing.  (perhaps i don't know enough
> > computer history.)  unfortunately, this doesn't
> > work if part of the data you need depend on some
> > prior part; a conversation means ping-pong communication.
> >
> > the great news for 9p is that latency is decreasing.  in
> > /sys/doc/net/net.ps, the IL/ether latency is listed as
> > having a latency of 1420µs.  my home fileserver
> > has a 57µs latency to my cpu server. (the fileserver is a
> > pIII with a $19 rtl8169.)
> >
> > even custom Cyclone interface between the file server and
> > the cpu server is listed as having a latency of 375µs.
> >
> > let's hope the same holds true for wireless networking.
> >
> > - erik
> >
>

  reply	other threads:[~2007-06-23 13:36 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-19 20:11 Philippe Anel
2007-06-20  0:37 ` Russ Cox
2007-06-20  2:06   ` Roman Shaposhnick
2007-06-20 11:29     ` Anthony Sorace
2007-06-22  0:32 ` Derek Fawcus
2007-06-22  6:58   ` Philippe Anel
2007-06-22 15:57     ` Derek Fawcus
2007-06-22 20:32       ` Philippe Anel
2007-06-22 21:10         ` David Leimbach
2007-06-22 21:35           ` Philippe Anel
2007-06-22 21:46             ` David Leimbach
2007-06-22 21:55               ` Philippe Anel
2007-06-22 22:25                 ` Philippe Anel
2007-06-22 22:57                   ` David Leimbach
2007-06-22 23:01                     ` Anant Narayanan
2007-06-23  4:30                   ` Russ Cox
2007-06-23  5:10                     ` Skip Tavakkolian
2007-06-23  9:25                       ` Francisco J Ballesteros
2007-06-23 15:50                         ` Martin Atkins
2007-06-23  6:24                     ` Philippe Anel
2007-06-23 15:00                     ` Rob Pike
2007-06-24  0:52                     ` [9fans] 9P optimization Lyndon Nerenberg
2007-06-24  3:04                       ` Francisco J Ballesteros
2007-06-24  3:15                         ` Lyndon Nerenberg
2007-06-24  4:08                           ` ron minnich
2007-06-24  9:34                             ` Steve Simon
2007-06-24 10:06                               ` Lyndon Nerenberg
2007-06-24 11:38                                 ` Steve Simon
2007-06-24 13:34                                   ` Lyndon Nerenberg
2007-06-25  0:34                                     ` ron minnich
2007-06-25 17:53                                       ` Lyndon Nerenberg
2007-06-25  1:02                                 ` Dave Eckhardt
2007-06-24 12:14                             ` erik quanstrom
2007-06-24 13:36                               ` Lyndon Nerenberg
2007-06-24 21:47                                 ` erik quanstrom
2007-06-25 17:48                                   ` Lyndon Nerenberg
2007-06-25 18:46                                     ` erik quanstrom
2007-06-24  4:16                           ` Bruce Ellis
2007-06-24 18:05                             ` Skip Tavakkolian
2007-06-22 23:20               ` [9fans] About 9P Skip Tavakkolian
2007-06-22 23:48                 ` Francisco J Ballesteros
2007-06-23  0:27                   ` Roman Shaposhnick
2007-06-23  0:27                     ` Francisco J Ballesteros
2007-06-23 12:08                   ` erik quanstrom
2007-06-23 12:27                     ` Francisco J Ballesteros
2007-06-23 12:57                     ` Lucio De Re
2007-06-23 13:01                     ` Uriel
2007-06-23 13:36                       ` Francisco J Ballesteros [this message]
2007-06-23 14:27                         ` Lucio De Re
2007-06-23 14:45                           ` Francisco J Ballesteros
2007-06-22 21:16         ` Skip Tavakkolian
2007-06-22 21:37           ` Philippe Anel

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=8ccc8ba40706230636r2c75ebc9m46bd28f08ebc1fe7@mail.gmail.com \
    --to=nemo@lsub.org \
    --cc=9fans@cse.psu.edu \
    /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;
as well as URLs for NNTP newsgroup(s).