[CFT/review] new sendfile(2)

John-Mark Gurney jmg at funkthat.com
Tue Jul 29 23:24:12 UTC 2014


Gleb Smirnoff wrote this message on Thu, May 29, 2014 at 14:20 +0400:
>   One of the approaches we are experimenting with is new sendfile(2)
> implementation, that doesn't block on the I/O done from the file
> descriptor.

I know this is a reply to an old message, but...

How is this different from:
           SF_NODISKIO.  This flag causes any sendfile() call which would
           block on disk I/O to instead return EBUSY.  Busy servers may bene-
           fit by transferring requests that would block to a separate I/O
           worker thread.

>   The patch for review is available at:
> 
> https://phabric.freebsd.org/D102

Not public, so couldn't see the state...

> And for those who prefer email attachments, it is also attached.
> The patch has 3 logically separate changes in itself:
> 
> 1) Split of socket buffer sb_cc field into sb_acc and sb_ccc. Where
> sb_acc stands for "available character count" and sb_ccc is "claimed
> character count". This allows us to write a data to a socket, that is
> not ready yet. The data sits in the socket, consumes its space, and
> keeps itself in the right order with earlier or later writes to socket.
> But it can be send only after it is marked as ready. This change is
> split across many files.

This change really should be split out and possibly committed seperately
after a review by the proper people...

> 2) A new vnode operation: VOP_GETPAGES_ASYNC(). This one lives in sys/vm.
> 
> 3) Actual implementation of new sendfile(2). This one lives in
> kern/uipc_syscalls.c

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."


More information about the freebsd-arch mailing list