Skip to content

Commit

Permalink
Alternate method for detecing CPUs (Needs more tweaking)
Browse files Browse the repository at this point in the history
Signed-off-by: Stewart X Addison <sxa@redhat.com>
  • Loading branch information
sxa committed Mar 9, 2021
1 parent ed1d3fa commit 393539f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openjdk/openjdk.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 393539f

Please sign in to comment.