All of lore.kernel.org
 help / color / mirror / Atom feed
From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: Ian McDonald <ian.mcdonald@jandi.co.nz>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
	davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: Netchannles: first stage has been completed. Further ideas.
Date: Fri, 21 Jul 2006 11:26:41 +0400	[thread overview]
Message-ID: <20060721072641.GE5151@2ka.mipt.ru> (raw)
In-Reply-To: <5640c7e00607201440v38911f9ble6dbee9f6725be99@mail.gmail.com>

On Fri, Jul 21, 2006 at 09:40:32AM +1200, Ian McDonald (ian.mcdonald@jandi.co.nz) wrote:
> >If we consider netchannels as how Van Jackobson discribed them, then
> >mutext is not needed, since it is impossible to have several readers or
> >writers. But in socket case even if there is only one userspace
> >consumer, that lock must be held to protect against bh (or introduce
> >several queues and complicate a lot their's management (ucopy for
> >example)).
> >
> As I recall Van's talk you don't need a lock with a ring buffer if you
> have a start and end variable pointing to location within ring buffer.
> 
> He didn't explain this in great depth as it is computer science 101
> but here is how I would explain it:
> 
> Once socket is initialiased consumer is the only one that sets start
> variable and network driver reads this only. It is the other way
> around for the end variable. As long as the writes are atomic then you
> are fine. You only need one ring buffer in this scenario and two
> atomic variables.
> 
> Having atomic writes does have overhead but far less than locking semantic.

With netchannels and one data producer it should not be even atomic.
Problems start to appear when there are several producers or consumers -
there must be implemented either atomic or locking logic indeed.

> -- 
> Ian McDonald
> Web: http://wand.net.nz/~iam4
> Blog: http://imcdnzl.blogspot.com
> WAND Network Research Group
> Department of Computer Science
> University of Waikato
> New Zealand

-- 
	Evgeniy Polyakov

  reply	other threads:[~2006-07-21  7:26 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-18  8:16 Netchannles: first stage has been completed. Further ideas Evgeniy Polyakov
2006-07-18  8:34 ` David Miller
2006-07-18  8:50   ` Evgeniy Polyakov
2006-07-18 11:16 ` Christian Borntraeger
2006-07-18 11:51   ` Evgeniy Polyakov
2006-07-18 12:36     ` Christian Borntraeger
2006-07-18 19:11       ` Evgeniy Polyakov
2006-07-18 21:20         ` David Miller
2006-07-18 12:15 ` Jörn Engel
2006-07-18 19:08   ` Evgeniy Polyakov
2006-07-19 11:00     ` Jörn Engel
2006-07-20  7:42       ` Evgeniy Polyakov
2006-07-18 23:01 ` Alexey Kuznetsov
2006-07-19  0:39   ` David Miller
2006-07-19  5:38   ` Evgeniy Polyakov
2006-07-19  6:30     ` Evgeniy Polyakov
2006-07-19 13:19     ` Alexey Kuznetsov
2006-07-20  7:32       ` Evgeniy Polyakov
2006-07-20 16:41         ` Alexey Kuznetsov
2006-07-20 21:08           ` Evgeniy Polyakov
2006-07-20 21:21             ` Ben Greear
2006-07-21  7:19               ` Evgeniy Polyakov
2006-07-21  7:20                 ` Evgeniy Polyakov
2006-07-21 16:14                 ` Ben Greear
2006-07-21 16:27                   ` Evgeniy Polyakov
2006-07-22 13:23                   ` Caitlin Bestler
2006-07-20 21:40             ` Ian McDonald
2006-07-21  7:26               ` Evgeniy Polyakov [this message]
2006-07-20 22:59             ` Alexey Kuznetsov
2006-07-21  4:55               ` David Miller
2006-07-21  7:10                 ` Evgeniy Polyakov
2006-07-21  7:47                   ` David Miller
2006-07-21  9:06                     ` Evgeniy Polyakov
2006-07-21  9:19                       ` David Miller
2006-07-21  9:39                         ` Evgeniy Polyakov
2006-07-21  9:46                           ` David Miller
2006-07-21  9:55                             ` Evgeniy Polyakov
2006-07-21 16:26                 ` Rick Jones
2006-07-21 20:57                   ` David Miller
2006-07-19 19:52   ` Stephen Hemminger
2006-07-19 20:01     ` David Miller
2006-07-19 20:16       ` Stephen Hemminger
2006-07-24 18:54       ` Stephen Hemminger
2006-07-24 20:52         ` Alexey Kuznetsov
2006-07-27  2:17   ` Rusty Russell
2006-07-27  5:17     ` David Miller
2006-07-27  5:46       ` Rusty Russell
2006-07-27  6:00         ` David Miller
2006-07-27 18:54           ` Stephen Hemminger
2006-07-28  8:21             ` David Miller
2006-07-28  5:54           ` Rusty Russell
2006-08-01  4:47             ` David Miller
2006-08-01  6:36               ` Rusty Russell
2006-07-27 16:33         ` Alexey Kuznetsov
2006-07-27 16:51           ` Evgeniy Polyakov
2006-07-27 20:56             ` Alexey Kuznetsov
2006-07-28  5:17               ` Evgeniy Polyakov
2006-07-28  5:34                 ` David Miller
2006-07-28  5:47                   ` Evgeniy Polyakov
2006-07-28  4:49           ` Rusty Russell

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=20060721072641.GE5151@2ka.mipt.ru \
    --to=johnpol@2ka.mipt.ru \
    --cc=davem@davemloft.net \
    --cc=ian.mcdonald@jandi.co.nz \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=netdev@vger.kernel.org \
    /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.