Alexander Bluhm wrote:
> Hi,
> 
> Spliced TCP sockets become faster if we put the output part into
> its own task thread.  This is inspired by userland copy where we
> also have to go through the scheduler.  This gives the socket buffer
> a chance to be filled up and tcp_output() is called less often and
> with bigger chunks.
> 
> ok?
> +void
> +sotask(void *arg)
> +{
> +     struct socket *so = arg;
> +     int s;
> +
> +     s = splsoftnet();
> +     if (so->so_rcv.sb_flagsintr & SB_SPLICE) {
> +             /*
> +              * We may not sleep here as sofree() and unsplice() may be
> +              * called from softnet interrupt context.  This would remove
> +              * the socket during somove().
> +              */
> +             somove(so, M_DONTWAIT);
> +     }
> +     splx(s);
> +
> +     /* Avoid user land starvation. */
> +     yield();

you don't need to yield here, the task framework should do that for you.

Reply via email to