x86/xen: Calculate __max_logical_packages on PV domains
Subsystems (3)
PATCH 1/1 x86/xen: Calculate __max_logical_packages on PV domains
The kernel panics on PV domains because native_smp_cpus_done() is only called for HVM domains.
Calculate __max_logical_packages for PV domains.
--- arch/x86/include/asm/smp.h | 1 + arch/x86/kernel/smpboot.c | 10 ++++++++-- arch/x86/xen/smp.c | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-)
arch/x86/include/asm/smp.h +1 -0
@@ -129,6 +129,7 @@ static inline void arch_send_call_function_ipi_mask(const struct cpumask *mask)void cpu_disable_common (void );void native_smp_prepare_boot_cpu (void );void native_smp_prepare_cpus (unsigned int max_cpus); +void calculate_max_logical_packages (void );void native_smp_cpus_done (unsigned int max_cpus);void common_cpu_up (unsigned int cpunum,struct task_struct *tidle);int native_cpu_up (unsigned int cpunum,struct task_struct *tidle);
arch/x86/kernel/smpboot.c +8 -2
@@ -1281,11 +1281,10 @@ void __init native_smp_prepare_boot_cpu(void)cpu_set_state_online (me); } -void __init native_smp_cpus_done (unsigned int max_cpus) +void __init calculate_max_logical_packages (void ) {int ncpus; -pr_debug ("Boot done\n" );/* * Today neither Intel nor AMD support heterogenous systems so * extrapolate the boot cpu's data to all packages.
@@ -1293,6 +1292,13 @@ void __init native_smp_cpus_done(unsigned int max_cpus) ncpus =cpu_data (0 ).booted_cores *topology_max_smt_threads (); __max_logical_packages =DIV_ROUND_UP (nr_cpu_ids, ncpus);pr_info ("Max logical packages: %u\n" , __max_logical_packages); +} + +void __init native_smp_cpus_done (unsigned int max_cpus) +{ +pr_debug ("Boot done\n" ); + +calculate_max_logical_packages ();if (x86_has_numa_in_package)set_sched_topology (x86_numa_in_package_topology);
arch/x86/xen/smp.c +2 -0
@@ -122,6 +122,8 @@ void __init xen_smp_cpus_done(unsigned int max_cpus)if (xen_hvm_domain ())native_smp_cpus_done (max_cpus); +else +calculate_max_logical_packages ();if (xen_have_vcpu_info_placement)return ;
Signature · 1 line
2.15.0.rc0.39.g2f0e14e64
Quoted 14 lines · Prarit Bhargava
The kernel panics on PV domains because
native_smp_cpus_done()is only called for HVM domains.Calculate
__max_logical_packagesfor PV domains.Fixes b4c0a7326f5d ("x86/smpboot: Fix __max_logical_packages estimate")Signed-off-by Prarit Bhargava <[email protected]>Tested-and-reported-by Simon Gaiser <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Ingo Molnar <[email protected]>Cc "H. Peter Anvin" <[email protected]>Cc Boris Ostrovsky <[email protected]>Cc Juergen Gross <[email protected]>
Quoted 8 lines
Cc Dou Liyang <[email protected]>Cc Prarit Bhargava <[email protected]>Cc Kate Stewart <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Cc Andy Lutomirski <[email protected]>Cc Andi Kleen <[email protected]>Cc Vitaly Kuznetsov <[email protected]>
(+ Simon)
Quoted 63 lines
--- arch/x86/include/asm/smp.h | 1 + arch/x86/kernel/smpboot.c | 10 ++++++++-- arch/x86/xen/smp.c | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-)arch/x86/include/asm/smp.h +1
-0@@ -129,6 +129,7 @@ static inline void arch_send_call_function_ipi_mask(const struct cpumask *mask)void cpu_disable_common (void );void native_smp_prepare_boot_cpu (void );void native_smp_prepare_cpus (unsigned int max_cpus); +void calculate_max_logical_packages (void );void native_smp_cpus_done (unsigned int max_cpus);void common_cpu_up (unsigned int cpunum,struct task_struct *tidle);int native_cpu_up (unsigned int cpunum,struct task_struct *tidle);arch/x86/kernel/smpboot.c +8
-2@@ -1281,11 +1281,10 @@ void __init native_smp_prepare_boot_cpu(void)cpu_set_state_online (me); } -void __init native_smp_cpus_done (unsigned int max_cpus) +void __init calculate_max_logical_packages (void ) {int ncpus; -pr_debug ("Boot done\n" );/* * Today neither Intel nor AMD support heterogenous systems so * extrapolate the boot cpu's data to all packages. @@ -1293,6 +1292,13 @@ void __init native_smp_cpus_done(unsigned int max_cpus) ncpus =cpu_data (0 ).booted_cores *topology_max_smt_threads (); __max_logical_packages =DIV_ROUND_UP (nr_cpu_ids, ncpus);pr_info ("Max logical packages: %u\n" , __max_logical_packages); +} + +void __init native_smp_cpus_done (unsigned int max_cpus) +{ +pr_debug ("Boot done\n" ); + +calculate_max_logical_packages ();if (x86_has_numa_in_package)set_sched_topology (x86_numa_in_package_topology);arch/x86/xen/smp.c +2
-0@@ -122,6 +122,8 @@ void __init xen_smp_cpus_done(unsigned int max_cpus)if (xen_hvm_domain ())native_smp_cpus_done (max_cpus); +else +calculate_max_logical_packages ();if (xen_have_vcpu_info_placement)return ;
Juergen Gross
maintainerQuoted 27 lines · Boris Ostrovsky
Quoted 14 lines · Prarit Bhargava
The kernel panics on PV domains because
native_smp_cpus_done()is only called for HVM domains.Calculate
__max_logical_packagesfor PV domains.Fixes b4c0a7326f5d ("x86/smpboot: Fix __max_logical_packages estimate")Signed-off-by Prarit Bhargava <[email protected]>Tested-and-reported-by Simon Gaiser <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Ingo Molnar <[email protected]>Cc "H. Peter Anvin" <[email protected]>Cc Boris Ostrovsky <[email protected]>Cc Juergen Gross <[email protected]>Quoted 8 lines
Cc Dou Liyang <[email protected]>Cc Prarit Bhargava <[email protected]>Cc Kate Stewart <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Cc Andy Lutomirski <[email protected]>Cc Andi Kleen <[email protected]>Cc Vitaly Kuznetsov <[email protected]>
Quoted 1 line
Reviewed-by Boris Ostrovsky <[email protected]>
Thomas, Ingo, are you taking this via the tip tree or should I take it via the xen tree?
Juergen
Ingo Molnar
Acked-byQuoted 28 lines · Juergen Gross
Quoted 27 lines · Boris Ostrovsky
Quoted 22 lines · Prarit Bhargava
The kernel panics on PV domains because
native_smp_cpus_done()is only called for HVM domains.Calculate
__max_logical_packagesfor PV domains.Fixes b4c0a7326f5d ("x86/smpboot: Fix __max_logical_packages estimate")Signed-off-by Prarit Bhargava <[email protected]>Tested-and-reported-by Simon Gaiser <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Ingo Molnar <[email protected]>Cc "H. Peter Anvin" <[email protected]>Cc Boris Ostrovsky <[email protected]>Cc Juergen Gross <[email protected]>Cc Dou Liyang <[email protected]>Cc Prarit Bhargava <[email protected]>Cc Kate Stewart <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Cc Andy Lutomirski <[email protected]>Cc Andi Kleen <[email protected]>Cc Vitaly Kuznetsov <[email protected]>
Quoted 4 lines
Quoted 1 line
Reviewed-by Boris Ostrovsky <[email protected]>Thomas, Ingo, are you taking this via the tip tree or should I take it via the xen tree?
Since it's supposed to only affect Xen feel free to pick it up:
Thanks,
Ingo
Juergen Gross
maintainerQuoted 27 lines · Boris Ostrovsky
Quoted 14 lines · Prarit Bhargava
The kernel panics on PV domains because
native_smp_cpus_done()is only called for HVM domains.Calculate
__max_logical_packagesfor PV domains.Fixes b4c0a7326f5d ("x86/smpboot: Fix __max_logical_packages estimate")Signed-off-by Prarit Bhargava <[email protected]>Tested-and-reported-by Simon Gaiser <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Ingo Molnar <[email protected]>Cc "H. Peter Anvin" <[email protected]>Cc Boris Ostrovsky <[email protected]>Cc Juergen Gross <[email protected]>Quoted 8 lines
Cc Dou Liyang <[email protected]>Cc Prarit Bhargava <[email protected]>Cc Kate Stewart <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Cc Andy Lutomirski <[email protected]>Cc Andi Kleen <[email protected]>Cc Vitaly Kuznetsov <[email protected]>
Quoted 1 line
Reviewed-by Boris Ostrovsky <[email protected]>
Thomas, Ingo, are you taking this via the tip tree or should I take it via the xen tree?
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Boris Ostrovsky:
Quoted 25 lines · Prarit Bhargava
Quoted 14 lines
The kernel panics on PV domains because
native_smp_cpus_done()is only called for HVM domains.Calculate
__max_logical_packagesfor PV domains.Fixes b4c0a7326f5d ("x86/smpboot: Fix __max_logical_packages estimate")Signed-off-by Prarit Bhargava <[email protected]>Tested-and-reported-by Simon Gaiser <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Ingo Molnar <[email protected]>Cc "H. Peter Anvin" <[email protected]>Cc Boris Ostrovsky <[email protected]>Cc Juergen Gross <[email protected]>Quoted 8 lines
Cc Dou Liyang <[email protected]>Cc Prarit Bhargava <[email protected]>Cc Kate Stewart <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Cc Andy Lutomirski <[email protected]>Cc Andi Kleen <[email protected]>Cc Vitaly Kuznetsov <[email protected]>
Quoted 1 line
Reviewed-by Boris Ostrovsky <[email protected]>
The fixed bug is in 4.15 so it should get into stable. It's 63e708f826bb21470155d37b103a75d8a9e25b18 upstream.
Boris Ostrovsky:
Quoted 25 lines · Prarit Bhargava
Quoted 14 lines
The kernel panics on PV domains because
native_smp_cpus_done()is only called for HVM domains.Calculate
__max_logical_packagesfor PV domains.Fixes b4c0a7326f5d ("x86/smpboot: Fix __max_logical_packages estimate")Signed-off-by Prarit Bhargava <[email protected]>Tested-and-reported-by Simon Gaiser <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Ingo Molnar <[email protected]>Cc "H. Peter Anvin" <[email protected]>Cc Boris Ostrovsky <[email protected]>Cc Juergen Gross <[email protected]>Quoted 8 lines
Cc Dou Liyang <[email protected]>Cc Prarit Bhargava <[email protected]>Cc Kate Stewart <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Cc Andy Lutomirski <[email protected]>Cc Andi Kleen <[email protected]>Cc Vitaly Kuznetsov <[email protected]>
Quoted 1 line
Reviewed-by Boris Ostrovsky <[email protected]>
The fixed bug is in 4.15 so it should get into stable. It's 63e708f826bb21470155d37b103a75d8a9e25b18 upstream.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 14 lines · Prarit Bhargava
The kernel panics on PV domains because
native_smp_cpus_done()is only called for HVM domains.Calculate
__max_logical_packagesfor PV domains.Fixes b4c0a7326f5d ("x86/smpboot: Fix __max_logical_packages estimate")Signed-off-by Prarit Bhargava <[email protected]>Tested-and-reported-by Simon Gaiser <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Ingo Molnar <[email protected]>Cc "H. Peter Anvin" <[email protected]>Cc Boris Ostrovsky <[email protected]>Cc Juergen Gross <[email protected]>
Quoted 8 lines
Cc Dou Liyang <[email protected]>Cc Prarit Bhargava <[email protected]>Cc Kate Stewart <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Cc Andy Lutomirski <[email protected]>Cc Andi Kleen <[email protected]>Cc Vitaly Kuznetsov <[email protected]>
(+ Simon)
Quoted 55 lines
--- arch/x86/include/asm/smp.h | 1 + arch/x86/kernel/smpboot.c | 10 ++++++++-- arch/x86/xen/smp.c | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-)arch/x86/include/asm/smp.h +1
-0@@ -129,6 +129,7 @@ static inline void arch_send_call_function_ipi_mask(const struct cpumask *mask)void cpu_disable_common (void );void native_smp_prepare_boot_cpu (void );void native_smp_prepare_cpus (unsigned int max_cpus); +void calculate_max_logical_packages (void );void native_smp_cpus_done (unsigned int max_cpus);void common_cpu_up (unsigned int cpunum,struct task_struct *tidle);int native_cpu_up (unsigned int cpunum,struct task_struct *tidle);arch/x86/kernel/smpboot.c +8
-2@@ -1281,11 +1281,10 @@ void __init native_smp_prepare_boot_cpu(void)cpu_set_state_online (me); } -void __init native_smp_cpus_done (unsigned int max_cpus) +void __init calculate_max_logical_packages (void ) {int ncpus; -pr_debug ("Boot done\n" );/* * Today neither Intel nor AMD support heterogenous systems so * extrapolate the boot cpu's data to all packages. @@ -1293,6 +1292,13 @@ void __init native_smp_cpus_done(unsigned int max_cpus) ncpus =cpu_data (0 ).booted_cores *topology_max_smt_threads (); __max_logical_packages =DIV_ROUND_UP (nr_cpu_ids, ncpus);pr_info ("Max logical packages: %u\n" , __max_logical_packages); +} + +void __init native_smp_cpus_done (unsigned int max_cpus) +{ +pr_debug ("Boot done\n" ); + +calculate_max_logical_packages ();if (x86_has_numa_in_package)set_sched_topology (x86_numa_in_package_topology);arch/x86/xen/smp.c +0
-0
arch/x86/xen/smp.c void __init xen_smp_cpus_done(unsigned int max_cpus) · line 129
Quoted 8 lines
arch/x86/xen/smp.c +2
-0@@ -122,6 +122,8 @@ void __init xen_smp_cpus_done(unsigned int max_cpus)if (xen_hvm_domain ())native_smp_cpus_done (max_cpus); +else +calculate_max_logical_packages ();if (xen_have_vcpu_info_placement)return ;
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Juergen Gross
maintainerQuoted 14 lines · Prarit Bhargava
The kernel panics on PV domains because
native_smp_cpus_done()is only called for HVM domains.Calculate
__max_logical_packagesfor PV domains.Fixes b4c0a7326f5d ("x86/smpboot: Fix __max_logical_packages estimate")Signed-off-by Prarit Bhargava <[email protected]>Tested-and-reported-by Simon Gaiser <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Ingo Molnar <[email protected]>Cc "H. Peter Anvin" <[email protected]>Cc Boris Ostrovsky <[email protected]>Cc Juergen Gross <[email protected]>
Quoted 8 lines
Cc Dou Liyang <[email protected]>Cc Prarit Bhargava <[email protected]>Cc Kate Stewart <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Cc Andy Lutomirski <[email protected]>Cc Andi Kleen <[email protected]>Cc Vitaly Kuznetsov <[email protected]>
Committed to xen.tip for-linus-4.16
Juergen
Juergen Gross
maintainerQuoted 14 lines · Prarit Bhargava
The kernel panics on PV domains because
native_smp_cpus_done()is only called for HVM domains.Calculate
__max_logical_packagesfor PV domains.Fixes b4c0a7326f5d ("x86/smpboot: Fix __max_logical_packages estimate")Signed-off-by Prarit Bhargava <[email protected]>Tested-and-reported-by Simon Gaiser <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Ingo Molnar <[email protected]>Cc "H. Peter Anvin" <[email protected]>Cc Boris Ostrovsky <[email protected]>Cc Juergen Gross <[email protected]>
Quoted 8 lines
Cc Dou Liyang <[email protected]>Cc Prarit Bhargava <[email protected]>Cc Kate Stewart <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Cc Andy Lutomirski <[email protected]>Cc Andi Kleen <[email protected]>Cc Vitaly Kuznetsov <[email protected]>
Committed to xen.tip for-linus-4.16
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel