diff options
author | Bhasker Hariharan <bhaskerh@google.com> | 2019-08-14 14:33:11 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-08-14 14:34:27 -0700 |
commit | 570fb1db6b4e01be37386a379fea4d63e5a3cdc2 (patch) | |
tree | 44cd127ffaa546b3f0c9bc1b642fe8980e69bbd9 /test/syscalls/linux/BUILD | |
parent | cee044c2ab009c9faae154e1751eef93430fc141 (diff) |
Improve SendMsg performance.
SendMsg before this change would copy all the data over into a
new slice even if the underlying socket could only accept a
small amount of data. This is really inefficient with non-blocking
sockets and under high throughput where large writes could get
ErrWouldBlock or if there was say a timeout associated with the sendmsg()
syscall.
With this change we delay copying bytes in till they are needed and only
copy what can be potentially sent/held in the socket buffer. Reducing
the need to repeatedly copy data over.
Also a minor fix to change state FIN-WAIT-1 when shutdown(..., SHUT_WR) is called
instead of when we transmit the actual FIN. Otherwise the socket could remain in
CONNECTED state even though the user has called shutdown() on the socket.
Updates #627
PiperOrigin-RevId: 263430505
Diffstat (limited to 'test/syscalls/linux/BUILD')
-rw-r--r-- | test/syscalls/linux/BUILD | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/syscalls/linux/BUILD b/test/syscalls/linux/BUILD index 16666e772..d28ce4ba1 100644 --- a/test/syscalls/linux/BUILD +++ b/test/syscalls/linux/BUILD @@ -1252,10 +1252,14 @@ cc_binary( srcs = ["partial_bad_buffer.cc"], linkstatic = 1, deps = [ + "//test/syscalls/linux:socket_test_util", + "//test/util:file_descriptor", "//test/util:fs_util", + "//test/util:posix_error", "//test/util:temp_path", "//test/util:test_main", "//test/util:test_util", + "@com_google_absl//absl/time", "@com_google_googletest//:gtest", ], ) |