Hi Ken!

On 9 Nov 2006, at 21:21, Ken Hornstein wrote:

Hm, I am wondering if that's a win; that means two extra syscalls.

Here two extra syscalls (a few microseconds nowadays?) can save processing a packet (or more), and incurring network latency (a hundred microseconds
on my Ether).

The syscalls (context switch, a good chunk of cache getting flushed)
add up.  Why do you think pread() and pwrite() were created?  My point
was that the extra syscalls may end up killing the advantage you get
from sendfile() (the Linux sendfile() ... other sendfiles can add
in header data).  But ... that's just thinking out loud.  Maybe it
will be fine.

I'm not a guru, but I think that's not correct. pread/pwrite are there to prevent some races, not to save time. And at least in Linux syscalls are _fast_, because there is no context switch (that term is reserved for the switch between processes, as that is a _lot_ slower than entering/exiting kernel space). That's the whole point of mapping kernel address space into each vm (with proper protection, of course).

A syscall is of the order of 1usec, which is much shorter than the network stack latencies which are being talked about in this thread.

Ciao,
                    Roland

--
TU Muenchen, Physik-Department E18, James-Franck-Str., 85748 Garching
Telefon 089/289-12575; Telefax 089/289-12570
--
CERN office: 892-1-D23 phone: +41 22 7676540 mobile: +41 76 487 4482
--
Any society that would give up a little liberty to gain a little
security will deserve neither and lose both.  - Benjamin Franklin
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GS/CS/M/MU d-(++) s:+ a-> C+++ UL++++ P+++ L+++ E(+) W+ !N K- w--- M + !V Y+
PGP++ t+(++) 5 R+ tv-- b+ DI++ e+++>++++ h---- y+++
------END GEEK CODE BLOCK------


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Attachment: PGP.sig
Description: This is a digitally signed message part

Reply via email to