Skip to content
Snippets Groups Projects
Commit f3bcf0f5 authored by Will Dietz's avatar Will Dietz :speech_balloon:
Browse files

Introduce NOOPT state (like in the paper!), use to fastpath.

Results in significantly better performance when optimization
is not possible.
parent b3c83d8d
No related branches found
No related merge requests found
...@@ -145,6 +145,8 @@ void attempt_optimization(int fd, bool send) { ...@@ -145,6 +145,8 @@ void attempt_optimization(int fd, bool send) {
// Configure localfd // Configure localfd
copy_bufsizes(fd, i.localfd); copy_bufsizes(fd, i.localfd);
set_local_nonblocking(fd, i.non_blocking); set_local_nonblocking(fd, i.non_blocking);
} else {
i.state = STATE_NOOPT;
} }
} }
} }
...@@ -168,6 +170,9 @@ ssize_t do_ipc_io(int fd, buf_t buf, size_t count, int flags, IOFunc IO, ...@@ -168,6 +170,9 @@ ssize_t do_ipc_io(int fd, buf_t buf, size_t count, int flags, IOFunc IO,
return ret; return ret;
} }
if (i.state == STATE_NOOPT)
return IO(fd, buf, count, flags);
// Otherwise, use original fd: // Otherwise, use original fd:
size_t &bytes = get_byte_counter(i, send); size_t &bytes = get_byte_counter(i, send);
ssize_t rem = (TRANS_THRESHOLD - bytes); ssize_t rem = (TRANS_THRESHOLD - bytes);
...@@ -293,6 +298,10 @@ ssize_t do_ipc_iov(int fd, const struct iovec *vec, int count, IOVFunc IO, ...@@ -293,6 +298,10 @@ ssize_t do_ipc_iov(int fd, const struct iovec *vec, int count, IOVFunc IO,
return ret; return ret;
} }
if (i.state == STATE_NOOPT) {
return IO(fd, vec, count);
}
size_t bytes = 0; size_t bytes = 0;
for (int i = 0; i < count; ++i) { for (int i = 0; i < count; ++i) {
// Overflow check... // Overflow check...
......
...@@ -37,6 +37,7 @@ enum EndpointState { ...@@ -37,6 +37,7 @@ enum EndpointState {
STATE_UNOPT, STATE_UNOPT,
STATE_ID_EXCHANGE, STATE_ID_EXCHANGE,
STATE_OPTIMIZED, STATE_OPTIMIZED,
STATE_NOOPT
}; };
struct epoll_entry { struct epoll_entry {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment