Skip to content

Try experimental hualloc memory allocator from Yandex#31376

Closed
alexey-milovidov wants to merge 30 commits intomasterfrom
hualloc
Closed

Try experimental hualloc memory allocator from Yandex#31376
alexey-milovidov wants to merge 30 commits intomasterfrom
hualloc

Conversation

@alexey-milovidov
Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Performance Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Try experimental hualloc memory allocator from Yandex.

@robot-clickhouse robot-clickhouse added the pr-performance Pull request with some performance improvements label Nov 12, 2021
@robot-ch-test-poll4 robot-ch-test-poll4 added the submodule changed At least one submodule changed in this PR. label Nov 12, 2021
add_subdirectory(s2geometry-cmake)
endif()

# Put all targets defined here and in subdirectories under "contrib/<immediate-subdir>" folders in GUI-based IDEs.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fails on "cannot set property on ALIAS target", CC @traceon
As we don't use X-Code, I temporarily removed it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'll submit adjustments/fixes, after this change is merged.

@alexey-milovidov
Copy link
Copy Markdown
Member Author

Segfault on server termination.

@alexey-milovidov
Copy link
Copy Markdown
Member Author

Something is wrong with destruction order:

2021.11.13 01:43:44.212373 [ 3881375 ] {} <Fatal> BaseDaemon: ########################################
2021.11.13 01:43:44.213635 [ 3881375 ] {} <Fatal> BaseDaemon: (version 21.12.1.1, build id: 0F6087DFB23B5C54) (from thread 3881323) (no query) Received signal Aborted (6)
2021.11.13 01:43:44.213673 [ 3881375 ] {} <Fatal> BaseDaemon: 
2021.11.13 01:43:44.213713 [ 3881375 ] {} <Fatal> BaseDaemon: Stack trace: 0x7f21ec18e18b 0x7f21ec16d859 0x13680271 0x156ca463 0x7f21ec36f5a1 0x7f21ec37062a 0x7f21ec26a293
2021.11.13 01:43:44.213774 [ 3881375 ] {} <Fatal> BaseDaemon: 3. gsignal @ 0x4618b in /usr/lib/x86_64-linux-gnu/libc-2.31.so
2021.11.13 01:43:44.213820 [ 3881375 ] {} <Fatal> BaseDaemon: 4. abort @ 0x25859 in /usr/lib/x86_64-linux-gnu/libc-2.31.so
2021.11.13 01:43:44.216124 [ 3881375 ] {} <Fatal> BaseDaemon: 5. /home/milovidov/work/ClickHouse/build/../contrib/hualloc/hu_alloc.h:173: ? @ 0x13680271 in /home/milovidov/work/ClickHouse/build/programs/clickhouse
2021.11.13 01:43:44.218627 [ 3881375 ] {} <Fatal> BaseDaemon: 6. /home/milovidov/work/ClickHouse/build/../contrib/libcxxabi/src/cxa_thread_atexit.cpp:79: __cxxabiv1::(anonymous namespace)::run_dtors(void*) @ 0x156ca463 in /home/milovidov/work/ClickHouse/build/programs/clickhouse
2021.11.13 01:43:44.218694 [ 3881375 ] {} <Fatal> BaseDaemon: 7. __nptl_deallocate_tsd.part.0 @ 0x85a1 in /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
2021.11.13 01:43:44.218707 [ 3881375 ] {} <Fatal> BaseDaemon: 8. start_thread @ 0x962a in /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
2021.11.13 01:43:44.218719 [ 3881375 ] {} <Fatal> BaseDaemon: 9. clone @ 0x122293 in /usr/lib/x86_64-linux-gnu/libc-2.31.so

@alexey-milovidov
Copy link
Copy Markdown
Member Author

hualloc does not support thread_local

@alexey-milovidov
Copy link
Copy Markdown
Member Author

It is still wrong:

