This is an automated email from the ASF dual-hosted git repository. morningman pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push: new 9f7c76a0d6 [fix](memtracker) Fix the usage of bthread mem tracker (#13708) 9f7c76a0d6 is described below commit 9f7c76a0d68b170f6239a7d19d864f937893a469 Author: Xinyi Zou <zouxiny...@gmail.com> AuthorDate: Sun Oct 30 19:51:00 2022 +0800 [fix](memtracker) Fix the usage of bthread mem tracker (#13708) bthead context init has performance loss, temporarily delete it first, it will be completely refactored in #13585. --- be/src/runtime/thread_context.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/be/src/runtime/thread_context.h b/be/src/runtime/thread_context.h index 20a0b074c1..861b3e0567 100644 --- a/be/src/runtime/thread_context.h +++ b/be/src/runtime/thread_context.h @@ -249,19 +249,8 @@ static void attach_bthread() { #endif // Create thread-local data on demand. bthread_context = new ThreadContext; - std::shared_ptr<MemTrackerLimiter> btls_tracker = - std::make_shared<MemTrackerLimiter>(-1, "Bthread:id=" + std::to_string(bthread_id), - ExecEnv::GetInstance()->bthread_mem_tracker()); - bthread_context->attach_task(ThreadContext::TaskType::BRPC, "", TUniqueId(), btls_tracker); // set the data so that next time bthread_getspecific in the thread returns the data. CHECK_EQ(0, bthread_setspecific(btls_key, bthread_context)); - } else { - // two scenarios: - // 1. A new bthread starts, but get a reuses btls. - // 2. A pthread switch occurs. Because the pthread switch cannot be accurately identified at the moment. - // So tracker call reset 0 like reuses btls. - DCHECK(bthread_context->_thread_mem_tracker_mgr->get_attach_layers() == 2); - bthread_context->_thread_mem_tracker_mgr->limiter_mem_tracker_raw()->reset_zero(); } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org