From 7213811dd0ec53c13f96db8c14aaab55bf5a4596 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 25 Jun 2021 13:29:23 +0800 Subject: [PATCH] ceph.spec.in: increase memory per core to 3000MB on SUSE distros in the KVM instance offered by OBS, we have [ 346s] + cat /proc/meminfo [ 347s] MemTotal: 10167736 kB [ 347s] MemFree: 4983964 kB [ 347s] MemAvailable: 9826800 kB [ 347s] Buffers: 85856 kB [ 347s] Cached: 4615192 kB [ 347s] SwapCached: 0 kB ... [ 347s] SwapTotal: 2097148 kB and its number of hardware threads is [ 346s] ++ /usr/bin/getconf _NPROCESSORS_ONLN [ 346s] + _threads=8 so ($MemTotal+$SwapTotal)/1024/2600 = 4.6, which is less than the # of threads, so "4" was used for the number of jobs. but per our recent observation in 38be14bc0fa32be6877dea08ebd35495d39e464f, some compiling jobs could take up to 3GB. in the OOM failure in OBS, we had [24915s] [24848.843594] Out of memory: Killed process 16894 (cc1plus) total-vm:4293756kB, anon-rss:2970012kB, file-rss:0kB, shmem-rss:0kB, UID:399 pgtables:8324kB oom_score_adj:0 where 4GiB memory was allocated, in which 3GiB was mapped into memory. this matches with our findings. in this change, the memory per core is bumped up to 3000MB in hope to address the OOB. the downside of this change is that it would take even longer to finish the build if the building host is limited in memory. Signed-off-by: Kefu Chai --- ceph.spec.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ceph.spec.in b/ceph.spec.in index 7bc9b599d4e1..f89a169862ca 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -138,6 +138,8 @@ %global _smp_ncpus_max 1 %else # 3.0 GiB mem per job +# SUSE distros use %limit_build in the place of smp_limit_mem_per_job, please +# be sure to update it as well when changing this number. %global _smp_ncpus_max %{smp_limit_mem_per_job 3000000} %endif %endif @@ -1253,7 +1255,7 @@ done %endif %if 0%{?suse_version} -%limit_build -m 2600 +%limit_build -m 3000 %endif export CPPFLAGS="$java_inc" -- 2.47.3