From 46f6667a51486e043ff39383c22466479b46c129 Mon Sep 17 00:00:00 2001 From: jhb Date: Fri, 10 Feb 2017 19:49:42 +0000 Subject: MFC 311568,311584,312387: Set MORETOCOME for AIO write requests on a socket. 311568: Set MORETOCOME for AIO write requests on a socket. Add a MSG_MOREOTOCOME message flag. When this flag is set, sosend* set PRUS_MOREOTOCOME when invoking the protocol send method. The aio worker tasks for sending on a socket set this flag when there are additional write jobs waiting on the socket buffer. 311584: Unbreak lib/libsysdecode after r311568 by decoding MSG_MORETOCOME flag in msgflags (Actually, this change excludes MSG_MORETOCOME from being decoded) 312387: Fix regression from r311568: collision of MSG_NOSIGNAL with MSG_MORETOCOME lead to delayed send of data sent with sendto(MSG_NOSIGNAL). Sponsored by: Chelsio Communications --- sys/kern/sys_socket.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sys/kern/sys_socket.c') diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index 80c55dd..da5f8e8 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -604,6 +604,8 @@ retry: if (td->td_ru.ru_msgrcv != ru_before) job->msgrcv = 1; } else { + if (!TAILQ_EMPTY(&sb->sb_aiojobq)) + flags |= MSG_MORETOCOME; uio.uio_rw = UIO_WRITE; ru_before = td->td_ru.ru_msgsnd; #ifdef MAC -- cgit v1.1