?

Log in

No account? Create an account
splice() - brad's life — LiveJournal [entries|archive|friends|userinfo]
Brad Fitzpatrick

[ website | bradfitz.com ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

splice() [Mar. 30th, 2006|10:38 am]
Brad Fitzpatrick
[Tags|, , , ]
[Current Mood |excitedexcited]

Is anybody else excited about the in-development splice() system call?

I've wanted this for, like, ever.

I need to add support to Sys::Syscall so Perlbal can use it, avoiding copies to/from userspace to/from sockets.
LinkReply

Comments:
[User Picture]From: lisa
2006-03-30 06:46 pm (UTC)

i bet this guy is

(Reply) (Thread)
From: dan_erat
2006-03-31 02:06 am (UTC)

Re: i bet this guy is

I recognize that wall from the house that I grew up in. Never noticed the dude sitting there though.
(Reply) (Parent) (Thread)
(Deleted comment)
[User Picture]From: mart
2006-03-30 07:02 pm (UTC)

Totally.

(Reply) (Thread)
[User Picture]From: ergie
2006-03-30 08:02 pm (UTC)
I dont know what a system cell is, but that's a cool myspace photo icon you're rocking there!
(Reply) (Thread)
[User Picture]From: ydna
2006-03-30 10:12 pm (UTC)
The real question is: are you getting ready to unleash something wicked on LJ fools on Saturday?
(Reply) (Thread)
[User Picture]From: xb95
2006-03-30 11:35 pm (UTC)
It's finally going in? Nice!
(Reply) (Thread)
[User Picture]From: taral
2006-03-31 04:34 am (UTC)
So long as I can specify a non-length to mean "until EOF".
(Reply) (Thread)
[User Picture]From: visions
2006-03-31 05:43 am (UTC)
nanothreads accomplish a similar task even more efficiently dont they? difference being file support I suppose...
(Reply) (Thread)
[User Picture]From: brad
2006-03-31 07:47 pm (UTC)
Huh?

splice lets you do fd->fd copies all in-kernel without copying to/from userspace. What is a nanothread and how does that help?
(Reply) (Parent) (Thread)
[User Picture]From: satiredun
2006-03-31 10:51 pm (UTC)
your userpic is adorable.
(Reply) (Parent) (Thread)
[User Picture]From: visions
2006-04-01 05:11 am (UTC)
nanothreads reduce/eliminate the overhead of copy to/from user/kernel. it is mainly useful in multithreaded applications and for multi-core or hyper threaded kernels.. but i have seen some other interesting uses of it.

anyway, here is one of the many papers on it:
http://www.hpclab.ceid.upatras.gr/publications/hpclab-tr-021298.pdf.gz

(Reply) (Parent) (Thread)
From: billemon
2006-04-01 02:51 am (UTC)
Oh look, kernel support for CopyFile() :)

It's been a long time coming, yes.
(Reply) (Thread)
[User Picture]From: davidphillips
2006-04-01 07:21 pm (UTC)

sendfile

Interesting. Maybe I'm missing something, but it looks like another device-specific version of sendfile(). Why don't they implement a generic sendfilev() that works with any type of descriptor?
(Reply) (Thread)
[User Picture]From: brad
2006-04-01 08:14 pm (UTC)

Re: sendfile

splice is the generic version. They're talking about implementing sendfile now in terms of splice.
(Reply) (Parent) (Thread)
[User Picture]From: dormando
2006-04-06 06:07 pm (UTC)
Thought it was weird you hadn't commented on this, but I missed the post the first time around :)

splice()! Woot!

I'm confused on how to buffer socket data and replay using splice though... Looks like socket -> pipe buffer, pull up to 16 pages (was that limit ever removed?) into the pipe buffer, then -> splice() onto the remote socket. Along with cork/userspace tricks for adding headers.
(Reply) (Thread)
[User Picture]From: brad
2006-04-06 06:10 pm (UTC)
You can't splice from a socket fd to a pipe buffer yet. Eventually they'll have socket to socket, with an implicit pipe buffer. That's when things get really fun.
(Reply) (Parent) (Thread)
[User Picture]From: dormando
2006-04-06 06:27 pm (UTC)
Ahh okay. I had read about the socket to socket coming soon, but no details. Thanks :)
(Reply) (Parent) (Thread)