Bug 210213 - vCPUs >= 64 can't be online and hotplugged in some scenarios
Summary: vCPUs >= 64 can't be online and hotplugged in some scenarios
Status: NEW
Alias: None
Product: Virtualization
Classification: Unclassified
Component: kvm (show other bugs)
Hardware: x86-64 Linux
: P1 normal
Assignee: virtualization_kvm
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-16 03:27 UTC by Zelin Deng
Modified: 2020-11-16 03:27 UTC (History)
0 users

See Also:
Kernel Version: 5.10-rc4
Tree: Mainline
Regression: No


Attachments
Here is a workaround to fix this issue (2.03 KB, application/mbox)
2020-11-16 03:27 UTC, Zelin Deng
Details

Description Zelin Deng 2020-11-16 03:27:36 UTC
Created attachment 293685 [details]
Here is a workaround to fix this issue

In VM, if no-kvmclock-vsyscall is set, lscpu shows online 0-63 vcpus are online vcpus >= 64 are offline and if we attempting to hotplug them, they will return -ENOMEM.
This issue also happened in VM which are on TSC unstable host.
 bash-14295 [040] .... 64209.953702: cpuhp_enter: cpu: 0064 target: 199 step:  64 (kvmclock_setup_percpu)
            bash-14295 [040] .... 64209.953702: cpuhp_exit:  cpu: 0064  state:  64 step:  64 ret: -12
----------------------------

[root@iZwz9208df47apaoyvbmm3Z processor]# cat /sys/kernel/debug/tracing/trace
# tracer: nop
#
# entries-in-buffer/entries-written: 166/166   #P:49
#
#                              _-----=> irqs-off
#                             / _----=> need-resched
#                            | / _---=> hardirq/softirq
#                            || / _--=> preempt-depth
#                            ||| /     delay
#           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
#              | |       |   ||||       |         |
            bash-14295 [040] .... 64209.953675: cpuhp_enter: cpu: 0064 target: 199 step:   1 (smpboot_create_threads)
            bash-14295 [040] .... 64209.953676: cpuhp_exit:  cpu: 0064  state:   1 step:   1 ret: 0
            bash-14295 [040] .... 64209.953676: cpuhp_enter: cpu: 0064 target: 199 step:   2 (perf_event_init_cpu)
            bash-14295 [040] .... 64209.953677: cpuhp_exit:  cpu: 0064  state:   2 step:   2 ret: 0
            bash-14295 [040] .... 64209.953678: cpuhp_enter: cpu: 0064 target: 199 step:  35 (workqueue_prepare_cpu)
            bash-14295 [040] .... 64209.953678: cpuhp_exit:  cpu: 0064  state:  35 step:  35 ret: 0
            bash-14295 [040] .... 64209.953678: cpuhp_enter: cpu: 0064 target: 199 step:  37 (hrtimers_prepare_cpu)
            bash-14295 [040] .... 64209.953679: cpuhp_exit:  cpu: 0064  state:  37 step:  37 ret: 0
            bash-14295 [040] .... 64209.953679: cpuhp_enter: cpu: 0064 target: 199 step:  40 (smpcfd_prepare_cpu)
            bash-14295 [040] .... 64209.953692: cpuhp_exit:  cpu: 0064  state:  40 step:  40 ret: 0
            bash-14295 [040] .... 64209.953693: cpuhp_enter: cpu: 0064 target: 199 step:  41 (relay_prepare_cpu)
            bash-14295 [040] .... 64209.953693: cpuhp_exit:  cpu: 0064  state:  41 step:  41 ret: 0
            bash-14295 [040] .... 64209.953693: cpuhp_enter: cpu: 0064 target: 199 step:  44 (rcutree_prepare_cpu)
            bash-14295 [040] .... 64209.953694: cpuhp_exit:  cpu: 0064  state:  44 step:  44 ret: 0
            bash-14295 [040] .... 64209.953694: cpuhp_enter: cpu: 0064 target: 199 step:  53 (topology_add_dev)
            bash-14295 [040] .... 64209.953699: cpuhp_exit:  cpu: 0064  state:  53 step:  53 ret: 0
            bash-14295 [040] .... 64209.953700: cpuhp_multi_enter: cpu: 0064 target: 199 step:  56 (trace_rb_cpu_prepare)
            bash-14295 [040] .... 64209.953700: cpuhp_exit:  cpu: 0064  state:  56 step:  56 ret: 0
            bash-14295 [040] .... 64209.953700: cpuhp_multi_enter: cpu: 0064 target: 199 step:  56 (trace_rb_cpu_prepare)
            bash-14295 [040] .... 64209.953700: cpuhp_exit:  cpu: 0064  state:  56 step:  56 ret: 0
            bash-14295 [040] .... 64209.953701: cpuhp_multi_enter: cpu: 0064 target: 199 step:  56 (trace_rb_cpu_prepare)
            bash-14295 [040] .... 64209.953701: cpuhp_exit:  cpu: 0064  state:  56 step:  56 ret: 0
            bash-14295 [040] .... 64209.953701: cpuhp_enter: cpu: 0064 target: 199 step:  62 (timers_prepare_cpu)
            bash-14295 [040] .... 64209.953701: cpuhp_exit:  cpu: 0064  state:  62 step:  62 ret: 0
            bash-14295 [040] .... 64209.953702: cpuhp_enter: cpu: 0064 target: 199 step:  64 (kvmclock_setup_percpu)
            bash-14295 [040] .... 64209.953702: cpuhp_exit:  cpu: 0064  state:  64 step:  64 ret: -12

Note You need to log in before you can comment on or make changes to this bug.