Commit Graph

53948 Commits

Author SHA1 Message Date
Pekka Enberg
6211dd68df cql3: Fix parsed_statement type
Parsed statements are not CQL statements so we shouldn't inherit from the
latter although commit 485620a ("cql3: Fix cql_statement and parsed_statement
confusion") claims otherwise.

This is needed to convert classes such as UpdateStatement.ParsedInsert.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-20 11:41:08 +02:00
Avi Kivity
2e4122ddd7 futures_test: add broken semaphore test 2015-01-20 11:30:56 +02:00
Avi Kivity
90e77cc3a0 semaphore: support for breaking a semaphore
Tell all waiters that something bad happened and they should all go away.

Can be used only once; waiters should clean up and there must not be any
new waiters.
2015-01-20 11:29:48 +02:00
Avi Kivity
a6dea57f5b semaphore: add missing include 2015-01-20 11:29:26 +02:00
Avi Kivity
4c86eab910 Merge branch 'docker'
Improve docker builds.
2015-01-19 20:16:15 +02:00
Avi Kivity
811fba9bc1 Merge branch 'align'
Aligned allocation facility.
2015-01-19 20:15:51 +02:00
Avi Kivity
b452e33bd1 README: simplify docker build instructions
Run the build command directly in docker, using a shell function, instead
of opening a shell.  Forward the user/group IDs so the build artifacts belong
to the user, not root.
2015-01-19 20:13:32 +02:00
Avi Kivity
1a29177d78 build: add cryptopp, libpciaccess, zlib, and libxml2 to docker installation 2015-01-19 20:13:15 +02:00
Avi Kivity
6e9d4f367d build: move Dockerfile to docker/dev
'docker build' transfers the directory containing Dockerfile to the
container, which can take quite a while with a pre-built environment.
2015-01-19 19:50:15 +02:00
Avi Kivity
93ae11cf63 resource: fix off-by-type getting number of processing units
Effect was to lose hyperthreads on NUMA machines.
2015-01-19 16:11:11 +02:00
Avi Kivity
e0d5bd2fb8 collectd: improve default hostname 2015-01-19 15:58:24 +02:00
Asias He
56f8ba3303 tcp: Clear more when tear down a connection 2015-01-19 13:32:53 +02:00
Avi Kivity
555be6f4bc tests: test aligned allocator 2015-01-19 09:49:32 +02:00
Avi Kivity
45f9c86943 memory: provide C++ facilities for aligned allocation
new (with_alignment(64)) foo(...)   // cache aligned foo
  std::vector<foo, aligned_allocator<foo, 64>> // cached aligned foo vector
2015-01-19 09:49:32 +02:00
Avi Kivity
b22186e623 memory: fix small aligned allocations
When size > align, we simply call the small allocator with the provided size,
but that does not guarantee any alignment above the default.

Round the allocation size to the nearest power of two in that case, to
guarantee alignment.
2015-01-19 09:49:32 +02:00
Gleb Natapov
23b9605fc4 net: fix virtio bulk sending
Zero net_hdr_mrg for each packet, otherwise wrong flags may be used.
2015-01-18 16:23:01 +02:00
Gleb Natapov
4920f309e8 net: fix dpdk bulk sending
_tx_burst_idx may be zero, but _tx_burst still holds packets from the top
of circular_buffer, so avoid refilling in this case.
2015-01-18 16:23:00 +02:00
Vlad Zolotarov
b8185d5afe DPDK: Set rss_bits to correct value if reta_size is not available
rss_bits should be equal to the number of bits HW used in its RSS calculation.
Use dev_info.max_rx_queues if dev_info.reta_size is not available.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-01-18 12:37:19 +02:00
Gleb Natapov
e3915cfcf8 reactor: call pause instruction in idle loop 2015-01-18 12:37:05 +02:00
Gleb Natapov
2ff006da4a core: calculate system load and report it via collectd 2015-01-18 12:37:05 +02:00
Gleb Natapov
1ef2808750 reactor: return proper value from pollers
Currently most of them return true no matter if any work was actually
done. Fix it to return true only if poll did any work.
2015-01-18 12:37:05 +02:00
Avi Kivity
201a9617bf Merge branch 'v2p'
Virtual-to-physical translation, for DMA.  Requires hugetlbfs backed memory.
2015-01-18 10:43:22 +02:00
Pekka Enberg
0b0a751370 cql3: Clean up optional<> use in boolean return expressions
Suggested by Avi.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-18 10:27:58 +02:00
Don Marti
69a39dbb6c build: Install all RPMs in one command in Dockerfile
Save one intermediate container and a little time.

Signed-off-by: Don Marti <dmarti@cloudius-systems.com>
2015-01-18 10:03:16 +02:00
Gleb Natapov
57bcec15c7 memcached: flush cache during destruction.
Also add assert to item's cancel() function. It cannot be called after
cache is flushed.

Reviewed-by: Tomasz Grabiec <tgrabiec@gmail.com>
2015-01-15 18:25:30 +02:00
Avi Kivity
80bcf3f973 memory: provide virt-to-phys translation API
Convert virtual addresses to physical addresses.  Only works when
--hugepages is in effect.
2015-01-15 18:23:19 +02:00
Avi Kivity
d77d0cddca posix: implement pread() interface 2015-01-15 18:22:07 +02:00
Takuya ASADA
bbe4d3b7d6 net: implemented SO_REUSEPORT support on UDP
Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
2015-01-15 17:38:06 +02:00
Avi Kivity
ae64fe7d6c Merge branch 'cross-cpu-alloc'
Library-imposed smart pointers, such as std::exception_ptr, may free on
a cpu other than the one they were allocated on.  Unfortunately it is
impossible to wrap std::exception_ptr, since it interacts directly with the
stack unwinder.

Fix by allowing cross-cpu frees.  It's a slow path, so do not abuse.
2015-01-15 15:42:26 +02:00
Avi Kivity
4c3eb49aaf tests: add smp test
Test calling a function, and calling a function that returns an exception.

The second test verifies that cross cpu free works.
2015-01-15 15:19:02 +02:00
Avi Kivity
e746eb7f84 future: fix make_exception_future build error
Add missing std::.
2015-01-15 15:19:02 +02:00
Avi Kivity
311e1c834e future: fix future::then_wrapped() in exception case
Calling state.get() will throw the exception instead of calling the function,
thus denying the called function the chance to deal with the exception.

Fix by constructing the future directly from state.
2015-01-15 15:19:02 +02:00
Avi Kivity
809c6edee2 reactor: periodically call into allocator to drain cross-cpu free items 2015-01-15 15:19:02 +02:00
Avi Kivity
e57be410b5 memory: support cross-cpu freeing
Currently we require that memory be freed on the same cpu it was allocated.
This does not impose difficulties on the user code, since our code is already
smp-unsafe, and so must use message-passing to run the destructor on the
origin cpu, so memory is naturally freed there as well.

However, library code does not run under our assumptions, specifically
std::exception_ptr, which we do transport across cores.

To support this use case, add low-performance support for cross-cpu frees,
using an atomic singly linked list per core.
2015-01-15 15:19:00 +02:00
Avi Kivity
65171036b8 Merge branch 'asias/abstract_c_type' of github.com:cloudius-systems/seastar-dev into db
AbstractCType partial conversion, from Asias.
2015-01-15 11:06:24 +02:00
Avi Kivity
8ba4598bf6 Merge branch 'master' of github.com:cloudius-systems/seastar into db 2015-01-15 11:06:09 +02:00
Avi Kivity
30aa81819a app: handle command line parsing errors 2015-01-15 10:46:44 +02:00
Asias He
f004db89cf tcp: Make tcp_option get_size and fill more readable 2015-01-15 10:31:46 +02:00
Asias He
8ed3584a5e app: Allow -h to show help message
It only supports -help at the moment. It is quite annoying to see:

   $ ./httpd -h
   terminate called after throwing an instance of
   'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::program_options::unknown_option> >'
     what():  unrecognised option '-h'
   Aborted

Support both -h and --help.
2015-01-15 10:31:31 +02:00
Asias He
bf78e14d17 db: Switch to seastar shared_ptr from std::shared_ptr 2015-01-15 09:05:48 +08:00
Asias He
8d737985b0 db: Convert db/composites/AbstractCType.java to C++ 2015-01-15 09:05:48 +08:00
Asias He
429eb45ef9 cql3: Fix include inside namespace 2015-01-15 09:05:48 +08:00
Asias He
3984f25b38 db: Make db::composites::c_type public 2015-01-15 09:05:48 +08:00
Asias He
bf018615b8 Add abstract_type::is_byte_order_comparable 2015-01-15 09:05:48 +08:00
Asias He
20761a3cd9 Add abstract_type::is_compatible_with 2015-01-15 09:05:48 +08:00
Asias He
e4c7b77f1b Add abstract_type::validate_collection_member 2015-01-15 09:05:48 +08:00
Asias He
2dded3459a Add abstract_type::compare() 2015-01-15 09:05:48 +08:00
Asias He
18435837dd Add abstract_type::compare_unsigned() helper 2015-01-15 09:05:48 +08:00
Pekka Enberg
17ef2d1789 cql3: Clean up namespace usage in Cql.g
Import CQL namespaces in the antlr-generated header file to avoid having
to use fully qualified names in the grammar file. This is considered bad
practice because of naming conflicts but we can contain it by
introducing wrappers for the main parser entry point.

Suggested by Avi.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-14 18:09:53 +02:00
Avi Kivity
7c7aaa64a1 Merge branch 'penberg/antlr3' of github.com:cloudius-systems/seastar-dev into db
Initial conversion of the cql grammar file to C++, from Pekka.
2015-01-14 17:22:15 +02:00