Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable more virtual cores for x86 #17

Merged
merged 2 commits into from
May 20, 2020
Merged

enable more virtual cores for x86 #17

merged 2 commits into from
May 20, 2020

Conversation

nickdesaulniers
Copy link
Member

The unit tests enabled via CONFIG_KCSAN_TEST require >1 CPU to run.
Enable more cpu's via QEMU's -smp <n> command line flag.

Not sure if we should just do this for all ARCHs and if we should use a
value like 8 or min(nproc, 8).

Signed-off-by: Nick Desaulniers ndesaulniers@google.com

The unit tests enabled via CONFIG_KCSAN_TEST require >1 CPU to run.
Enable more cpu's via QEMU's `-smp <n>` command line flag.

Not sure if we should just do this for all ARCHs and if we should use a
value like 8 or min(nproc, 8).

Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
@nickdesaulniers
Copy link
Member Author

or maybe we should only do this for interactive mode? Though most systems these days have more than one core, so I would prefer to test that.

@nickdesaulniers
Copy link
Member Author

also, I think nproc on travisci for us is 2.

Copy link
Member

@msfjarvis msfjarvis left a comment

Choose a reason for hiding this comment

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

LGTM

@nathanchance
Copy link
Member

We could start with $(nproc) and scale up or down from there.

If we encounter issues, we could do something like $(nproc) / 2.

@nathanchance
Copy link
Member

Also, do we want to do this for all machines? Or just x86?

@nickdesaulniers
Copy link
Member Author

Also, do we want to do this for all machines?

yeah might as well, let me send a fix

@nickdesaulniers
Copy link
Member Author

Looks like for 32b x86, we'll get:

NR_CPUS/possible_cpus limit of 8 reached. Processor 72/0x8 ignored.

@arndb
Copy link

arndb commented May 18, 2020

CONFIG_BIGSMP=y should allow 32 or 64 CPUs

@nickdesaulniers
Copy link
Member Author

Also, do we want to do this for all machines? Or just x86?

Done, please re-review.

@nathanchance
Copy link
Member

qemu-system-arm: Invalid SMP CPUs 48. The max CPUs supported by machine 'palmetto-bmc' is 2

When trying multi_v5_defconfig. Seems we have to do just 2 to avoid changing a bunch of configs.

@arndb
Copy link

arndb commented May 19, 2020

qemu-system-arm: Invalid SMP CPUs 48. The max CPUs supported by machine 'palmetto-bmc' is 2

When trying multi_v5_defconfig. Seems we have to do just 2 to avoid changing a bunch of configs.

ARMv5 has no SMP support at all, it only works in ARMv6K or higher.

@nickdesaulniers
Copy link
Member Author

ok, dropped the latest patch (kept them separate since we can squash+merge in github UI). I only really care about this for x86_64 ATM. If that changes, or we feel strongly about it, we can change it. Otherwise YAGNI.

@nickdesaulniers nickdesaulniers merged commit b0f17a2 into master May 20, 2020
@nickdesaulniers nickdesaulniers deleted the smp_nproc branch May 20, 2020 22:14
nathanchance added a commit to nathanchance/boot-utils that referenced this pull request Mar 11, 2022
As noted on the review for ClangBuiltLinux#17, when booting an i386_defconfig kernel,
there is a lot of spam in the boot logs because CONFIG_NR_CPUS is set to
8:

[    0.020644] APIC: NR_CPUS/possible_cpus limit of 8 reached. Processor 8/0x8 ignored.
[    0.021302] APIC: NR_CPUS/possible_cpus limit of 8 reached. Processor 9/0x9 ignored.
[    0.021964] APIC: NR_CPUS/possible_cpus limit of 8 reached. Processor 10/0xa ignored.
[    0.022642] APIC: NR_CPUS/possible_cpus limit of 8 reached. Processor 11/0xb ignored.

With large machines, this can be quite noisy.

Refactor the logic for finding a sensible value based on CONFIG_NR_CPUS
if a config can be found or defaulting to 8 if not.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
nathanchance added a commit to nathanchance/boot-utils that referenced this pull request Mar 11, 2022
As noted on the review for ClangBuiltLinux#17, when booting an i386_defconfig kernel,
there is a lot of spam in the boot logs because CONFIG_NR_CPUS is set to
8:

[    0.020644] APIC: NR_CPUS/possible_cpus limit of 8 reached. Processor 8/0x8 ignored.
[    0.021302] APIC: NR_CPUS/possible_cpus limit of 8 reached. Processor 9/0x9 ignored.
[    0.021964] APIC: NR_CPUS/possible_cpus limit of 8 reached. Processor 10/0xa ignored.
[    0.022642] APIC: NR_CPUS/possible_cpus limit of 8 reached. Processor 11/0xb ignored.

With large machines, this can be quite noisy, as there is one print out
for every CPU above 8.

Refactor the logic for finding a sensible value based on CONFIG_NR_CPUS
if a config can be found. If no config is available, default to 8, which
is the default value for i386_defconfig.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
nathanchance added a commit to nathanchance/boot-utils that referenced this pull request Mar 14, 2022
As noted on the review for ClangBuiltLinux#17, when booting an i386_defconfig kernel,
there is a lot of spam in the boot logs because CONFIG_NR_CPUS is set to
8:

[    0.020644] APIC: NR_CPUS/possible_cpus limit of 8 reached. Processor 8/0x8 ignored.
[    0.021302] APIC: NR_CPUS/possible_cpus limit of 8 reached. Processor 9/0x9 ignored.
[    0.021964] APIC: NR_CPUS/possible_cpus limit of 8 reached. Processor 10/0xa ignored.
[    0.022642] APIC: NR_CPUS/possible_cpus limit of 8 reached. Processor 11/0xb ignored.

With large machines, this can be quite noisy, as there is one print out
for every CPU above 8.

Refactor the logic for finding a sensible value based on CONFIG_NR_CPUS
if a config can be found. If no config is available, default to 8, which
is the default value for i386_defconfig.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
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.

None yet

4 participants