2021.11.14 04:16:02.195970 [ 29555 ] {} <Fatal> BaseDaemon: ########################################
2021.11.14 04:16:02.195993 [ 29555 ] {} <Fatal> BaseDaemon: (version 21.12.1.1, build id: 36E1FDA236A10284) (from thread 17563) (query_id: 0a847585-0b44-4534-adf3-8ce7058ba84c) Received signal Aborted (6)
2021.11.14 04:16:02.196004 [ 29555 ] {} <Fatal> BaseDaemon: 
2021.11.14 04:16:02.196023 [ 29555 ] {} <Fatal> BaseDaemon: Stack trace: 0x7ff58d8fd18b 0x7ff58d8dc859 0xd62e831 0xd9ddbdb 0xaf31d37 0xaf31da9 0xd30f700 0xc3c4f1e 0xb0ee745 0xb0edece 0xb0e192f 0xb0e1e1e 0xc1278c9 0xc5e1d5e 0xc5ebc95 0xc5e9ac0 0xc5ee4ef 0x5bb690a 0x5bb8cee 0x7ff58d74e609 0x7ff58d9d9293
2021.11.14 04:16:02.196074 [ 29555 ] {} <Fatal> BaseDaemon: 3. raise @ 0x4618b in /usr/lib/x86_64-linux-gnu/libc-2.31.so
2021.11.14 04:16:02.196090 [ 29555 ] {} <Fatal> BaseDaemon: 4. abort @ 0x25859 in /usr/lib/x86_64-linux-gnu/libc-2.31.so
2021.11.14 04:16:02.198431 [ 29555 ] {} <Fatal> BaseDaemon: 5. /fasttest-workspace/build/../../ClickHouse/contrib/hualloc/hu_alloc.h:173: ? @ 0xd62e831 in /fasttest-workspace/build/programs/clickhouse
2021.11.14 04:16:02.199517 [ 29555 ] {} <Fatal> BaseDaemon: 6. /fasttest-workspace/build/../../ClickHouse/contrib/zlib-ng/inflate.c:1064: inflateEnd @ 0xd9ddbdb in /fasttest-workspace/build/programs/clickhouse
2021.11.14 04:16:02.203020 [ 29555 ] {} <Fatal> BaseDaemon: 7.1. inlined from /fasttest-workspace/build/../../ClickHouse/contrib/libcxx/include/memory:1655: std::__1::unique_ptr<DB::ReadBuffer, std::__1::default_delete<DB::ReadBuffer> >::reset(DB::ReadBuffer*)
2021.11.14 04:16:02.203038 [ 29555 ] {} <Fatal> BaseDaemon: 7.2. inlined from ../../ClickHouse/contrib/libcxx/include/memory:1612: ~unique_ptr
2021.11.14 04:16:02.203047 [ 29555 ] {} <Fatal> BaseDaemon: 7. ../../ClickHouse/src/IO/ZlibInflatingReadBuffer.cpp:47: DB::ZlibInflatingReadBuffer::~ZlibInflatingReadBuffer() @ 0xaf31d37 in /fasttest-workspace/build/programs/clickhouse
2021.11.14 04:16:02.206359 [ 29555 ] {} <Fatal> BaseDaemon: 8. /fasttest-workspace/build/../../ClickHouse/src/IO/ZlibInflatingReadBuffer.cpp:45: DB::ZlibInflatingReadBuffer::~ZlibInflatingReadBuffer() @ 0xaf31da9 in /fasttest-workspace/build/programs/clickhouse
2021.11.14 04:16:02.225031 [ 29555 ] {} <Fatal> BaseDaemon: 9.1. inlined from /fasttest-workspace/build/../../ClickHouse/contrib/libcxx/include/memory:0: std::__1::default_delete<DB::ReadBuffer>::operator()(DB::ReadBuffer*) const
2021.11.14 04:16:02.225063 [ 29555 ] {} <Fatal> BaseDaemon: 9.2. inlined from ../../ClickHouse/contrib/libcxx/include/memory:1658: std::__1::unique_ptr<DB::ReadBuffer, std::__1::default_delete<DB::ReadBuffer> >::reset(DB::ReadBuffer*)
2021.11.14 04:16:02.225073 [ 29555 ] {} <Fatal> BaseDaemon: 9.3. inlined from ../../ClickHouse/contrib/libcxx/include/memory:1612: ~unique_ptr
2021.11.14 04:16:02.225085 [ 29555 ] {} <Fatal> BaseDaemon: 9.4. inlined from ../../ClickHouse/contrib/libcxx/include/memory:891: std::__1::allocator<std::__1::unique_ptr<DB::ReadBuffer, std::__1::default_delete<DB::ReadBuffer> > >::destroy(std::__1::unique_ptr<DB::ReadBuffer, std::__1::default_delete<DB::ReadBuffer> >*)
2021.11.14 04:16:02.225103 [ 29555 ] {} <Fatal> BaseDaemon: 9.5. inlined from ../../ClickHouse/contrib/libcxx/include/__memory/allocator_traits.h:539: void std::__1::allocator_traits<std::__1::allocator<std::__1::unique_ptr<DB::ReadBuffer, std::__1::default_delete<DB::ReadBuffer> > > >::__destroy<std::__1::unique_ptr<DB::ReadBuffer, std::__1::default_delete<DB::ReadBuffer> > >(std::__1::integral_constant<bool, true>, std::__1::allocator<std::__1::unique_ptr<DB::ReadBuffer, std::__1::default_delete<DB::ReadBuffer> > >&, std::__1::unique_ptr<DB::ReadBuffer, std::__1::default_delete<DB::ReadBuffer> >*)
2021.11.14 04:16:02.225116 [ 29555 ] {} <Fatal> BaseDaemon: 9.6. inlined from ../../ClickHouse/contrib/libcxx/include/__memory/allocator_traits.h:487: void std::__1::allocator_traits<std::__1::allocator<std::__1::unique_ptr<DB::ReadBuffer, std::__1::default_delete<DB::ReadBuffer> > > >::destroy<std::__1::unique_ptr<DB::ReadBuffer, std::__1::default_delete<DB::ReadBuffer> > >(std::__1::allocator<std::__1::unique_ptr<DB::ReadBuffer, std::__1::default_delete<DB::ReadBuffer> > >&, std::__1::unique_ptr<DB::ReadBuffer, std::__1::default_delete<DB::ReadBuffer> >*)
2021.11.14 04:16:02.225129 [ 29555 ] {} <Fatal> BaseDaemon: 9.7. inlined from ../../ClickHouse/contrib/libcxx/include/vector:428: std::__1::__vector_base<std::__1::unique_ptr<DB::ReadBuffer, std::__1::default_delete<DB::ReadBuffer> >, std::__1::allocator<std::__1::unique_ptr<DB::ReadBuffer, std::__1::default_delete<DB::ReadBuffer> > > >::__destruct_at_end(std::__1::unique_ptr<DB::ReadBuffer, std::__1::default_delete<DB::ReadBuffer> >*)
2021.11.14 04:16:02.225150 [ 29555 ] {} <Fatal> BaseDaemon: 9.8. inlined from ../../ClickHouse/contrib/libcxx/include/vector:371: std::__1::__vector_base<std::__1::unique_ptr<DB::ReadBuffer, std::__1::default_delete<DB::ReadBuffer> >, std::__1::allocator<std::__1::unique_ptr<DB::ReadBuffer, std::__1::default_delete<DB::ReadBuffer> > > >::clear()
2021.11.14 04:16:02.225160 [ 29555 ] {} <Fatal> BaseDaemon: 9.9. inlined from ../../ClickHouse/contrib/libcxx/include/vector:465: ~__vector_base
2021.11.14 04:16:02.225169 [ 29555 ] {} <Fatal> BaseDaemon: 9.10. inlined from ../../ClickHouse/contrib/libcxx/include/vector:557: ~vector
2021.11.14 04:16:02.225178 [ 29555 ] {} <Fatal> BaseDaemon: 9.11. inlined from ../../ClickHouse/src/Processors/Formats/IInputFormat.h:30: ~IInputFormat
2021.11.14 04:16:02.225186 [ 29555 ] {} <Fatal> BaseDaemon: 9. ../../ClickHouse/src/Processors/Formats/Impl/ParallelParsingInputFormat.h:106: DB::ParallelParsingInputFormat::~ParallelParsingInputFormat() @ 0xd30f700 in /fasttest-workspace/build/programs/clickhouse
2021.11.14 04:16:02.241414 [ 29555 ] {} <Fatal> BaseDaemon: 10.1. inlined from /fasttest-workspace/build/../../ClickHouse/contrib/libcxx/include/memory:2518: std::__1::__shared_weak_count::__release_shared()
2021.11.14 04:16:02.241445 [ 29555 ] {} <Fatal> BaseDaemon: 10.2. inlined from ../../ClickHouse/contrib/libcxx/include/memory:3212: ~shared_ptr
2021.11.14 04:16:02.241460 [ 29555 ] {} <Fatal> BaseDaemon: 10.3. inlined from ../../ClickHouse/contrib/libcxx/include/memory:891: std::__1::allocator<std::__1::shared_ptr<DB::IProcessor> >::destroy(std::__1::shared_ptr<DB::IProcessor>*)
2021.11.14 04:16:02.241476 [ 29555 ] {} <Fatal> BaseDaemon: 10.4. inlined from ../../ClickHouse/contrib/libcxx/include/__memory/allocator_traits.h:539: void std::__1::allocator_traits<std::__1::allocator<std::__1::shared_ptr<DB::IProcessor> > >::__destroy<std::__1::shared_ptr<DB::IProcessor> >(std::__1::integral_constant<bool, true>, std::__1::allocator<std::__1::shared_ptr<DB::IProcessor> >&, std::__1::shared_ptr<DB::IProcessor>*)
2021.11.14 04:16:02.241488 [ 29555 ] {} <Fatal> BaseDaemon: 10.5. inlined from ../../ClickHouse/contrib/libcxx/include/__memory/allocator_traits.h:487: void std::__1::allocator_traits<std::__1::allocator<std::__1::shared_ptr<DB::IProcessor> > >::destroy<std::__1::shared_ptr<DB::IProcessor> >(std::__1::allocator<std::__1::shared_ptr<DB::IProcessor> >&, std::__1::shared_ptr<DB::IProcessor>*)
2021.11.14 04:16:02.241500 [ 29555 ] {} <Fatal> BaseDaemon: 10.6. inlined from ../../ClickHouse/contrib/libcxx/include/vector:428: std::__1::__vector_base<std::__1::shared_ptr<DB::IProcessor>, std::__1::allocator<std::__1::shared_ptr<DB::IProcessor> > >::__destruct_at_end(std::__1::shared_ptr<DB::IProcessor>*)
2021.11.14 04:16:02.241512 [ 29555 ] {} <Fatal> BaseDaemon: 10.7. inlined from ../../ClickHouse/contrib/libcxx/include/vector:371: std::__1::__vector_base<std::__1::shared_ptr<DB::IProcessor>, std::__1::allocator<std::__1::shared_ptr<DB::IProcessor> > >::clear()
2021.11.14 04:16:02.241521 [ 29555 ] {} <Fatal> BaseDaemon: 10.8. inlined from ../../ClickHouse/contrib/libcxx/include/vector:465: ~__vector_base
2021.11.14 04:16:02.241530 [ 29555 ] {} <Fatal> BaseDaemon: 10.9. inlined from ../../ClickHouse/contrib/libcxx/include/vector:557: ~vector
2021.11.14 04:16:02.241539 [ 29555 ] {} <Fatal> BaseDaemon: 10. ../../ClickHouse/src/QueryPipeline/QueryPipeline.cpp:29: DB::QueryPipeline::~QueryPipeline() @ 0xc3c4f1e in /fasttest-workspace/build/programs/clickhouse
2021.11.14 04:16:03.059015 [ 29555 ] {} <Fatal> BaseDaemon: 11. DB::HashedDictionary<(DB::DictionaryKeyType)1, false>::loadData() @ 0xb0ee745 in /fasttest-workspace/build/programs/clickhouse
2021.11.14 04:16:03.863224 [ 29555 ] {} <Fatal> BaseDaemon: 12. DB::HashedDictionary<(DB::DictionaryKeyType)1, false>::HashedDictionary(DB::StorageID const&, DB::DictionaryStructure const&, std::__1::unique_ptr<DB::IDictionarySource, std::__1::default_delete<DB::IDictionarySource> >, DB::HashedDictionaryStorageConfiguration const&, std::__1::shared_ptr<DB::Block>) @ 0xb0edece in /fasttest-workspace/build/programs/clickhouse
2021.11.14 04:16:04.680358 [ 29555 ] {} <Fatal> BaseDaemon: 13. DB::registerDictionaryHashed(DB::DictionaryFactory&)::$_4::operator()(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::DictionaryStructure const&, Poco::Util::AbstractConfiguration const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::unique_ptr<DB::IDictionarySource, std::__1::default_delete<DB::IDictionarySource> >, DB::DictionaryKeyType, bool) const @ 0xb0e192f in /fasttest-workspace/build/programs/clickhouse
2021.11.14 04:16:05.498845 [ 29555 ] {} <Fatal> BaseDaemon: 14. std::__1::unique_ptr<DB::IDictionary, std::__1::default_delete<DB::IDictionary> > std::__1::__function::__policy_invoker<std::__1::unique_ptr<DB::IDictionary, std::__1::default_delete<DB::IDictionary> > (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::DictionaryStructure const&, Poco::Util::AbstractConfiguration const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::unique_ptr<DB::IDictionarySource, std::__1::default_delete<DB::IDictionarySource> >, std::__1::shared_ptr<DB::Context const>, bool)>::__call_impl<std::__1::__function::__default_alloc_func<DB::registerDictionaryHashed(DB::DictionaryFactory&)::$_2, std::__1::unique_ptr<DB::IDictionary, std::__1::default_delete<DB::IDictionary> > (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::DictionaryStructure const&, Poco::Util::AbstractConfiguration const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::unique_ptr<DB::IDictionarySource, std::__1::default_delete<DB::IDictionarySource> >, std::__1::shared_ptr<DB::Context const>, bool)> >(std::__1::__function::__policy_storage const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::DictionaryStructure const&, Poco::Util::AbstractConfiguration const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::unique_ptr<DB::IDictionarySource, std::__1::default_delete<DB::IDictionarySource> >&&, std::__1::shared_ptr<DB::Context const>&&, bool) @ 0xb0e1e1e in /fasttest-workspace/build/programs/clickhouse
2021.11.14 04:16:05.506302 [ 29555 ] {} <Fatal> BaseDaemon: 15.1. inlined from /fasttest-workspace/build/../../ClickHouse/contrib/libcxx/include/functional:0: std::__1::function<std::__1::unique_ptr<DB::IDictionary, std::__1::default_delete<DB::IDictionary> > (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::DictionaryStructure const&, Poco::Util::AbstractConfiguration const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::unique_ptr<DB::IDictionarySource, std::__1::default_delete<DB::IDictionarySource> >, std::__1::shared_ptr<DB::Context const>, bool)>::operator()(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::DictionaryStructure const&, Poco::Util::AbstractConfiguration const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::unique_ptr<DB::IDictionarySource, std::__1::default_delete<DB::IDictionarySource> >, std::__1::shared_ptr<DB::Context const>, bool) const
2021.11.14 04:16:05.506322 [ 29555 ] {} <Fatal> BaseDaemon: 15. ../../ClickHouse/src/Dictionaries/DictionaryFactory.cpp:58: DB::DictionaryFactory::create(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Util::AbstractConfiguration const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::Context const>, bool) const @ 0xc1278c9 in /fasttest-workspace/build/programs/clickhouse
2021.11.14 04:16:05.514566 [ 29555 ] {} <Fatal> BaseDaemon: 16. /fasttest-workspace/build/../../ClickHouse/src/Interpreters/ExternalDictionariesLoader.cpp:40: DB::ExternalDictionariesLoader::create(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Util::AbstractConfiguration const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const @ 0xc5e1d5e in /fasttest-workspace/build/programs/clickhouse
2021.11.14 04:16:05.553952 [ 29555 ] {} <Fatal> BaseDaemon: 17. /fasttest-workspace/build/../../ClickHouse/src/Interpreters/ExternalLoader.cpp:0: DB::ExternalLoader::LoadingDispatcher::loadSingleObject(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::ExternalLoader::ObjectConfig const&, std::__1::shared_ptr<DB::IExternalLoadable const>) @ 0xc5ebc95 in /fasttest-workspace/build/programs/clickhouse
2021.11.14 04:16:05.580303 [ 29555 ] {} <Fatal> BaseDaemon: 18.1. inlined from /fasttest-workspace/build/../../ClickHouse/contrib/libcxx/include/memory:2851: std::__1::shared_ptr<DB::IExternalLoadable const>::operator bool() const
2021.11.14 04:16:05.580331 [ 29555 ] {} <Fatal> BaseDaemon: 18. ../../ClickHouse/src/Interpreters/ExternalLoader.cpp:999: DB::ExternalLoader::LoadingDispatcher::doLoading(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long, bool, unsigned long, bool, std::__1::shared_ptr<DB::ThreadGroupStatus>) @ 0xc5e9ac0 in /fasttest-workspace/build/programs/clickhouse
2021.11.14 04:16:05.609364 [ 29555 ] {} <Fatal> BaseDaemon: 19. /fasttest-workspace/build/../../ClickHouse/contrib/libcxx/include/type_traits:0: ThreadFromGlobalPool::ThreadFromGlobalPool<void (DB::ExternalLoader::LoadingDispatcher::*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long, bool, unsigned long, bool, std::__1::shared_ptr<DB::ThreadGroupStatus>), DB::ExternalLoader::LoadingDispatcher*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, unsigned long&, bool&, unsigned long&, bool, std::__1::shared_ptr<DB::ThreadGroupStatus> >(void (DB::ExternalLoader::LoadingDispatcher::*&&)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long, bool, unsigned long, bool, std::__1::shared_ptr<DB::ThreadGroupStatus>), DB::ExternalLoader::LoadingDispatcher*&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, unsigned long&, bool&, unsigned long&, bool&&, std::__1::shared_ptr<DB::ThreadGroupStatus>&&)::'lambda'()::operator()() @ 0xc5ee4ef in /fasttest-workspace/build/programs/clickhouse
2021.11.14 04:16:05.619073 [ 29555 ] {} <Fatal> BaseDaemon: 20.1. inlined from /fasttest-workspace/build/../../ClickHouse/contrib/libcxx/include/functional:2210: std::__1::__function::__policy_func<void ()>::operator=(std::nullptr_t)
2021.11.14 04:16:05.619090 [ 29555 ] {} <Fatal> BaseDaemon: 20.2. inlined from ../../ClickHouse/contrib/libcxx/include/functional:2533: std::__1::function<void ()>::operator=(std::nullptr_t)
2021.11.14 04:16:05.619099 [ 29555 ] {} <Fatal> BaseDaemon: 20. ../../ClickHouse/src/Common/ThreadPool.cpp:277: ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) @ 0x5bb690a in /fasttest-workspace/build/programs/clickhouse
2021.11.14 04:16:05.631017 [ 29555 ] {} <Fatal> BaseDaemon: 21.1. inlined from /fasttest-workspace/build/../../ClickHouse/contrib/libcxx/include/memory:1655: std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >::reset(std::__1::__thread_struct*)
2021.11.14 04:16:05.631042 [ 29555 ] {} <Fatal> BaseDaemon: 21.2. inlined from ../../ClickHouse/contrib/libcxx/include/memory:1612: ~unique_ptr
2021.11.14 04:16:05.631061 [ 29555 ] {} <Fatal> BaseDaemon: 21.3. inlined from ../../ClickHouse/contrib/libcxx/include/tuple:181: ~__tuple_leaf
2021.11.14 04:16:05.631070 [ 29555 ] {} <Fatal> BaseDaemon: 21.4. inlined from ../../ClickHouse/contrib/libcxx/include/tuple:477: ~tuple
2021.11.14 04:16:05.631087 [ 29555 ] {} <Fatal> BaseDaemon: 21.5. inlined from ../../ClickHouse/contrib/libcxx/include/memory:1397: std::__1::default_delete<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()> >::operator()(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>*) const
2021.11.14 04:16:05.631104 [ 29555 ] {} <Fatal> BaseDaemon: 21.6. inlined from ../../ClickHouse/contrib/libcxx/include/memory:1658: std::__1::unique_ptr<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>, std::__1::default_delete<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()> > >::reset(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>*)
2021.11.14 04:16:05.631114 [ 29555 ] {} <Fatal> BaseDaemon: 21.7. inlined from ../../ClickHouse/contrib/libcxx/include/memory:1612: ~unique_ptr
2021.11.14 04:16:05.631122 [ 29555 ] {} <Fatal> BaseDaemon: 21. ../../ClickHouse/contrib/libcxx/include/thread:293: void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()> >(void*) @ 0x5bb8cee in /fasttest-workspace/build/programs/clickhouse
2021.11.14 04:16:05.631158 [ 29555 ] {} <Fatal> BaseDaemon: 22. start_thread @ 0x9609 in /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
2021.11.14 04:16:05.631176 [ 29555 ] {} <Fatal> BaseDaemon: 23. clone @ 0x122293 in /usr/lib/x86_64-linux-gnu/libc-2.31.so
2021.11.14 04:16:05.749164 [ 29555 ] {} <Fatal> BaseDaemon: Calculated checksum of the binary: 1264368C5B3E5D6E4C33E50A1D9FFD64. There is no information about the reference checksum.
2021.11.14 04:16:44.389462 [ 19161 ] {} <Fatal> Application: Child process was terminated by signal 6.

