Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions be/src/agent/cgroup_cpu_ctl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ void CgroupCpuCtl::update_cpu_hard_limit(int cpu_hard_limit) {
Status ret = modify_cg_cpu_hard_limit_no_lock(cpu_hard_limit);
if (ret.ok()) {
_cpu_hard_limit = cpu_hard_limit;
} else {
LOG(WARNING) << "update cpu hard limit failed, cpu hard limit: " << cpu_hard_limit
<< ", error: " << ret;
}
}
}
Expand Down Expand Up @@ -337,8 +340,10 @@ Status CgroupV1CpuCtl::modify_cg_cpu_soft_limit_no_lock(int cpu_shares) {
}

Status CgroupV1CpuCtl::modify_cg_cpu_hard_limit_no_lock(int cpu_hard_limit) {
uint64_t val = cpu_hard_limit > 0 ? (_cpu_cfs_period_us * _cpu_core_num * cpu_hard_limit / 100)
: CGROUP_CPU_HARD_LIMIT_DEFAULT_VALUE;
if (cpu_hard_limit <= 0) {
return Status::InternalError<false>("cpu hard limit must be greater than 0");
}
uint64_t val = _cpu_cfs_period_us * _cpu_core_num * cpu_hard_limit / 100;
std::string str_val = std::to_string(val);
std::string msg = "modify cpu quota value to " + str_val;
return CgroupCpuCtl::write_cg_sys_file(_cgroup_v1_cpu_tg_quota_file, str_val, msg, false);
Expand Down Expand Up @@ -399,13 +404,12 @@ Status CgroupV2CpuCtl::init() {
}

Status CgroupV2CpuCtl::modify_cg_cpu_hard_limit_no_lock(int cpu_hard_limit) {
std::string value = "";
if (cpu_hard_limit > 0) {
uint64_t int_val = _cpu_cfs_period_us * _cpu_core_num * cpu_hard_limit / 100;
value = std::to_string(int_val) + " 100000";
} else {
value = CGROUP_V2_CPU_HARD_LIMIT_DEFAULT_VALUE;
if (cpu_hard_limit <= 0) {
return Status::InternalError<false>("cpu hard limit must be greater than 0");
}
std::string value = "";
uint64_t int_val = _cpu_cfs_period_us * _cpu_core_num * cpu_hard_limit / 100;
value = std::to_string(int_val) + " 100000";
std::string msg = "modify cpu.max to [" + value + "]";
return CgroupCpuCtl::write_cg_sys_file(_cgroup_v2_query_wg_cpu_max_file, value, msg, false);
}
Expand Down
4 changes: 0 additions & 4 deletions be/src/agent/cgroup_cpu_ctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@

namespace doris {

// cgroup cpu.cfs_quota_us default value, it means disable cpu hard limit
const static int CGROUP_CPU_HARD_LIMIT_DEFAULT_VALUE = -1;
const static std::string CGROUP_V2_CPU_HARD_LIMIT_DEFAULT_VALUE = "max 100000";

class CgroupCpuCtl {
public:
virtual ~CgroupCpuCtl() = default;
Expand Down
4 changes: 0 additions & 4 deletions be/src/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ set(EXECUTABLE_OUTPUT_PATH "${BUILD_DIR}/src/runtime")

file(GLOB_RECURSE RUNTIME_FILES CONFIGURE_DEPENDS *.cpp *.cc)

if (NOT USE_JEMALLOC OR OS_MACOSX)
list(REMOVE_ITEM RUNTIME_FILES ${CMAKE_CURRENT_SOURCE_DIR}/memory/jemalloc_hook.cpp)
endif()

add_library(Runtime STATIC
${RUNTIME_FILES}
)
Expand Down
4 changes: 0 additions & 4 deletions be/src/runtime/exec_env_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@
#include "io/fs/hdfs/hdfs_mgr.h"
// clang-format on

#include "runtime/memory/tcmalloc_hook.h"

namespace doris {

#include "common/compile_check_begin.h"
Expand Down Expand Up @@ -477,8 +475,6 @@ Status ExecEnv::_init_mem_env() {
init_mem_tracker();
thread_context()->thread_mem_tracker_mgr->init();

init_hook();

if (!BitUtil::IsPowerOf2(config::min_buffer_size)) {
ss << "Config min_buffer_size must be a power-of-two: " << config::min_buffer_size;
return Status::InternalError(ss.str());
Expand Down
227 changes: 0 additions & 227 deletions be/src/runtime/memory/jemalloc_hook.cpp

This file was deleted.

66 changes: 0 additions & 66 deletions be/src/runtime/memory/tcmalloc_hook.h

This file was deleted.

Loading
Loading