Commit Graph

43077 Commits

Author SHA1 Message Date
Asias He
04dd72efd3 tcp: Support close initiated on server side for posix stack
Fix hang with ab test on posix stack:

ab -n 1000 http://127.0.0.1/

Fixes #3
2014-10-28 12:42:47 +02:00
Tomasz Grabiec
57861d39ce memcache: add 'stats hash' command
Prints some details about hashtable usage.
2014-10-28 12:33:00 +02:00
Calle Wilund
1891a7ab1f collectd: add gauge (absolute value) counter as well for #registered
Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2014-10-28 11:09:15 +02:00
Calle Wilund
66c2a62259 collectd: use low-res timestamps
Since hi-res seems to work poorly at least on my fedora and are a bit of
an overkill anyway.

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2014-10-28 11:09:09 +02:00
Calle Wilund
774e48e42e collectd: enforce encoding as double/uint64_t depending on data_type
Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2014-10-28 11:09:04 +02:00
Calle Wilund
030709a3c9 collectd: fix bug with function value binding
Remove unneeded code in send loop (values don't need to be copied).

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2014-10-28 11:08:57 +02:00
Calle Wilund
abb15db28f collectd: ensure the protocol writer is consistent ref. daemon
Also make it less talkative (lower byte overhead) by keeping track of IDs
sent.

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2014-10-28 11:08:45 +02:00
Calle Wilund
8619bf2ba7 collectd: Modify the scollectd modules own counters to use well-known types
So it can be consumed by unmodified collectd server.

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2014-10-28 11:08:19 +02:00
Calle Wilund
b42ec4caea collectd - typo in value list composition
Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2014-10-28 11:07:52 +02:00
Avi Kivity
b1ec66900f memcached: reindent ascii parser test 2014-10-28 11:04:45 +02:00
Avi Kivity
90cb9376ab memcached: enhance test to check for differently scattered packets
Use funky indentation to reduce diff size; can be adjutsed later.
2014-10-28 11:01:37 +02:00
Avi Kivity
929f714e4c net: allow constructing a packet from const data
Since we're copying the data, we can call const_cast<> without fear.
2014-10-28 11:01:37 +02:00
Avi Kivity
d5675c32a7 net: add ostream support for packet
print your packets with

   print("got packet: %s\n", p);

!
2014-10-28 11:01:37 +02:00
Avi Kivity
ae7c071a01 net: fix packet::append with internal data 2014-10-28 11:01:37 +02:00
Asias He
fd56c6345c net: Remove leftover code in packet.hh 2014-10-28 10:42:18 +02:00
Avi Kivity
6dcf24f98d Move contents of async-action.hh into future-util.hh 2014-10-27 19:28:10 +02:00
Tomasz Grabiec
c6545bf2df tests: add another test case for future::forward_to() 2014-10-27 15:58:59 +02:00
Tomasz Grabiec
eb84a3b78b core: fix future::forward_to()
It did not handle properly the case when the target promise's future gets dead
without installing a callback or the future was never installed. The
mishanlding of the former case was causing httpd to abort on SMP.
2014-10-27 15:58:57 +02:00
Gleb Natapov
0aee62c4ae smp: forward exception thrown by RPC callback back to a caller
If an exception is uncaught here it prevents smp_message_queue::listen()
from tail call itself so further RPC stops working.
2014-10-27 10:55:18 +02:00
Gleb Natapov
bfb1d17843 reactor: remove unused local variables 2014-10-26 18:35:56 +02:00
Avi Kivity
8818af1c23 core: move semaphore class into its own file 2014-10-26 15:52:01 +02:00
Avi Kivity
5fef739544 Merge branch 'distributed'
Infrastructure for services distributed across cpus.
2014-10-26 14:35:19 +02:00
Avi Kivity
3e4e2344b8 Merge branch 'semaphore'
Semaphore speedups.
2014-10-26 14:35:07 +02:00
Avi Kivity
5e4f649a57 semaphore: switch list -> circular_buffer
circular_buffer is much more efficient, since allocations are amortized.
2014-10-26 14:34:56 +02:00
Avi Kivity
0d745abf69 future: sprinke noexcept everywhere
When used correctly, noexcept allows containers to optimize their reallocation
code.
2014-10-26 14:34:56 +02:00
Avi Kivity
4af8036677 http: convert to use distributed<> infrastructure 2014-10-26 13:34:31 +02:00
Avi Kivity
e7ce27ea32 smp: add distributed<>, infrastructure for distributed service
Summary:

  distributed<my_service> dist;

  dist.start() - constructs my_service on all cpus
  dist.stop() - destroys previously constructed instances
  dist.invoke(cpu, &my_service::method, args...) - run method on one cpu
  dist.invoke_on_all(cpu, &my_service::method, args...) - run method on all cpus
2014-10-26 13:34:31 +02:00
Avi Kivity
82321d435f future: add parallel_for_each() helper
Runs functions in paralllel, and returns a future<> that becomes ready
when all are complete.
2014-10-26 13:34:31 +02:00
Avi Kivity
2639c284f3 reactor: add cpu_id() accessor 2014-10-26 11:25:16 +02:00
Gleb Natapov
01a1c1c3c2 smp: delete non existent function declaration listen_one() 2014-10-26 10:30:48 +02:00
Avi Kivity
bb522a5592 Revert "keep_doing: fix memory leak"
This reverts commit 5a3e4f20e3.  After
74ac65a491 ("core: optimize future::forward_to()"), it is no longer
needed.
2014-10-24 22:25:46 +03:00
Avi Kivity
734b758470 Merge branch 'tcp-include'
Reduce #includes of tcp.hh.
2014-10-24 22:24:40 +03:00
Avi Kivity
9fbd13175b net: move mechanics of listening to a tcp connection to tcp.cc
Removes an include of tcp.hh.
2014-10-24 22:18:54 +03:00
Avi Kivity
e18b77d5cd udp: add missing include 2014-10-24 22:18:54 +03:00
Avi Kivity
04db837450 net: move native stack implementation classes to new header file
This will allow us to instantiate them for tcp in tcp.cc, reducing
compile times.
2014-10-24 22:18:54 +03:00
Avi Kivity
332cd6424b ip: use indirection to access tcp
This reduces the number of files that include tcp.hh.
2014-10-24 22:18:46 +03:00
Avi Kivity
ec7b5eeed2 tcp: move ipv4_tcp implementation into tcp.cc
First step in isolating tcp from the rest of the stack.
2014-10-24 21:45:20 +03:00
Avi Kivity
6b23750255 Merge branch 'avi/distributed' of github.com:cloudius-systems/seastar-dev
"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."
2014-10-24 19:46:59 +03:00
Avi Kivity
658d52589e Merge branch 'asias/tcp' of github.com:cloudius-systems/seastar-dev 2014-10-24 19:43:57 +03:00
Tomasz Grabiec
0cf6564097 tests: add tests for future::forward_to() 2014-10-24 19:40:48 +03:00
Tomasz Grabiec
74ac65a491 core: optimize future::forward_to()
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.
2014-10-24 19:40:48 +03:00
Asias He
c08879edea tcp: Do not advertise zero window when ACK remote FIN
Follow Linux's behavior.
2014-10-24 16:27:00 +08:00
Asias He
fb0123ec61 tcp: Ack data and FIN in a single packet 2014-10-24 16:25:35 +08:00
Asias He
cbc5e9392f tcp: Send <ACK> packet to ack data only when data is present 2014-10-24 16:24:06 +08:00
Asias He
6018b27bab tcp: Add comments for SYN 2014-10-24 16:23:25 +08:00
Asias He
4717d0bc48 net: Rename stack -> native-stack 2014-10-24 09:14:16 +08:00
Asias He
d251f33123 net: Remove unnecessary include of "stack.hh" 2014-10-24 09:10:23 +08:00
Avi Kivity
5a3e4f20e3 keep_doing: fix memory leak
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.
2014-10-23 19:24:29 +03:00
Avi Kivity
7428717be9 keep_doing: cosmetics 2014-10-23 16:57:36 +03:00
Avi Kivity
1f80f7ee14 memory: fix realloc()
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.
2014-10-23 15:59:52 +03:00