linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Efficient IPC mechanism on Linux
@ 2003-09-10 18:41 Manfred Spraul
  0 siblings, 0 replies; 66+ messages in thread
From: Manfred Spraul @ 2003-09-10 18:41 UTC (permalink / raw)
  To: Luca Veraldi; +Cc: linux-kernel, Nick Piggin

>
>
>Hi Luca,
>There was a zero-copy pipe implementation floating around a while ago
>I think. Did you have a look at that? IIRC it had advantages and
>disadvantages over regular pipes in performance.
>
It has doesn't have any performance disadvantages over regular pipes.
The problems is that it only helps for lmbench. Real world apps use 
buffered io, which uses PAGE_SIZEd buffers, which mandate certain 
atomicity requirements, which limits the gains that can be achieved.
If someone wants to try it again I can search for my patches.
Actually there are two independant improvements that are possible for 
the pipe code:
- zero-copy. The name is misleading. In reality this does a single copy: 
the sender creates a list of the pages with the data instead of copying 
the data to kernel buffers. The receiver copies from the pages directly 
to user space. The main advantage is that this implementation avoids one 
copy without requiring any tlb flushes. It works with arbitrary aligned 
user space buffers.
- use larger kernel buffers. Linux uses a 4 kB internal buffer. The 
result is a very simple implementation that causes an incredible amount 
of context switches. Larger buffers reduce that. The problem is 
accounting, and avoiding to use too much memory for the pipe buffers. A 
patch without accounting should be somewhere. The BSD unices have larger 
pipe buffers, and a few pipes with huge buffers [perfect for lmbench 
bragging].

Luca: An algorithm that uses page flipping, or requires tlb flushes, 
probably performs bad in real-world scenarios. First you have the cost 
of the tlb flush, then the inter-processor-interrupt to flush all cpus 
on SMP. And if the target app doesn't expect that you use page flipping, 
then you get a page fault [with another tlb flush], to break the COW 
share. OTHO if you redesign the app for page flipping, then it could 
also use sysv shm, and send a short message with a pointer to the shm 
segment.

--
    Manfred


^ permalink raw reply	[flat|nested] 66+ messages in thread
[parent not found: <u9j3.1VB.27@gated-at.bofh.it>]
[parent not found: <fa.h06p421.1s00ojt@ifi.uio.no>]
[parent not found: <F71B37536F3B3D4FA521FEC7FCA17933164A@twinsrv.twinox.se>]
* Re: Efficient IPC mechanism on Linux
@ 2003-09-09 22:15 Luca Veraldi
  0 siblings, 0 replies; 66+ messages in thread
From: Luca Veraldi @ 2003-09-09 22:15 UTC (permalink / raw)
  To: linux-kernel

Ok. The English version of the document is online, now.
I've translated the main part of it.
The address is the same.

For English speaker:
http://web.tiscali.it/lucavera/www/root/ecbm/index.htm 

If You want it in Italian:
http://web.tiscali.it/lucavera/www/root/ecbm/indexIT.htm 

Sorry if You find some typo. Here in Italy it's midnight...


^ permalink raw reply	[flat|nested] 66+ messages in thread
* Re: Efficient IPC mechanism on Linux
@ 2003-09-09 18:59 Luca Veraldi
  0 siblings, 0 replies; 66+ messages in thread
From: Luca Veraldi @ 2003-09-09 18:59 UTC (permalink / raw)
  To: linux-kernel

You're right. When i have a bit of time, i'll translate the page.

The version of the kernel is not so important.
The code is highly portable and little dependent of the internals of kernel.
It only needs some functions that continue to survive in newer versions of
Linux.
I used 2.2.4 only because it was ready-to-use on my machine.

The main purpose of the article was not to present a professional
mechanism that you can download and use into your own applications.

It is only the proof of a fact: Linux IPC Mechanisms
are ***structurally*** inefficient.

Bye.
Luca



^ permalink raw reply	[flat|nested] 66+ messages in thread
* Efficient IPC mechanism on Linux
@ 2003-09-09 17:30 Luca Veraldi
  2003-09-09 21:17 ` Alan Cox
                   ` (3 more replies)
  0 siblings, 4 replies; 66+ messages in thread
From: Luca Veraldi @ 2003-09-09 17:30 UTC (permalink / raw)
  To: linux-kernel

Hi all.
At the web page
http://web.tiscali.it/lucavera/www/root/ecbm/index.htm
You can find the results of my attempt in modifing the linux kernel sources
to implement a new Inter Process Communication mechanism.

It is called ECBM for Efficient Capability-Based Messaging.

In the reading You can also find the comparison of ECBM 
against some other commonly-used Linux IPC primitives 
(such as read/write on pipes or SYS V tools).

The results are quite clear.

Enjoy.
Luca Veraldi


----------------------------------------
Luca Veraldi

Graduate Student of Computer Science
at the University of Pisa

veraldi@cli.di.unipi.it
luca.veraldi@katamail.com
ICQ# 115368178
----------------------------------------

^ permalink raw reply	[flat|nested] 66+ messages in thread

end of thread, other threads:[~2003-09-12 22:39 UTC | newest]

Thread overview: 66+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <E19x3el-0002Fc-Rj@phoenix.hadiko.de>
2003-09-10 12:16 ` Efficient IPC mechanism on Linux Luca Veraldi
2003-09-10 14:53   ` Larry McVoy
2003-09-10 18:41 Manfred Spraul
     [not found] <u9j3.1VB.27@gated-at.bofh.it>
     [not found] ` <u9j3.1VB.29@gated-at.bofh.it>
     [not found]   ` <u9j3.1VB.31@gated-at.bofh.it>
     [not found]     ` <u9j3.1VB.25@gated-at.bofh.it>
     [not found]       ` <ubNY.5Ma.19@gated-at.bofh.it>
     [not found]         ` <uc79.6lg.13@gated-at.bofh.it>
     [not found]           ` <uc7d.6lg.23@gated-at.bofh.it>
     [not found]             ` <uch0.6zx.17@gated-at.bofh.it>
     [not found]               ` <ucqs.6NC.3@gated-at.bofh.it>
     [not found]                 ` <ucqy.6NC.19@gated-at.bofh.it>
     [not found]                   ` <udmB.8eZ.15@gated-at.bofh.it>
     [not found]                     ` <udPF.BD.11@gated-at.bofh.it>
     [not found]                       ` <3F5F37CD.6060808@softhome.net>
2003-09-10 15:28                         ` Luca Veraldi
     [not found] <fa.h06p421.1s00ojt@ifi.uio.no>
     [not found] ` <fa.gc37hsp.34id89@ifi.uio.no>
     [not found]   ` <E19x47V-0002JG-J8@phoenix.hadiko.de>
2003-09-10 12:45     ` Luca Veraldi
     [not found] <F71B37536F3B3D4FA521FEC7FCA17933164A@twinsrv.twinox.se>
2003-09-10 10:36 ` Luca Veraldi
  -- strict thread matches above, loose matches on Subject: below --
2003-09-09 22:15 Luca Veraldi
2003-09-09 18:59 Luca Veraldi
2003-09-09 17:30 Luca Veraldi
2003-09-09 21:17 ` Alan Cox
2003-09-09 21:57   ` Luca Veraldi
2003-09-09 23:11     ` Alan Cox
2003-09-10  9:04       ` Luca Veraldi
2003-09-10 12:56         ` Alan Cox
     [not found] ` <20030909175821.GL16080@Synopsys.COM>
     [not found]   ` <001d01c37703$8edc10e0$36af7450@wssupremo>
     [not found]     ` <20030910064508.GA25795@Synopsys.COM>
2003-09-10  9:18       ` Luca Veraldi
2003-09-10  9:23         ` Arjan van de Ven
2003-09-10  9:40           ` Luca Veraldi
2003-09-10  9:44             ` Arjan van de Ven
2003-09-10 10:09               ` Luca Veraldi
2003-09-10 10:14                 ` Arjan van de Ven
2003-09-10 10:25                   ` Luca Veraldi
2003-09-12 18:41                     ` Timothy Miller
2003-09-12 19:05                       ` Luca Veraldi
2003-09-12 22:37                         ` Alan Cox
2003-09-10 12:50                 ` Alan Cox
2003-09-10 19:16                 ` Shawn
2003-09-10 20:05                 ` Rik van Riel
2003-09-10 12:47             ` Alan Cox
2003-09-10 13:56               ` Luca Veraldi
2003-09-10 15:59                 ` Alan Cox
2003-09-10  9:52           ` Jamie Lokier
2003-09-10 10:07             ` Arjan van de Ven
2003-09-10 10:17               ` Luca Veraldi
2003-09-10 10:37               ` Jamie Lokier
2003-09-10 10:41                 ` Arjan van de Ven
2003-09-10 10:54                   ` Luca Veraldi
2003-09-10 10:54                     ` Arjan van de Ven
2003-09-10 11:16                     ` Nick Piggin
2003-09-10 11:30                       ` Luca Veraldi
2003-09-10 11:44                         ` Nick Piggin
2003-09-10 12:14                           ` Luca Veraldi
2003-09-10 12:42                       ` Alan Cox
2003-09-10 10:11             ` Luca Veraldi
2003-09-10 19:24             ` Pavel Machek
2003-09-10 19:40               ` Jamie Lokier
2003-09-10 21:35                 ` Pavel Machek
2003-09-10 22:06                   ` Jamie Lokier
2003-09-10 11:52         ` Alex Riesen
2003-09-10 12:14           ` Luca Veraldi
2003-09-10 12:11             ` Alex Riesen
2003-09-10 12:29               ` Luca Veraldi
2003-09-10 12:28                 ` Alex Riesen
2003-09-10 12:36                   ` Luca Veraldi
2003-09-10 12:36                     ` Alex Riesen
2003-09-10 13:33                     ` Gábor Lénárt
2003-09-10 14:04                       ` Luca Veraldi
2003-09-10 14:21 ` Stewart Smith
2003-09-10 14:39   ` Luca Veraldi
2003-09-10 16:59 ` Andrea Arcangeli
2003-09-10 17:05   ` Andrea Arcangeli
2003-09-10 17:21     ` Luca Veraldi
2003-09-10 17:41       ` Andrea Arcangeli
2003-09-10 17:39   ` Martin Konold
2003-09-10 18:01     ` Andrea Arcangeli
2003-09-10 18:05       ` Martin Konold
2003-09-10 18:31         ` Chris Friesen

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).