9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Charles Forsyth <charles.forsyth@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] zero copy & 9p (was Re: PDP11 (Was: Re: what heavy negativity!)
Date: Mon, 15 Oct 2018 17:48:34 +0100	[thread overview]
Message-ID: <CAOw7k5ijD9K2=DMJQ7orO5o=Kzw5KGie-nPfn+Sgk3z8PXdJtA@mail.gmail.com> (raw)
In-Reply-To: <CAFSF3XOWCSMM711i+mTw=qSthxE6-bTOZj4vFBHrC0OHQCEy7Q@mail.gmail.com>

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

It's useful internally in protocol implementation, specifically to avoid
copying in transport protocols (for later retransmission), and the
modifications aren't vast.
A few changes were trickier, often because of small bugs in the original
code. icmp does some odd things i think.

Btw, "zero copy" isn't the right term and I preferred another term that
I've now forgotten. Minimal copying, perhaps.
For one thing, messages can eventually end up being copied to contiguous
blocks for devices without decent scatter-gather DMA.

Messages are a tuple (mutable header stack, immutable slices of immutable
data).
Originally the data was organised as a tree, but nemo suggested using just
an array, so I changed it.
It's important that it's (logically) immutable. Headers are pushed onto and
popped from the header stack, and the current stack top is mutable.

There were new readmsg and writemsg system calls to carry message
structures between kernel and user level.
The message was immutable on writemsg. Between processes in the same
program, message transfers could be done by exchanging pointers into a
shared region.

I'll see if I wrote up some of it. I think there were manual pages for the
Messages replacing Blocks.

My mcs lock implementation was probably more useful, and I use that in my
copy of the kernel known as 9k

Also, NUMA effects are more important in practice on big multicores. Some
of the off-chip delays are brutal.

On Sun, 14 Oct 2018 at 09:50, hiro <23hiro@gmail.com> wrote:

> thanks, this will allow us to know where to look more closely.
>
> On 10/14/18, Francisco J Ballesteros <nemo@lsub.org> wrote:
> > Pure "producer/cosumer" stuff, like sending things through a pipe as
> long as
> > the source didn't need to touch the data ever more.
> > Regarding bugs, I meant "producing bugs" not "fixing bugs", btw.
> >
> >> On 14 Oct 2018, at 09:34, hiro <23hiro@gmail.com> wrote:
> >>
> >> well, finding bugs is always good :)
> >> but since i got curious could you also tell which things exactly got
> >> much faster, so that we know what might be possible?
> >>
> >> On 10/14/18, FJ Ballesteros <nemo@lsub.org> wrote:
> >>> yes. bugs, on my side at least.
> >>> The copy isolates from others.
> >>> But some experiments in nix and in a thing I wrote for leanxcale show
> >>> that
> >>> some things can be much faster.
> >>> It’s fun either way.
> >>>
> >>>> El 13 oct 2018, a las 23:11, hiro <23hiro@gmail.com> escribió:
> >>>>
> >>>> and, did it improve anything noticeably?
> >>>>
> >>>>> On 10/13/18, Charles Forsyth <charles.forsyth@gmail.com> wrote:
> >>>>> I did several versions of one part of zero copy, inspired by several
> >>>>> things
> >>>>> in x-kernel, replacing Blocks by another structure throughout the
> >>>>> network
> >>>>> stacks and kernel, then made messages visible to user level. Nemo did
> >>>>> another part, on his way to Clive
> >>>>>
> >>>>>> On Fri, 12 Oct 2018, 07:05 Ori Bernstein, <ori@eigenstate.org>
> wrote:
> >>>>>>
> >>>>>> On Thu, 11 Oct 2018 13:43:00 -0700, Lyndon Nerenberg
> >>>>>> <lyndon@orthanc.ca>
> >>>>>> wrote:
> >>>>>>
> >>>>>>> Another case to ponder ...   We're handling the incoming I/Q data
> >>>>>>> stream, but need to fan that out to many downstream consumers.  If
> >>>>>>> we already read the data into a page, then flip it to the first
> >>>>>>> consumer, is there a benefit to adding a reference counter to that
> >>>>>>> read-only page and leaving the page live until the counter expires?
> >>>>>>>
> >>>>>>> Hiro clamours for benchmarks.  I agree.  Some basic searches I've
> >>>>>>> done don't show anyone trying this out with P9 (and publishing
> >>>>>>> their results).  Anybody have hints/references to prior work?
> >>>>>>>
> >>>>>>> --lyndon
> >>>>>>>
> >>>>>>
> >>>>>> I don't believe anyone has done the work yet. I'd be interested
> >>>>>> to see what you come up with.
> >>>>>>
> >>>>>>
> >>>>>> --
> >>>>>>   Ori Bernstein
> >>>>>>
> >>>>>>
> >>>>>
> >>>>
> >>>
> >>>
> >>>
> >>
> >
> >
> >
>
>

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

  reply	other threads:[~2018-10-15 16:48 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-10 17:34 [9fans] " cinap_lenrek
2018-10-10 21:54 ` Steven Stallion
2018-10-10 22:26   ` [9fans] zero copy & 9p (was " Bakul Shah
2018-10-10 22:52     ` Steven Stallion
2018-10-11 20:43     ` Lyndon Nerenberg
2018-10-11 22:28       ` hiro
2018-10-12  6:04       ` Ori Bernstein
2018-10-13 18:01         ` Charles Forsyth
2018-10-13 21:11           ` hiro
2018-10-14  5:25             ` FJ Ballesteros
2018-10-14  7:34               ` hiro
2018-10-14  7:38                 ` Francisco J Ballesteros
2018-10-14  8:00                   ` hiro
2018-10-15 16:48                     ` Charles Forsyth [this message]
2018-10-15 17:01                       ` hiro
2018-10-15 17:29                       ` hiro
2018-10-15 23:06                         ` Charles Forsyth
2018-10-16  0:09                       ` erik quanstrom
2018-10-17 18:14                       ` Charles Forsyth
2018-10-10 22:29   ` [9fans] " Kurt H Maier
2018-10-10 22:55     ` Steven Stallion
2018-10-11 11:19       ` Aram Hăvărneanu
2018-10-11  0:26   ` Skip Tavakkolian
2018-10-11  1:03     ` Steven Stallion
2018-10-14  9:46   ` Ole-Hjalmar Kristensen
2018-10-14 10:37     ` hiro
2018-10-14 17:34       ` Ole-Hjalmar Kristensen
2018-10-14 19:17         ` hiro
2018-10-15  9:29         ` Giacomo Tesio
2018-10-10 23:58 [9fans] zero copy & 9p (was " cinap_lenrek
2018-10-11  0:56 ` Dan Cross
2018-10-11  2:26   ` Steven Stallion
2018-10-11  2:30   ` Bakul Shah
2018-10-11  3:20     ` Steven Stallion

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='CAOw7k5ijD9K2=DMJQ7orO5o=Kzw5KGie-nPfn+Sgk3z8PXdJtA@mail.gmail.com' \
    --to=charles.forsyth@gmail.com \
    --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).