Commit Graph

1711 Commits

Author SHA1 Message Date
Tomasz Grabiec
8efcec1949 core: enable_lw_shared_from_this: Add missing move and copy constructors
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
2015-06-16 20:32:07 +03:00
Shlomi Livne
78f37b25b8 tests: update test.py to use a temporary file for test stdout
When using boost --output-format=XML flag for jenkins the output file is
garbled - it seems that some output is lost. To try and overcome this
changed impl to use a temporay file instead of a PIPE.

Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-06-16 19:38:12 +03:00
Pekka Enberg
194cb68c8b tests: add thread-in-thread test case 2015-06-16 17:11:50 +03:00
Avi Kivity
c477f0e208 thread: remove obsolete FIXME 2015-06-16 17:10:22 +03:00
Avi Kivity
edcd346d83 thread: fix thread-created-within-thread
The thread switching code assumed that we will always switch out of a
thread due to being blocked on an unavailable future.  This allows
the core to store the blocked thread's context in the synthetic
continuation chained to that future (which switched back to that thread).

That assumption failed in one place: when we create a thread from within a
thread.  In that case we switch to the new thread immediately, but forget
all about the old thread.  We never come back to the old thread, and anything
that depends on it hangs.

Fix by creating a linked list of active thread contexts.  These are all
threads that have been "preempted" by the act of creating a new thread,
terminated by the main, unthreaded, reactor context.  This gives us a place
to store those threads and we come back to them and continue where we left
off.

Reported by Pekka.
2015-06-16 17:04:02 +03:00
Avi Kivity
201486ad89 Merge branch 'master' of github.com:cloudius-systems/seastar 2015-06-16 15:37:16 +03:00
Avi Kivity
5538e234f8 httpd: make 'connection' public again
Some test wants it.
2015-06-16 13:05:01 +03:00
Avi Kivity
2b0650f3f7 Merge branch 'shutdown'
Shutdown support for sockets, and httpd integration.
2015-06-16 12:59:22 +03:00
Avi Kivity
1e481f91b7 httpd: stop active connections on shutdown
Keep a list of all active connections, and shutdown the socket when
we're stopping.  Wait for all connections to remove themselves before
returning.
2015-06-16 12:03:00 +03:00
Avi Kivity
56abdc4632 httpd: implement stop() for http_server
Aborts active accept() calls and shuts down.  Active connections are
still leaked.
2015-06-16 12:02:58 +03:00
Avi Kivity
8f9d3dc9b2 httpd: reformat main.cc 2015-06-16 12:02:32 +03:00
Avi Kivity
8dc71b7b8b net: wire up connected_socket shutdown methods and expose to user 2015-06-16 12:02:32 +03:00
Avi Kivity
e59c7d9f1f net: provide shutdown methods for the native tcp stack 2015-06-16 12:02:32 +03:00
Avi Kivity
74e9a897b7 net: add shutdown methods for posix connected_socket
We can simply ask the kernel to shutdown for us, and it will propagate
exceptions to callers.
2015-06-16 12:02:31 +03:00
Avi Kivity
661d459fff net: wire up server_socket shutdown method and expose to callers 2015-06-16 12:02:30 +03:00
Avi Kivity
587013a611 net: add shutdown() method to tcp listener 2015-06-16 11:54:44 +03:00
Avi Kivity
9f7e31494c posix stack: add methods to shut down a listening socket
Anyone waiting on accept() will receive an exception.
2015-06-16 11:53:30 +03:00
Avi Kivity
f0ae995817 distributed: document 2015-06-15 23:17:06 +03:00
Avi Kivity
31d3801215 reactor: wire up shutdown() on pollable_fd 2015-06-15 16:38:52 +03:00
Avi Kivity
2a24e8f5ca reactor: add methods to abort futures waiting on fd event
If they're waiting, blow them away with an exception, and unsubscribe the
events from epoll.
2015-06-15 16:37:43 +03:00
Avi Kivity
1b99b1f170 queue: add method to abort a queue
Destroy all queued objects, blow waiting readers or writers with an
exception.
2015-06-15 16:35:48 +03:00
Avi Kivity
c653cc1910 posix: wire up shutdown() API 2015-06-15 16:35:22 +03:00
Avi Kivity
a4c711afd4 future: fix future<>::get0()
Empty tuples don't have a first element.
2015-06-15 11:43:38 +03:00
Avi Kivity
ddaaa315c8 future: add a get0() helper to get the first/only member of the result tuple
Reviewed-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-15 11:29:02 +03:00
Avi Kivity
053566b3e9 deleter: document 2015-06-15 08:47:44 +03:00
Avi Kivity
1769cb4520 temporary_buffer: document 2015-06-14 23:52:25 +03:00
Avi Kivity
25420a6fdf core: add support for --cpuset command line option
Syntax: [cpu-]cpu(,[cpu-]cpu=)...
Default: all processors
2015-06-14 16:11:31 +03:00
Avi Kivity
f85a2b48bb resource: support using only a subset of a machine's processors
This is useful for running multiple seastar applications on the same
machine, for testing purposes.
2015-06-14 16:10:21 +03:00
Gleb Natapov
50b18a56cd test: add semaphore test 2015-06-14 16:03:46 +03:00
Gleb Natapov
361db498d1 semaphore: add wait() with timeout support 2015-06-14 16:02:19 +03:00
Gleb Natapov
f19ba7c334 Add timer move constructor 2015-06-14 16:02:18 +03:00
Gleb Natapov
1b2bf57a2b move timer out of reactor.hh to its own header 2015-06-14 16:02:16 +03:00
Avi Kivity
0b0ad13418 doc: prevent -- from becoming an emdash 2015-06-14 09:20:38 +03:00
Avi Kivity
5251c2523a thread: point out async() as an easy way to launch a thread 2015-06-14 09:14:30 +03:00
Avi Kivity
980a7dc881 thread: more documentation 2015-06-14 08:56:42 +03:00
Vlad Zolotarov
2f238e7d2e dpdk: exclude the KNI module from the required modules
We don't use this module and it's compilation is broken in DPDK 2.0.0
against Linux kernels 4.0.x.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-11 14:11:29 +03:00
Avi Kivity
b5b1fa730b dpdk: compatibility with dpdk 2.1 2015-06-11 11:12:07 +03:00
Avi Kivity
c4756c7622 fstream: fix dropped future in write path
Noticed by Raphael.
2015-06-10 11:48:20 +03:00
Avi Kivity
4bbd90d14c reactor: workaround missing FALLOC_FL_ZERO_RANGE in kernel headers
Prehistoric kernels don't expose FALLOC_FL_ZERO_RANGE, humor them.
2015-06-09 12:53:58 +03:00
Avi Kivity
7a464ddf99 reactor: batch aio
Instead of issuing a system call for every aio, wait for them to accumulate,
and issue them all at once.  This reduces syscall count, and allows the kernel
to batch requests (bu plugging the I/O queues during the call).  A poller is
added so that requests are not delayed too much.

