"Often, a function we wish to execute on another cpu will not be able to
complete immediatley. This patchset allows it to return a future; the caller
will not be resumed until that future is ready."
We can avoid extra allocation and chaining by linking the current
future's promise with the target promise's future, as if the target
promise was moved into the current future's promise.
keep_doing() keeps chaining futures until it stops, usually never, resulting
in a de-facto memory leak (even though all the memory is still reachable).
Fix by avoiding the chainining, re-using the same promise over and over again.
Because memcpy() is declared by gcc as receiving non-null attributes, gcc
assumes that ptr != null, as it is passed into memcpy() (though with a size
of zero). As a result it ignores the null pointer check in ::free(), and
calls memory::free() directly, which does not expect a null pointer.
Fix by only calling memcpy() when the ptr is non-null.
Allow functions run on another cpu to return a future. In that case, the
result (or exception) is only returned when the future is resolved.
Note this has the potential for livelocks:
A: smp::submit_to(B, [] {
...
return smp::submit_to(A, [] {
...
});
});
If this and its mirror image (B sending to A) happen concurrently, and if
both the A->B and B->A queue become full, the system will not be able to
make forward progress. This can be fixed by making the inner submit_to()
use a different queue.
local send: <FIN>
remote send: <ACK>
In response to local <FIN> packet, remote can send <ACK> packet acking
both data and FIN.
Avoid consuming extra one byte in data handling.
inter_thread_work_queue now serves two purposes: a minimal work queue
for running blocking syscalls in a thread context outside the main reactor,
and for passing messages between reactors on different threads.
In order to evolve the inter_thread_work_queue's second task, without harming
the first, split it into two classes, syscall_work_queue and
smp_message_queue. Currently they are exactly equivalent.
Expired timer cancellation is broken since timer_set assumes that a
timer that is being canceled is not expired yet. This patch fixes the
problem by moving expired timers management outside timer_set and
letting the code that uses it to managed cancellation of expired timers.
In memcached it can never happen, in core each queued timer gets expired
flag that tells if timer is queued in a timer set or in expired timer
list.
std::unordred_map does it by default for std::string. We switched to
boost::intrusive::unordered_set<>, which does not do it by default for
any key. I see ~4% improvement in throughput with this.
Currently tcb are inserted but never removed from tcbs.
This patch also removes an unnecessary <ACK> packet (packet #5 below) to
the client.
1) client: <FIN>
2) server: <ACK>
3) server: <FIN>
4) client: <ACK>
5) server: <ACK>
Per-cpu value list registry with polling -> udp send
- Allows registration of metric values associated with
collectd id path (plugin/[plugin-inst/]type[/type-instance]).
- Values are broadcast/sent at periodic intervals. (config)
- Config through seastar.conf / app-template.
- Value registration can be revoked safely, either manually or
through anchor.
Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
When client closes the connection in one direction, make httpd close the
other direction too. This way, httpd will send back a <FIN> packet to
client after receiving client's <FIN> packet.
It implements a very simple reclaimer. When triggered tries to free
around 5 MB of data. This assumes that this amount is more than anyone
would want to allocate between low-memory event is detected and the
reclaimer task runs. This amount was chosen arbitrarily and I am not
sure if this amount is right.