crypto/isal: add vectorized async md5 library#52385
crypto/isal: add vectorized async md5 library#52385
Conversation
c22a3f8 to
a796ca6
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
this work is specific both to MD5 hashes and to the isa-l library, but i think there's interest both in support other hashes, and for other libraries like QAT |
| // have to post() the completion instead | ||
| boost::asio::post(boost::asio::bind_executor(get_executor(), std::move(h))); | ||
| } else { | ||
| boost::asio::dispatch(std::move(h)); |
There was a problem hiding this comment.
while testing #52488, we sometimes see a crash here due to what looks like an empty any_completion_handler
in the trace i'm looking at, Batch::init_async_hash() was calling complete() on the ctx returned by md5_ctx_mgr_submit(), which was not the same as submit_ctx
There was a problem hiding this comment.
i added a unit test that can reproduce this crash. after enabling the thread sanitizer:
diff --git a/src/test/isal/CMakeLists.txt b/src/test/isal/CMakeLists.txt
index bbff3bd0d03..1b83b89d14a 100644
--- a/src/test/isal/CMakeLists.txt
+++ b/src/test/isal/CMakeLists.txt
@@ -1,3 +1,5 @@
add_executable(unittest_isal_md5 test_isal_md5.cc)
add_ceph_unittest(unittest_isal_md5)
target_link_libraries(unittest_isal_md5 isal_md5)
+target_compile_options(unittest_isal_md5 PRIVATE "-fsanitize=thread")
+target_link_options(unittest_isal_md5 PRIVATE "-fsanitize=thread")and running that test case repeatedly:
bin/unittest_isal_md5 --gtest_filter=isal_md5.batch_thread_pool --gtest_repeat=100 &> batch_thread_pool.log
thread sanitizer reports these data races: https://gist.github.com/cbodley/5f4dcc6b1148b2302313a5ba7edc1c15
src/crypto/isa-l/md5/async_md5.h
Outdated
| void init_async_hash(boost::asio::any_completion_handler<void(error_code)> handler, | ||
| Digest& digest, std::string_view input, bool last); | ||
|
|
||
| struct initiate_async_hash { | ||
| Batch* self; | ||
|
|
||
| using executor_type = Batch::executor_type; | ||
| executor_type get_executor() const noexcept { return self->ex; } |
There was a problem hiding this comment.
the intent of struct initiate_async_hash and get_executor() here was to run init_async_hash() within the Batch executor, but that doesn't seem to happen for 'awaitable' completion tokens
in the isal_md5.batch_thread_pool unit test, the calls to init_async_hash() are running on the thread pool context rather than the strand executor, hence the data races that lead to crashes
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
instead of building isa-l_crypto source files directly into the ceph_crypto_isal plugin, use a cmake ExternalProject to build the library with make and expose the static library as cmake target ISAL::Crypto Signed-off-by: Casey Bodley <cbodley@redhat.com>
builds an asynchronous batching library on top of the isal crypto library's multi-buffer md5 facilities: > The MD5 CTX interface functions are available for 4 architectures: SSE, AVX, AVX2 and > AVX512. In addition, a multibinary interface is provided, which selects the appropriate > architecture-specific function at runtime. Signed-off-by: Casey Bodley <cbodley@redhat.com>
9183352 to
865a0da
Compare
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
|
This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution! |
builds an asynchronous batching library on top of the isal crypto library's multi-buffer md5 facilities:
the goal, tracked in https://tracker.ceph.com/issues/61646, is to reduce the cpu load from ETag calculations in rgw
based on top of two PRs, #51573 and #50064, to enable the use of new asio features like any_completion_handler
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windows