Reviewed-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-09 12:52:40 +03:00
Avi Kivity
44e35ef545 fstream: preallocation support for file output stream
Preallocate disk blocks in advance of writing.

Reviewed-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-09 08:44:59 +03:00
Avi Kivity
3ab32ae7a1 file: add allocate() method
Allocate disk blocks in advance of writing to them.

Reviewed-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-09 08:44:53 +03:00
Raphael S. Carvalho
d864da71fc core: avoid fsyncing output stream twice
For some reason, I added a fsync call when the file underlying the
stream gets truncated. That happens when flushing a file, which
size isn't aligned to the requested DMA buffer.
Instead, fsync should only be called when closing the stream, so this
patch changes the code to do that.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-06-08 11:59:22 +03:00
Avi Kivity
89115e8da2 tests: whitelist thread_test 2015-06-07 14:31:26 +03:00
Tomasz Grabiec
ed3d85d299 foreign_ptr: Use std::pointer_traits<> to get element type 2015-06-07 09:55:33 +03:00
Avi Kivity
27d9446f77 future: fix false-positive when a promise tied to a future that lost its state is destroyed
When a promise that still tracks its future is destroyed, but after
future::get() or future::then() was called, the promise thinks it was
destroyed before generating a value, and fails an assertion.

Fix be detaching the promise from the future as soon as get() or then()
remove the value.
2015-06-06 13:47:44 +03:00
Avi Kivity
3986ad6a11 thread: add seastar::async()
Following std::async(), seastar::async(func) causes func to be executed
in a seastar thread, where it can block using future<>::get().  Whatever
func returns is converted to a future, and returned as async()s return
value.
2015-06-04 20:57:00 +03:00
Gleb Natapov
b06f6f8209 foreign_ptr: introduce make_local_and_release()
Sometimes remote data has to be copied to local cpu, but if data is
already local copy can be avoided. Introduce helper function that moves
or copies data depending on origin cpu.
2015-06-04 18:54:05 +03:00
Vlad Zolotarov
db73024f0c core: distributed::local(): check the vector boundaries before trying to access the element
assert() if we are out of bounds or if the element is not initialized.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-04 14:34:58 +03:00
Avi Kivity
8d0bd44b08 do_with: doxygenize 2015-06-03 20:44:48 +03:00