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.
The protocol is called the "memcache protocol" but the server should
follow the same naming convention as httpd does.
It should not be a big deal but it annoys the hell out of simple people
like myself who have their brain hard-wired to type the final "d"...
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
"Deleter objects are relatively heavyweight since they need to remember
which destructor to call. However, raw memory needs no destructor, and
we can exploit this fact."
Instead of allocating a vector to store the buffers to be destroyed, in the
case of a single buffer, use an ordinary free deleter.
This doesn't currently help much because the packet is share()d later on,
but if we may be able to eliminate the sharing one day.
Add packet(Iterator, Iterator, deleter).
(unfortunately we have both a template version with a template parameter
named Deleter, and a non-template version with a parameter called deleter.
Need to sort the naming out).
In many cases, a deleter is used to protect raw memory (e.g. a char array,
not something with a destructor). In that case we can simply free() it,
so, the deleter need not remember which destructor needs to be called.
It does need to remember whether it's a raw object or not, so we take over
the least significant bit and use it as a marker, and store the pointer
to the object in the deleter, instead of using a proxy impl object to
control actual deletion.
If the deleter is subsequently share()d, we have to convert it back to
the standard form, since the reference count lives in the impl object.
Given a string, return the corresponding ethernet address. This is useful
specially for xen, where we read the mac address from the xenstore.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Transmission of data is not atomic so we cannot replace item's fields
in-place. This can lead to inconsistencies in "get" responses. We
should rather allocate a new item object replacing the one which is in
the cache.