9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Venkatesh Srinivas <me@endeavour.zapto.org>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] A little more ado about async Tclunk
Date: Wed, 27 Oct 2010 10:48:01 -0400	[thread overview]
Message-ID: <AANLkTimeejf8cabWxtz+8YOKgLyGdQg5EPk55ymBzMDT@mail.gmail.com> (raw)
In-Reply-To: <AANLkTi=WjAo36Vm8qDNYVvy-diVNAW5wRfz2Rcy2OKL3@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3369 bytes --]

First, let me hop up and down and say -- this was me seeing what could be
accomplished in roughly two hours of hacking; this is by-far not the best
(or even a near approximation of) way to accomplish delayed TClunk. There
was no thought given at all to how to handle build-up of files to close or
how to overlap sending TClunks. I do track the peak number of outstanding
files to close; in this simple implementation, which fcp -R 16 -W 16-ing
down the p9 kernel sources, the peak waiting files to close I've seen was
10. I did not try out using more than one clunk process.

brucee solved this ten years ago; I'd love to hear how. Plan 9 has had
delayed close for tearing down fdgrps for nearly 4 years; dual-purposing
that logic to handle this case would be very straightforward.

erik quanstrom wrote:
>
> how do you flow control the clunking processes?  are you using
> qio?  if so, what's the size of the buffer?
>
> also, do you have any test results for different latentices?  how
> about a local network with ~0.5ms rtt and a long distance connection
> at ~150ms?
>
> have you tried this in user space?  one could imagine passing the
> fds to a seperate proc that does the closes without involving the kernel.
>

The clunking process just grabs Chans to close off a list, clunks one at a
time, and then sleeps if the list is empty. Its woken by a defered clunk
call. I tried out a little hysteresis there, to allow it to sleep for longer
but to burst close requests above another threshold, but that was
considerably slower overall than even the default (sync Clunk case). I do
not use qio. There is no limit on the number of outstanding files.

If you'd like to look it over, the main diff is visible at:
http://code.google.com/p/inferno-npe/source/detail?r=09a2e719616e1c842e602485edee9d03020909a6;
plan9 folks will notice a strong similarity to 9/port/chan.c:ccloseq
and
:closeproc.

I do not have tests at different latencies (reliable ones anyway); for
whatever reason, sources.cs.bell-labs.com was varying between 20ms and 300ms
from me yesterday, even in short timespans. The code is very easy to test
though - just grab and build inferno-npe and pass the '-j' flag to mount in
addition to whatever you'd normally use. You can monitor the number of files
waiting to close by reading /dev/vmstat.

I've not tried this in userspace (recently). Wes and I did try it about a
year ago as a side to the Journal Callbacks work; I'd have to look back to
see what the numbers looked like then, but iirc there was a significant
penalty to using our user-wrapper process and rewriting lots of 9p traffic,
though that was one of my first Limbo programs and could massively be
improved upon.

Eric Van Hensbergen wrote:
> More specifically, with the semantic restrictions that VS imposes, are
> their remaining semantic problems when using this with cache-able file
> systems?

All this approach does is delay TClunk messages, generally very little, and
only on files not marked ORCLOSE (perhaps it should also consider OEXCL) and
only on mounts flagged Sys->MCACHE. It would certainly be possible to write
a file server for which this approach is bad, but for the vast majority of
ones, this is a safe optimization. It does not depend on MCACHE caching;
inferno's port/cache.c is just a stub.

-- vs

[-- Attachment #2: Type: text/html, Size: 3846 bytes --]

  reply	other threads:[~2010-10-27 14:48 UTC|newest]

Thread overview: 101+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-27  3:02 Venkatesh Srinivas
2010-10-27  4:23 ` erik quanstrom
2010-10-27  6:27   ` Bruce Ellis
2010-10-27 13:50     ` Charles Forsyth
2010-10-27 13:53       ` Gorka Guardiola
2010-10-27 13:55         ` Francisco J Ballesteros
2010-10-27 14:12         ` John Floren
2010-10-27 14:13       ` Eric Van Hensbergen
2010-10-27 14:48         ` Venkatesh Srinivas [this message]
2010-10-27 15:45           ` erik quanstrom
2010-10-27 15:54             ` Venkatesh Srinivas
2010-10-27 21:04               ` Bruce Ellis
2010-10-28 12:12               ` Charles Forsyth
2010-10-28 13:32                 ` Bruce Ellis
2010-10-28 14:30                 ` Gorka Guardiola
2010-10-28 14:39                   ` Gorka Guardiola
2010-10-28 14:58                     ` erik quanstrom
2010-10-28 14:41                   ` Francisco J Ballesteros
2010-10-28 14:45                     ` Eric Van Hensbergen
2010-10-28 14:56                       ` Francisco J Ballesteros
2010-10-28 15:37                         ` Nathaniel W Filardo
2010-10-28 15:40                           ` erik quanstrom
2010-10-28 15:53                           ` Francisco J Ballesteros
2010-10-28 19:17                             ` Venkatesh Srinivas
2010-10-28 19:24                 ` Venkatesh Srinivas
2010-10-28 20:18                   ` Charles Forsyth
2010-10-28 20:32                     ` Venkatesh Srinivas
2010-10-28 20:55                       ` Nemo
2010-10-28 21:22                         ` Venkatesh Srinivas
2010-10-28 22:17                           ` Francisco J Ballesteros
2010-10-28 23:51                     ` Gorka Guardiola
2010-10-29  5:37                       ` Bruce Ellis
2010-10-29  7:44                         ` Gorka Guardiola
2010-10-29  8:51                           ` Bruce Ellis
2010-10-29  9:01                       ` Charles Forsyth
2010-10-29  8:58                         ` Bruce Ellis
2010-10-29 16:38                           ` Charles Forsyth
2010-10-29  9:45                         ` Gorka Guardiola
2010-10-29  9:56                           ` Bruce Ellis
2010-10-29 16:01                           ` Charles Forsyth
2010-10-29 15:58                             ` Venkatesh Srinivas
2010-10-29 16:02                             ` roger peppe
2010-10-29 16:17                               ` Bruce Ellis
2010-10-29 16:47                                 ` roger peppe
2010-10-29 16:04                           ` Charles Forsyth
2010-10-29 14:14                         ` Eric Van Hensbergen
2010-10-29 15:21                           ` roger peppe
2010-10-29 15:36                             ` erik quanstrom
2010-10-29 15:39                             ` Eric Van Hensbergen
2010-10-29 15:49                             ` Charles Forsyth
2010-10-29 15:50                               ` Eric Van Hensbergen
2010-10-29 15:59                                 ` Bruce Ellis
2010-10-29 16:28                                   ` Venkatesh Srinivas
2010-10-29 17:16                                     ` erik quanstrom
2010-10-29 16:47                               ` David Leimbach
2010-10-29 17:13                                 ` Charles Forsyth
2010-10-29 17:22                                   ` David Leimbach
2010-10-29 17:26                                     ` erik quanstrom
2010-10-29 17:47                                       ` Bruce Ellis
2010-10-29 19:33                                         ` roger peppe
2010-10-29 20:27                                           ` Bruce Ellis
2010-10-29 20:41                                             ` Gorka Guardiola
2010-10-29 20:44                                               ` Bruce Ellis
2010-10-29 22:31                                                 ` Bakul Shah
2010-10-29 22:39                                                 ` roger peppe
2010-10-29 22:43                                                   ` Bruce Ellis
2010-10-29 23:07                                                     ` roger peppe
2010-10-29 23:28                                                       ` Bruce Ellis
2010-10-30  9:08                                                         ` Nemo
2010-10-31  5:39                                                           ` Bruce Ellis
2010-10-31  8:52                                                             ` roger peppe
2010-10-31  8:57                                                               ` Bruce Ellis
2010-10-31 10:25                                                                 ` fgergo
2010-10-31 11:11                                                                   ` fgergo
2010-10-31 11:21                                                                   ` Bruce Ellis
2010-10-31 11:23                                                                 ` roger peppe
2010-10-31 13:06                                                                   ` Gorka Guardiola
2010-10-31 13:07                                                                     ` Gorka Guardiola
2010-10-31 13:22                                                                       ` Gorka Guardiola
2010-11-02 14:29                                                                     ` Richard Miller
2010-10-31 14:21                                                               ` Eric Van Hensbergen
2010-10-31 22:17                                                                 ` Bruce Ellis
2010-10-31 22:32                                                                   ` EBo
2010-10-31 22:41                                                                   ` Steve Simon
2010-11-02 13:49                                                                   ` Richard Miller
2010-11-02 14:02                                                                     ` Eric Van Hensbergen
2010-10-29 18:27                                       ` David Leimbach
2010-10-29 17:18                                 ` Charles Forsyth
2010-10-29 17:17                                   ` erik quanstrom
2010-10-29 17:25                                     ` David Leimbach
2010-10-29 18:03                                   ` Eric Van Hensbergen
2010-10-29 18:54                                   ` Gorka Guardiola
2010-10-29 19:30                                     ` David Leimbach
2010-10-29 20:20                                     ` erik quanstrom
2010-10-29 15:55                         ` Venkatesh Srinivas
2010-10-29 13:12                     ` roger peppe
2010-10-29 13:20                       ` Lucio De Re
2010-10-29 15:51                       ` Charles Forsyth
2010-10-29 16:36                       ` Charles Forsyth
2010-10-27 15:09       ` David Leimbach
2010-10-28 21:39 erik quanstrom

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=AANLkTimeejf8cabWxtz+8YOKgLyGdQg5EPk55ymBzMDT@mail.gmail.com \
    --to=me@endeavour.zapto.org \
    --cc=9fans@9fans.net \
    /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).