libceph: use MSG_SENDPAGE_NOTLAST with ceph_tcp_sendpage()
authorIlya Dryomov <idryomov@gmail.com>
Tue, 20 Nov 2018 14:44:00 +0000 (15:44 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 26 Dec 2018 14:56:04 +0000 (15:56 +0100)
commit433b0a12953bc1dfcb52febb186136395a65aad0
treeae43992cb2721ae51f4b91be78570af8d14b6b95
parent3239eb5215ebdef593a79316c9dbbdf8849166ec
libceph: use MSG_SENDPAGE_NOTLAST with ceph_tcp_sendpage()

Prevent do_tcp_sendpages() from calling tcp_push() (at least) once per
page.  Instead, arrange for tcp_push() to be called (at least) once per
data payload.  This results in more MSS-sized packets and fewer packets
overall (5-10% reduction in my tests with typical OSD request sizes).
See commits 2f5338442425 ("tcp: allow splice() to build full TSO
packets"), 35f9c09fe9c7 ("tcp: tcp_sendpages() should call tcp_push()
once") and ae62ca7b0321 ("tcp: fix MSG_SENDPAGE_NOTLAST logic") for
details.

Here is an example of a packet size histogram for 128K OSD requests
(MSS = 1448, top 5):

Before:

     SIZE    COUNT
     1448   777700
      952   127915
     1200    39238
     1219     9806
       21     5675

After:

     SIZE    COUNT
     1448   897280
       21     6201
     1019     2797
      643     2739
      376     2479

We could do slightly better by explicitly corking the socket but it's
not clear it's worth it.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
net/ceph/messenger.c