]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
ceph.spec.in: increase the mem_per_job to 3GiB
authorKefu Chai <kchai@redhat.com>
Thu, 3 Jun 2021 12:41:36 +0000 (20:41 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 3 Jun 2021 13:02:33 +0000 (21:02 +0800)
to lower the number of jobs, we are experiencing build failures on
a builder with 48c96t, 193 free mem. the failures were caused by
OOM killer which kills the c++ compiler

[498376.128969] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/system.slice/jenkins.service,task=cc1plus,pid=1387895,uid=1110
[498376.145288] Out of memory: Killed process 1387895 (cc1plus) total-vm:3323312kB, anon-rss:3164568kB, file-rss:0kB, shmem-rss:0kB, UID:1110
[498376.315185] oom_reaper: reaped process 1387895 (cc1plus), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
[498377.882072] cc1plus invoked oom-killer: gfp_mask=0x6200ca(GFP_HIGHUSER_MOVABLE), order=0, oom_score_adj=0

before this change, we use the total memory to calculate the number
of jobs, and assume that each job takes at most 2.5GiB mem. in the
case above, the # of job is 96.

after this change, we use the free memory, and increse the mem per job
to 3.0GiB. in the case above, the # of job would be 85.

Signed-off-by: Kefu Chai <kchai@redhat.com>
ceph.spec.in

index b4a1e68e5ca633aefda0032a882bf1a7ea47a7a3..10a9f3f636ad00834e05feeaf7b738ffc666dcbe 100644 (file)
 
 %define smp_limit_mem_per_job() %( \
   kb_per_job=%1 \
-  kb_total=$(head -1 /proc/meminfo | sed 's/MemTotal:\\s*\\(.*\\) kB.*/\\1/') \
+  kb_total=$(head -3 /proc/meminfo | sed -n 's/MemAvailable:\\s*\\(.*\\) kB.*/\\1/p') \
   jobs=$(( $kb_total / $kb_per_job )) \
   [ $jobs -lt 1 ] && jobs=1 \
   echo $jobs )
 # 32-bit builds can use 3G memory max, which is not enough even for -j2
 %global _smp_ncpus_max 1
 %else
-# 2.5 GiB mem per job
-%global _smp_ncpus_max %{smp_limit_mem_per_job 2500000}
+# 3.0 GiB mem per job
+%global _smp_ncpus_max %{smp_limit_mem_per_job 3000000}
 %endif
 %endif