wangbo commented on code in PR #54243:
URL: https://github.com/apache/doris/pull/54243#discussion_r2253934966


##########
be/src/agent/cgroup_cpu_ctl.cpp:
##########
@@ -340,10 +353,12 @@ 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) {
-    if (cpu_hard_limit <= 0) {
-        return Status::InternalError<false>("cpu hard limit must be greater 
than 0");
+    // If cpu_hard_limit == 0, we do not know the actual behavior of CGroup
+    // just set it to 1% of the cpu core.
+    uint64_t val = _cpu_cfs_period_us / 100;

Review Comment:
   we'd better set cpu_hard_limit=-1 when input value is 0 or an invalid value. 
it's cgroup's default value.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to