@alexey-milovidov
Copy link
Copy Markdown
Member Author

There is inefficient path for allocating and deallocating memory chunks of size 1048591 bytes.

@alexey-milovidov
Copy link
Copy Markdown
Member Author

Something is still wrong with allocations from zlib-ng.

Comment on lines -355 to -161
# Skip INTERFACE library targets, since FOLDER property is not available for them.
get_target_property (_target_type "${_target}" TYPE)
if (_target_type STREQUAL "INTERFACE_LIBRARY")
return ()
endif ()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be changed just to this to fix the issue:

    # Skip aliases and INTERFACE library targets, since FOLDER property is not available for them.
    get_target_property (_target_aliased "${_target}" ALIASED_TARGET)
    get_target_property (_target_type "${_target}" TYPE)
    if (_target_aliased OR _target_type STREQUAL "INTERFACE_LIBRARY")
        return ()
    endif ()

@alexey-milovidov
Copy link
Copy Markdown
Member Author

Test finished.

@alexey-milovidov
Copy link
Copy Markdown
Member Author

Will reopen after @pg83 will help.

@azat
Copy link
Copy Markdown
Member

azat commented Nov 21, 2021

@alexey-milovidov is it just to test this allocator, or it is considered as a real replacement? If yes, what are the benefits?

