Skip to content

qemu_template: use more cpus for ARM if available#91

Merged
vbatts merged 1 commit intomainfrom
vbatts/arm
Dec 15, 2020
Merged

qemu_template: use more cpus for ARM if available#91
vbatts merged 1 commit intomainfrom
vbatts/arm

Conversation

@vbatts
Copy link
Copy Markdown
Member

@vbatts vbatts commented Sep 15, 2020

qemu_template: use more cpus for ARM if available

add some logic to provide more CPUs (than hardcoded '1') for ARM.
But don't hog all VM_NCPUS, as we are still emulating them

Signed-off-by: Vincent Batts vbatts@kinvolk.io

How to use

This script will end up in the release artifacts, so I tested this diff running the most recent arm build (2605.1.0)

Testing done

core@flatcar-local ~ $ cat /etc/os-release 
NAME="Flatcar Container Linux by Kinvolk"
ID=flatcar
ID_LIKE=coreos
VERSION=2605.1.0
VERSION_ID=2605.1.0
BUILD_ID=2020-08-31-1924
PRETTY_NAME="Flatcar Container Linux by Kinvolk 2605.1.0 (Oklo)"
ANSI_COLOR="38;5;75"
HOME_URL="https://flatcar-linux.org/"
BUG_REPORT_URL="https://issues.flatcar-linux.org"
FLATCAR_BOARD="arm64-usr"
core@flatcar-local ~ $ lscpu
Architecture:        aarch64
Byte Order:          Little Endian
CPU(s):              4
On-line CPU(s) list: 0-3
Thread(s) per core:  1
Core(s) per socket:  4
Socket(s):           1
NUMA node(s):        1
Vendor ID:           ARM
Model:               0
Model name:          Cortex-A57
Stepping:            r1p0
BogoMIPS:            125.00
NUMA node0 CPU(s):   0-3
Flags:               fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid

But don't hog all `VM_NCPUS`, as we are still emulating them

Signed-off-by: Vincent Batts <vbatts@kinvolk.io>
arm64-usr+*)
set -- -machine virt -cpu cortex-a57 -smp 1 -nographic "$@" ;;
if test "${VM_NCPUS}" -gt 4 ; then
VM_NCPUS=4
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the actual number of CPUs is equal to 4, then the result VM_NCPUS becomes 2.
Isn't it supposed to be -ge 4?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's ok to use 2 if there are just 4 available.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

if test "${VM_NCPUS}" -gt 4 ; then
VM_NCPUS=4
elif test "${VM_NCPUS}" -gt 2 ; then
VM_NCPUS=2
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.
Isn't it supposed to be -ge 2?

@vbatts
Copy link
Copy Markdown
Member Author

vbatts commented Dec 15, 2020

(thanks for the bump. i had forgotten about this PR 😬 )

@vbatts vbatts merged commit d46b95b into main Dec 15, 2020
@vbatts vbatts deleted the vbatts/arm branch December 15, 2020 13:29
Copy link
Copy Markdown
Member

@dongsupark dongsupark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, approve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants