Re: [PATCH] tcp: splice as many packets as possible at once

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: David Miller <davem@...>
Cc: <ben@...>, <w@...>, <jarkao2@...>, <mingo@...>, <linux-kernel@...>, <netdev@...>, <jens.axboe@...>
Date: Friday, January 9, 2009 - 2:47 am

David Miller a écrit :

I found this patch usefull in my testings, but had a feeling something
was not complete. If the goal is to reduce number of splice() calls,
we also should reduce number of wakeups. If splice() is used in non
blocking mode, nothing we can do here of course, since the application
will use a poll()/select()/epoll() event before calling splice(). A
good setting of SO_RCVLOWAT to (16*PAGE_SIZE)/2 might improve things.

I tested this on current tree and it is not working : we still have
one wakeup for each frame (ethernet link is a 100 Mb/s one)

bind(6, {sa_family=AF_INET, sin_port=htons(4711), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
listen(6, 5)                            = 0
accept(6, 0, NULL)                      = 7
setsockopt(7, SOL_SOCKET, SO_RCVLOWAT, [32768], 4) = 0
poll([{fd=7, events=POLLIN, revents=POLLIN|POLLERR|POLLHUP}], 1, -1) = 1
splice(0x7, 0, 0x4, 0, 0x10000, 0x3)    = 1024
splice(0x3, 0, 0x5, 0, 0x400, 0x5)      = 1024
poll([{fd=7, events=POLLIN, revents=POLLIN|POLLERR|POLLHUP}], 1, -1) = 1
splice(0x7, 0, 0x4, 0, 0x10000, 0x3)    = 1460
splice(0x3, 0, 0x5, 0, 0x5b4, 0x5)      = 1460
poll([{fd=7, events=POLLIN, revents=POLLIN|POLLERR|POLLHUP}], 1, -1) = 1
splice(0x7, 0, 0x4, 0, 0x10000, 0x3)    = 1460
splice(0x3, 0, 0x5, 0, 0x5b4, 0x5)      = 1460
poll([{fd=7, events=POLLIN, revents=POLLIN|POLLERR|POLLHUP}], 1, -1) = 1
splice(0x7, 0, 0x4, 0, 0x10000, 0x3)    = 1460
splice(0x3, 0, 0x5, 0, 0x5b4, 0x5)      = 1460
poll([{fd=7, events=POLLIN, revents=POLLIN|POLLERR|POLLHUP}], 1, -1) = 1
splice(0x7, 0, 0x4, 0, 0x10000, 0x3)    = 1460
splice(0x3, 0, 0x5, 0, 0x5b4, 0x5)      = 1460
poll([{fd=7, events=POLLIN, revents=POLLIN|POLLERR|POLLHUP}], 1, -1) = 1
splice(0x7, 0, 0x4, 0, 0x10000, 0x3)    = 1460
splice(0x3, 0, 0x5, 0, 0x5b4, 0x5)      = 1460


About tcp_recvmsg(), we might also remove the "!timeo" test as well,
more testings are needed. But remind that if an application provides
a large buffer to tcp_recvmsg() call, removing the test will reduce
the number of syscalls but might use more DCACHE. It could reduce
performance on old cpus. With splice() call, we expect to not
copy memory and trash DCACHE, and pipe buffers being limited to 16,
we cope with a limited working set. 



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] tcp: splice as many packets as possible at once, Willy Tarreau, (Thu Jan 8, 1:30 pm)
Re: [PATCH] tcp: splice as many packets as possible at once, Eric Dumazet, (Fri Jan 9, 2:47 am)
Re: [PATCH] tcp: splice as many packets as possible at once, Evgeniy Polyakov, (Fri Jan 9, 6:42 pm)
Re: [PATCH] tcp: splice as many packets as possible at once, Evgeniy Polyakov, (Sun Jan 11, 8:58 am)
Re: [PATCH] tcp: splice as many packets as possible at once, Evgeniy Polyakov, (Sun Jan 11, 9:35 am)
Re: [PATCH] tcp: splice as many packets as possible at once, Evgeniy Polyakov, (Sun Jan 11, 12:05 pm)
Re: [PATCH] tcp: splice as many packets as possible at once, Evgeniy Polyakov, (Tue Jan 13, 8:13 pm)
Re: [PATCH] tcp: splice as many packets as possible at once, Evgeniy Polyakov, (Tue Jan 13, 8:22 pm)
Re: [PATCH] tcp: splice as many packets as possible at once, Jarek Poplawski, (Wed Jan 14, 4:53 am)
Re: [PATCH] tcp: splice as many packets as possible at once, Jarek Poplawski, (Tue Jan 20, 4:37 am)
Re: [PATCH] tcp: splice as many packets as possible at once, Jarek Poplawski, (Fri Jan 16, 2:51 am)
Re: [PATCH] tcp: splice as many packets as possible at once, Evgeniy Polyakov, (Tue Jan 20, 8:11 am)
Re: [PATCH] tcp: splice as many packets as possible at once, Jarek Poplawski, (Tue Jan 20, 10:06 am)
Re: [PATCH] tcp: splice as many packets as possible at once, Jarek Poplawski, (Mon Jan 19, 4:40 am)
Re: [PATCH] tcp: splice as many packets as possible at once, Jarek Poplawski, (Mon Jan 26, 3:59 am)
Re: [PATCH] tcp: splice as many packets as possible at once, Jarek Poplawski, (Wed Jan 14, 5:54 am)
Re: [PATCH] tcp: splice as many packets as possible at once, Jarek Poplawski, (Wed Jan 14, 8:15 am)
Re: [PATCH] tcp: splice as many packets as possible at once, Jarek Poplawski, (Wed Jan 14, 8:06 am)
Re: [PATCH] tcp: splice as many packets as possible at once, Jarek Poplawski, (Wed Jan 14, 5:42 am)
Re: [PATCH] tcp: splice as many packets as possible at once, Jarek Poplawski, (Wed Jan 14, 6:47 am)
Re: [PATCH] tcp: splice as many packets as possible at once, Jarek Poplawski, (Wed Jan 14, 7:40 am)
Re: [PATCH] tcp: splice as many packets as possible at once, Jarek Poplawski, (Wed Jan 14, 7:45 am)
Re: [PATCH] tcp: splice as many packets as possible at once, Evgeniy Polyakov, (Fri Jan 9, 7:01 pm)
[PATCH] tcp: splice as many packets as possible at once, Willy Tarreau, (Thu Jan 8, 4:16 pm)