@alexey-milovidov
Copy link
Copy Markdown
Member Author

Let's try again. The chances it will be merged are low.

@alexey-milovidov
Copy link
Copy Markdown
Member Author

Yes, it gives some improvement, around 3% on average.

@alexey-milovidov
Copy link
Copy Markdown
Member Author

Half of performance comparison runs were killed by OOM killer - most likely due to increased memory consumption.

@alexey-milovidov
Copy link
Copy Markdown
Member Author

Bug related to zlib-ng is still not fixed.

@alexey-milovidov
Copy link
Copy Markdown
Member Author

We need help to make it production ready.

@Bulat-Ziganshin
Copy link
Copy Markdown

I can't understand - if hualloc still consumes 4x more memory as in #31376 (comment) in exchange for 10% speedup - do you expect that customers will approve that exchange?!

@alexey-milovidov
Copy link
Copy Markdown
Member Author

It maybe due to some easy case that will be easy to fix. We just need to figure out - why it has 4x more memory consumption.
I still did not dig into the implementation of this allocator, not sure if I will be able to do.

@alexey-milovidov
Copy link
Copy Markdown
Member Author

Note: the issue with zlib-ng should be definitely trivial to fix.

@alexey-milovidov
Copy link
Copy Markdown
Member Author

in exchange for 10% speedup

For some queries it gives around 1.5x speedup.

@alexey-milovidov
Copy link
Copy Markdown
Member Author

The issue with zlib-ng is fixed.

@alexey-milovidov
Copy link
Copy Markdown
Member Author

@Mergifyio update

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Jan 31, 2022

update

✅ Branch has been successfully updated

@alexey-milovidov
Copy link
Copy Markdown
Member Author

Looks like reclaim thread did not help.

@alexey-milovidov
Copy link
Copy Markdown
Member Author

Let's finally close this PR, because it is difficult to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted pr-performance Pull request with some performance improvements submodule changed At least one submodule changed in this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants