From 393539fe5407354368007a216b66d6425e6aac38 Mon Sep 17 00:00:00 2001 From: Stewart X Addison Date: Tue, 9 Mar 2021 18:29:22 +0000 Subject: [PATCH] Alternate method for detecing CPUs (Needs more tweaking) Signed-off-by: Stewart X Addison --- openjdk/openjdk.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openjdk/openjdk.mk b/openjdk/openjdk.mk index 3916683e89..972a61643a 100644 --- a/openjdk/openjdk.mk +++ b/openjdk/openjdk.mk @@ -18,7 +18,7 @@ MEMORY_SIZE:=1024 OS:=$(shell uname -s) ifeq ($(OS),Linux) - NPROCS:=$(shell KPROCS=`grep -c ^processor /proc/cpuinfo`; CGPROCS=`if [ -r /sys/fs/cgroup/cpu,cpuacct/cgroup.procs ]; then wc -l < /sys/fs/cgroup/cpu,cpuacct/cgroup.procs; else echo "$$KPROCS"; fi`; if [ "$${KPROCS}" -lt "$${CGPROCS}" ]; then echo "$${KPROCS}"; else echo "$${CGPROCS}"; fi) + NPROCS:=$(shell KPROCS=`grep -c ^processor /proc/cpuinfo`; CGPROCS=`if [ -r /sys/fs/cgroup/cpu/cpu.cfs_quota_us ]; then cat /sys/fs/cgroup/cpu/cpu.cfs_quota_us | sed 's/......$$//g'; else echo "$$KPROCS"; fi`; if [ "$${KPROCS}" -lt "$${CGPROCS}" ]; then echo "$${KPROCS}"; else echo "$${CGPROCS}"; fi) MEMORY_SIZE:=$(shell KMEMMB=`awk '/^MemTotal:/{print int($$2/1024)}' /proc/meminfo`; if [ -r /sys/fs/cgroup/memory/memory.limit_in_bytes]; then CGMEM=`cat /sys/fs/cgroup/memory/memory.limit_in_bytes`; else CGMEM=`expr $${KMEMMB} \* 1024`; fi; CGMEMMB=`expr $${CGMEM} / 1048576`; if [ "$${KMEMMB}" -lt "$${CGMEMMB}" ]; then echo "$${KMEMMB}"; else echo "$${CGMEMMB}"; fi) endif ifeq ($(OS),Darwin)