Re: socket splice task

2016-08-24 Thread Ted Unangst
Alexander Bluhm wrote: > Several possible solutions like letting tasks sleep at a different > priority or changing kernel threads to user priority have been > discussed. There was no consensus what to do. > > To move forward and uncouple the splicing improvement from the > scheduler discussion, I

Re: socket splice task

2016-08-24 Thread Alexander Bluhm
On Fri, Jul 29, 2016 at 08:07:14PM -0400, Ted Unangst wrote: > Alexander Bluhm wrote: > > On Fri, Jul 29, 2016 at 06:46:52PM -0400, Ted Unangst wrote: > > > Alexander Bluhm wrote: > > > > + /* Avoid user land starvation. */ > > > > + yield(); > > > > > > you don't need to yield here, t

Re: socket splice task

2016-08-11 Thread Alexander Bluhm
On Mon, Aug 08, 2016 at 04:04:33PM +0200, Alexander Bluhm wrote: > On Mon, Aug 08, 2016 at 12:17:30PM +0200, Martin Pieuchot wrote: > > On 07/30/16 02:41, Alexander Bluhm wrote: > > Are you sure it is not set? Or does the scheduler keeps selecting your > > task? > > After some printf debugging I

Re: socket splice task

2016-08-08 Thread Alexander Bluhm
On Mon, Aug 08, 2016 at 11:52:58AM +0200, Martin Pieuchot wrote: > On 07/30/16 00:17, Alexander Bluhm wrote: > > 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 giv

Re: socket splice task

2016-08-08 Thread Alexander Bluhm
On Mon, Aug 08, 2016 at 12:17:30PM +0200, Martin Pieuchot wrote: > On 07/30/16 02:41, Alexander Bluhm wrote: > Are you sure it is not set? Or does the scheduler keeps selecting your > task? After some printf debugging I can say that it is not set. The scheduler is switching between softnet and s

Re: socket splice task

2016-08-08 Thread Mark Kettenis
> From: Martin Pieuchot > Date: Mon, 8 Aug 2016 12:17:30 +0200 > > On 07/30/16 02:41, Alexander Bluhm wrote: > > On Fri, Jul 29, 2016 at 08:07:14PM -0400, Ted Unangst wrote: > >> There's a sched_yield() in taskq_thread(). Something's not quite right. > > > > It is a sched_pause() in taskq_thread

Re: socket splice task

2016-08-08 Thread Martin Pieuchot
On 07/30/16 02:41, Alexander Bluhm wrote: > On Fri, Jul 29, 2016 at 08:07:14PM -0400, Ted Unangst wrote: >> There's a sched_yield() in taskq_thread(). Something's not quite right. > > It is a sched_pause() in taskq_thread(). > > If I replace my yield() with sched_pause(), the userland hangs > dur

Re: socket splice task

2016-08-08 Thread Martin Pieuchot
On 07/30/16 01:09, Alexander Bluhm wrote: > On Fri, Jul 29, 2016 at 06:46:52PM -0400, Ted Unangst wrote: >> Alexander Bluhm wrote: >>> + /* Avoid user land starvation. */ >>> + yield(); >> >> you don't need to yield here, the task framework should do that for you. > > Perhaps the framework sho

Re: socket splice task

2016-08-08 Thread Martin Pieuchot
On 07/30/16 00:17, 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()

Re: socket splice task

2016-07-29 Thread Alexander Bluhm
On Fri, Jul 29, 2016 at 08:07:14PM -0400, Ted Unangst wrote: > There's a sched_yield() in taskq_thread(). Something's not quite right. It is a sched_pause() in taskq_thread(). If I replace my yield() with sched_pause(), the userland hangs during splicing. Looks like SPCF_SHOULDYIELD is not set.

Re: socket splice task

2016-07-29 Thread Ted Unangst
Alexander Bluhm wrote: > On Fri, Jul 29, 2016 at 06:46:52PM -0400, Ted Unangst wrote: > > Alexander Bluhm wrote: > > > + /* Avoid user land starvation. */ > > > + yield(); > > > > you don't need to yield here, the task framework should do that for you. > > Perhaps the framework should do that, bu

Re: socket splice task

2016-07-29 Thread Alexander Bluhm
On Fri, Jul 29, 2016 at 06:46:52PM -0400, Ted Unangst wrote: > Alexander Bluhm wrote: > > + /* Avoid user land starvation. */ > > + yield(); > > you don't need to yield here, the task framework should do that for you. Perhaps the framework should do that, but it does not. When I run my splic

Re: socket splice task

2016-07-29 Thread Ted Unangst
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 oft

socket splice task

2016-07-29 Thread Alexander Bluhm
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? bl