* [PATCH] x86/xen: Calculate __max_logical_packages on PV domains
@ 2018-02-07 23:49 Prarit Bhargava
2018-02-08 0:59 ` Boris Ostrovsky
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: Prarit Bhargava @ 2018-02-07 23:49 UTC (permalink / raw)
To: linux-kernel
Cc: Prarit Bhargava, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
x86, Boris Ostrovsky, Juergen Gross, Dou Liyang, Kate Stewart,
Greg Kroah-Hartman, Andy Lutomirski, Andi Kleen,
Vitaly Kuznetsov, xen-devel
The kernel panics on PV domains because native_smp_cpus_done() is
only called for HVM domains.
Calculate __max_logical_packages for PV domains.
Fixes: b4c0a7326f5d ("x86/smpboot: Fix __max_logical_packages estimate")
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Tested-and-reported-by: Simon Gaiser <simon@invisiblethingslab.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Dou Liyang <douly.fnst@cn.fujitsu.com>
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: xen-devel@lists.xenproject.org
---
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(-)
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
index 461f53d27708..a4189762b266 100644
--- a/arch/x86/include/asm/smp.h
+++ b/arch/x86/include/asm/smp.h
@@ -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);
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 6f27facbaa9b..767573b7f2db 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -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);
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index 77c959cf81e7..7a43b2ae19f1 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -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;
--
2.15.0.rc0.39.g2f0e14e64
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] x86/xen: Calculate __max_logical_packages on PV domains
2018-02-07 23:49 [PATCH] x86/xen: Calculate __max_logical_packages on PV domains Prarit Bhargava
2018-02-08 0:59 ` Boris Ostrovsky
@ 2018-02-08 0:59 ` Boris Ostrovsky
2018-02-08 8:49 ` Juergen Gross
` (3 more replies)
2018-02-12 13:51 ` Juergen Gross
2018-02-12 13:51 ` Juergen Gross
3 siblings, 4 replies; 12+ messages in thread
From: Boris Ostrovsky @ 2018-02-08 0:59 UTC (permalink / raw)
To: Prarit Bhargava, linux-kernel
Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Juergen Gross,
Dou Liyang, Kate Stewart, Greg Kroah-Hartman, Andy Lutomirski,
Andi Kleen, Vitaly Kuznetsov, xen-devel, simon
On 02/07/2018 06:49 PM, Prarit Bhargava wrote:
> The kernel panics on PV domains because native_smp_cpus_done() is
> only called for HVM domains.
>
> Calculate __max_logical_packages for PV domains.
>
> Fixes: b4c0a7326f5d ("x86/smpboot: Fix __max_logical_packages estimate")
> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
> Tested-and-reported-by: Simon Gaiser <simon@invisiblethingslab.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: x86@kernel.org
> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Cc: Juergen Gross <jgross@suse.com>
> Cc: Dou Liyang <douly.fnst@cn.fujitsu.com>
> Cc: Prarit Bhargava <prarit@redhat.com>
> Cc: Kate Stewart <kstewart@linuxfoundation.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Andy Lutomirski <luto@kernel.org>
> Cc: Andi Kleen <ak@linux.intel.com>
> Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
> Cc: xen-devel@lists.xenproject.org
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
(+ Simon)
> ---
> 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(-)
>
> diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
> index 461f53d27708..a4189762b266 100644
> --- a/arch/x86/include/asm/smp.h
> +++ b/arch/x86/include/asm/smp.h
> @@ -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);
> diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
> index 6f27facbaa9b..767573b7f2db 100644
> --- a/arch/x86/kernel/smpboot.c
> +++ b/arch/x86/kernel/smpboot.c
> @@ -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);
> diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
> index 77c959cf81e7..7a43b2ae19f1 100644
> --- a/arch/x86/xen/smp.c
> +++ b/arch/x86/xen/smp.c
> @@ -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;
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] x86/xen: Calculate __max_logical_packages on PV domains
2018-02-07 23:49 [PATCH] x86/xen: Calculate __max_logical_packages on PV domains Prarit Bhargava
@ 2018-02-08 0:59 ` Boris Ostrovsky
2018-02-08 0:59 ` Boris Ostrovsky
` (2 subsequent siblings)
3 siblings, 0 replies; 12+ messages in thread
From: Boris Ostrovsky @ 2018-02-08 0:59 UTC (permalink / raw)
To: Prarit Bhargava, linux-kernel
Cc: Juergen Gross, Dou Liyang, Andi Kleen, Greg Kroah-Hartman, x86,
simon, Ingo Molnar, Andy Lutomirski, H. Peter Anvin, xen-devel,
Thomas Gleixner, Vitaly Kuznetsov, Kate Stewart
On 02/07/2018 06:49 PM, Prarit Bhargava wrote:
> The kernel panics on PV domains because native_smp_cpus_done() is
> only called for HVM domains.
>
> Calculate __max_logical_packages for PV domains.
>
> Fixes: b4c0a7326f5d ("x86/smpboot: Fix __max_logical_packages estimate")
> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
> Tested-and-reported-by: Simon Gaiser <simon@invisiblethingslab.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: x86@kernel.org
> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Cc: Juergen Gross <jgross@suse.com>
> Cc: Dou Liyang <douly.fnst@cn.fujitsu.com>
> Cc: Prarit Bhargava <prarit@redhat.com>
> Cc: Kate Stewart <kstewart@linuxfoundation.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Andy Lutomirski <luto@kernel.org>
> Cc: Andi Kleen <ak@linux.intel.com>
> Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
> Cc: xen-devel@lists.xenproject.org
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
(+ Simon)
> ---
> 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(-)
>
> diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
> index 461f53d27708..a4189762b266 100644
> --- a/arch/x86/include/asm/smp.h
> +++ b/arch/x86/include/asm/smp.h
> @@ -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);
> diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
> index 6f27facbaa9b..767573b7f2db 100644
> --- a/arch/x86/kernel/smpboot.c
> +++ b/arch/x86/kernel/smpboot.c
> @@ -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);
> diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
> index 77c959cf81e7..7a43b2ae19f1 100644
> --- a/arch/x86/xen/smp.c
> +++ b/arch/x86/xen/smp.c
> @@ -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
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] x86/xen: Calculate __max_logical_packages on PV domains
2018-02-08 0:59 ` Boris Ostrovsky
@ 2018-02-08 8:49 ` Juergen Gross
2018-02-13 12:29 ` Ingo Molnar
2018-02-08 8:49 ` Juergen Gross
` (2 subsequent siblings)
3 siblings, 1 reply; 12+ messages in thread
From: Juergen Gross @ 2018-02-08 8:49 UTC (permalink / raw)
To: linux-kernel, Thomas Gleixner, Ingo Molnar
Cc: Boris Ostrovsky, Prarit Bhargava, H. Peter Anvin, x86,
Dou Liyang, Kate Stewart, Greg Kroah-Hartman, Andy Lutomirski,
Andi Kleen, Vitaly Kuznetsov, xen-devel, simon
On 08/02/18 01:59, Boris Ostrovsky wrote:
>
>
> On 02/07/2018 06:49 PM, Prarit Bhargava wrote:
>> The kernel panics on PV domains because native_smp_cpus_done() is
>> only called for HVM domains.
>>
>> Calculate __max_logical_packages for PV domains.
>>
>> Fixes: b4c0a7326f5d ("x86/smpboot: Fix __max_logical_packages estimate")
>> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
>> Tested-and-reported-by: Simon Gaiser <simon@invisiblethingslab.com>
>> Cc: Thomas Gleixner <tglx@linutronix.de>
>> Cc: Ingo Molnar <mingo@redhat.com>
>> Cc: "H. Peter Anvin" <hpa@zytor.com>
>> Cc: x86@kernel.org
>> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>> Cc: Juergen Gross <jgross@suse.com>
>> Cc: Dou Liyang <douly.fnst@cn.fujitsu.com>
>> Cc: Prarit Bhargava <prarit@redhat.com>
>> Cc: Kate Stewart <kstewart@linuxfoundation.org>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Cc: Andy Lutomirski <luto@kernel.org>
>> Cc: Andi Kleen <ak@linux.intel.com>
>> Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
>> Cc: xen-devel@lists.xenproject.org
>
>
> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Thomas, Ingo, are you taking this via the tip tree or should I take
it via the xen tree?
Juergen
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] x86/xen: Calculate __max_logical_packages on PV domains
2018-02-08 0:59 ` Boris Ostrovsky
2018-02-08 8:49 ` Juergen Gross
@ 2018-02-08 8:49 ` Juergen Gross
2018-02-27 17:08 ` Simon Gaiser
2018-02-27 17:08 ` Simon Gaiser
3 siblings, 0 replies; 12+ messages in thread
From: Juergen Gross @ 2018-02-08 8:49 UTC (permalink / raw)
To: linux-kernel, Thomas Gleixner, Ingo Molnar
Cc: Prarit Bhargava, Dou Liyang, Andi Kleen, Greg Kroah-Hartman, x86,
simon, Andy Lutomirski, H. Peter Anvin, xen-devel,
Boris Ostrovsky, Vitaly Kuznetsov, Kate Stewart
On 08/02/18 01:59, Boris Ostrovsky wrote:
>
>
> On 02/07/2018 06:49 PM, Prarit Bhargava wrote:
>> The kernel panics on PV domains because native_smp_cpus_done() is
>> only called for HVM domains.
>>
>> Calculate __max_logical_packages for PV domains.
>>
>> Fixes: b4c0a7326f5d ("x86/smpboot: Fix __max_logical_packages estimate")
>> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
>> Tested-and-reported-by: Simon Gaiser <simon@invisiblethingslab.com>
>> Cc: Thomas Gleixner <tglx@linutronix.de>
>> Cc: Ingo Molnar <mingo@redhat.com>
>> Cc: "H. Peter Anvin" <hpa@zytor.com>
>> Cc: x86@kernel.org
>> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>> Cc: Juergen Gross <jgross@suse.com>
>> Cc: Dou Liyang <douly.fnst@cn.fujitsu.com>
>> Cc: Prarit Bhargava <prarit@redhat.com>
>> Cc: Kate Stewart <kstewart@linuxfoundation.org>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Cc: Andy Lutomirski <luto@kernel.org>
>> Cc: Andi Kleen <ak@linux.intel.com>
>> Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
>> Cc: xen-devel@lists.xenproject.org
>
>
> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Thomas, Ingo, are you taking this via the tip tree or should I take
it via the xen tree?
Juergen
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] x86/xen: Calculate __max_logical_packages on PV domains
2018-02-07 23:49 [PATCH] x86/xen: Calculate __max_logical_packages on PV domains Prarit Bhargava
` (2 preceding siblings ...)
2018-02-12 13:51 ` Juergen Gross
@ 2018-02-12 13:51 ` Juergen Gross
3 siblings, 0 replies; 12+ messages in thread
From: Juergen Gross @ 2018-02-12 13:51 UTC (permalink / raw)
To: Prarit Bhargava, linux-kernel
Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
Boris Ostrovsky, Dou Liyang, Kate Stewart, Greg Kroah-Hartman,
Andy Lutomirski, Andi Kleen, Vitaly Kuznetsov, xen-devel
On 08/02/18 00:49, Prarit Bhargava wrote:
> The kernel panics on PV domains because native_smp_cpus_done() is
> only called for HVM domains.
>
> Calculate __max_logical_packages for PV domains.
>
> Fixes: b4c0a7326f5d ("x86/smpboot: Fix __max_logical_packages estimate")
> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
> Tested-and-reported-by: Simon Gaiser <simon@invisiblethingslab.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: x86@kernel.org
> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Cc: Juergen Gross <jgross@suse.com>
> Cc: Dou Liyang <douly.fnst@cn.fujitsu.com>
> Cc: Prarit Bhargava <prarit@redhat.com>
> Cc: Kate Stewart <kstewart@linuxfoundation.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Andy Lutomirski <luto@kernel.org>
> Cc: Andi Kleen <ak@linux.intel.com>
> Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
> Cc: xen-devel@lists.xenproject.org
Committed to xen.tip for-linus-4.16
Juergen
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] x86/xen: Calculate __max_logical_packages on PV domains
2018-02-07 23:49 [PATCH] x86/xen: Calculate __max_logical_packages on PV domains Prarit Bhargava
2018-02-08 0:59 ` Boris Ostrovsky
2018-02-08 0:59 ` Boris Ostrovsky
@ 2018-02-12 13:51 ` Juergen Gross
2018-02-12 13:51 ` Juergen Gross
3 siblings, 0 replies; 12+ messages in thread
From: Juergen Gross @ 2018-02-12 13:51 UTC (permalink / raw)
To: Prarit Bhargava, linux-kernel
Cc: Kate Stewart, Dou Liyang, Andi Kleen, Greg Kroah-Hartman, x86,
Vitaly Kuznetsov, Ingo Molnar, Andy Lutomirski, H. Peter Anvin,
xen-devel, Boris Ostrovsky, Thomas Gleixner
On 08/02/18 00:49, Prarit Bhargava wrote:
> The kernel panics on PV domains because native_smp_cpus_done() is
> only called for HVM domains.
>
> Calculate __max_logical_packages for PV domains.
>
> Fixes: b4c0a7326f5d ("x86/smpboot: Fix __max_logical_packages estimate")
> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
> Tested-and-reported-by: Simon Gaiser <simon@invisiblethingslab.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: x86@kernel.org
> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Cc: Juergen Gross <jgross@suse.com>
> Cc: Dou Liyang <douly.fnst@cn.fujitsu.com>
> Cc: Prarit Bhargava <prarit@redhat.com>
> Cc: Kate Stewart <kstewart@linuxfoundation.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Andy Lutomirski <luto@kernel.org>
> Cc: Andi Kleen <ak@linux.intel.com>
> Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
> Cc: xen-devel@lists.xenproject.org
Committed to xen.tip for-linus-4.16
Juergen
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] x86/xen: Calculate __max_logical_packages on PV domains
2018-02-08 8:49 ` Juergen Gross
@ 2018-02-13 12:29 ` Ingo Molnar
0 siblings, 0 replies; 12+ messages in thread
From: Ingo Molnar @ 2018-02-13 12:29 UTC (permalink / raw)
To: Juergen Gross
Cc: linux-kernel, Thomas Gleixner, Ingo Molnar, Boris Ostrovsky,
Prarit Bhargava, H. Peter Anvin, x86, Dou Liyang, Kate Stewart,
Greg Kroah-Hartman, Andy Lutomirski, Andi Kleen,
Vitaly Kuznetsov, xen-devel, simon
* Juergen Gross <jgross@suse.com> wrote:
> On 08/02/18 01:59, Boris Ostrovsky wrote:
> >
> >
> > On 02/07/2018 06:49 PM, Prarit Bhargava wrote:
> >> The kernel panics on PV domains because native_smp_cpus_done() is
> >> only called for HVM domains.
> >>
> >> Calculate __max_logical_packages for PV domains.
> >>
> >> Fixes: b4c0a7326f5d ("x86/smpboot: Fix __max_logical_packages estimate")
> >> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
> >> Tested-and-reported-by: Simon Gaiser <simon@invisiblethingslab.com>
> >> Cc: Thomas Gleixner <tglx@linutronix.de>
> >> Cc: Ingo Molnar <mingo@redhat.com>
> >> Cc: "H. Peter Anvin" <hpa@zytor.com>
> >> Cc: x86@kernel.org
> >> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> >> Cc: Juergen Gross <jgross@suse.com>
> >> Cc: Dou Liyang <douly.fnst@cn.fujitsu.com>
> >> Cc: Prarit Bhargava <prarit@redhat.com>
> >> Cc: Kate Stewart <kstewart@linuxfoundation.org>
> >> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >> Cc: Andy Lutomirski <luto@kernel.org>
> >> Cc: Andi Kleen <ak@linux.intel.com>
> >> Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
> >> Cc: xen-devel@lists.xenproject.org
> >
> >
> > Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>
> 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:
Acked-by: Ingo Molnar <mingo@kernel.org>
Thanks,
Ingo
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] x86/xen: Calculate __max_logical_packages on PV domains
@ 2018-02-13 12:29 ` Ingo Molnar
0 siblings, 0 replies; 12+ messages in thread
From: Ingo Molnar @ 2018-02-13 12:29 UTC (permalink / raw)
To: Juergen Gross
Cc: Prarit Bhargava, Dou Liyang, Andi Kleen, Greg Kroah-Hartman, x86,
linux-kernel, simon, Vitaly Kuznetsov, Ingo Molnar,
Andy Lutomirski, H. Peter Anvin, xen-devel, Boris Ostrovsky,
Thomas Gleixner, Kate Stewart
* Juergen Gross <jgross@suse.com> wrote:
> On 08/02/18 01:59, Boris Ostrovsky wrote:
> >
> >
> > On 02/07/2018 06:49 PM, Prarit Bhargava wrote:
> >> The kernel panics on PV domains because native_smp_cpus_done() is
> >> only called for HVM domains.
> >>
> >> Calculate __max_logical_packages for PV domains.
> >>
> >> Fixes: b4c0a7326f5d ("x86/smpboot: Fix __max_logical_packages estimate")
> >> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
> >> Tested-and-reported-by: Simon Gaiser <simon@invisiblethingslab.com>
> >> Cc: Thomas Gleixner <tglx@linutronix.de>
> >> Cc: Ingo Molnar <mingo@redhat.com>
> >> Cc: "H. Peter Anvin" <hpa@zytor.com>
> >> Cc: x86@kernel.org
> >> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> >> Cc: Juergen Gross <jgross@suse.com>
> >> Cc: Dou Liyang <douly.fnst@cn.fujitsu.com>
> >> Cc: Prarit Bhargava <prarit@redhat.com>
> >> Cc: Kate Stewart <kstewart@linuxfoundation.org>
> >> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >> Cc: Andy Lutomirski <luto@kernel.org>
> >> Cc: Andi Kleen <ak@linux.intel.com>
> >> Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
> >> Cc: xen-devel@lists.xenproject.org
> >
> >
> > Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>
> 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:
Acked-by: Ingo Molnar <mingo@kernel.org>
Thanks,
Ingo
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] x86/xen: Calculate __max_logical_packages on PV domains
2018-02-08 0:59 ` Boris Ostrovsky
2018-02-08 8:49 ` Juergen Gross
2018-02-08 8:49 ` Juergen Gross
@ 2018-02-27 17:08 ` Simon Gaiser
2018-02-27 17:08 ` Simon Gaiser
3 siblings, 0 replies; 12+ messages in thread
From: Simon Gaiser @ 2018-02-27 17:08 UTC (permalink / raw)
To: stable
Cc: Boris Ostrovsky, Prarit Bhargava, linux-kernel, Thomas Gleixner,
Ingo Molnar, H. Peter Anvin, x86, Juergen Gross, Dou Liyang,
Kate Stewart, Greg Kroah-Hartman, Andy Lutomirski, Andi Kleen,
Vitaly Kuznetsov, xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 1230 bytes --]
Boris Ostrovsky:
> On 02/07/2018 06:49 PM, Prarit Bhargava wrote:
>> The kernel panics on PV domains because native_smp_cpus_done() is
>> only called for HVM domains.
>>
>> Calculate __max_logical_packages for PV domains.
>>
>> Fixes: b4c0a7326f5d ("x86/smpboot: Fix __max_logical_packages estimate")
>> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
>> Tested-and-reported-by: Simon Gaiser <simon@invisiblethingslab.com>
>> Cc: Thomas Gleixner <tglx@linutronix.de>
>> Cc: Ingo Molnar <mingo@redhat.com>
>> Cc: "H. Peter Anvin" <hpa@zytor.com>
>> Cc: x86@kernel.org
>> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>> Cc: Juergen Gross <jgross@suse.com>
>> Cc: Dou Liyang <douly.fnst@cn.fujitsu.com>
>> Cc: Prarit Bhargava <prarit@redhat.com>
>> Cc: Kate Stewart <kstewart@linuxfoundation.org>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Cc: Andy Lutomirski <luto@kernel.org>
>> Cc: Andi Kleen <ak@linux.intel.com>
>> Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
>> Cc: xen-devel@lists.xenproject.org
>
>
> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
The fixed bug is in 4.15 so it should get into stable. It's
63e708f826bb21470155d37b103a75d8a9e25b18 upstream.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] x86/xen: Calculate __max_logical_packages on PV domains
2018-02-08 0:59 ` Boris Ostrovsky
` (2 preceding siblings ...)
2018-02-27 17:08 ` Simon Gaiser
@ 2018-02-27 17:08 ` Simon Gaiser
3 siblings, 0 replies; 12+ messages in thread
From: Simon Gaiser @ 2018-02-27 17:08 UTC (permalink / raw)
To: stable
Cc: Prarit Bhargava, Juergen Gross, Andi Kleen, Dou Liyang,
Greg Kroah-Hartman, x86, linux-kernel, Vitaly Kuznetsov,
Ingo Molnar, Andy Lutomirski, H. Peter Anvin, xen-devel,
Boris Ostrovsky, Thomas Gleixner, Kate Stewart
[-- Attachment #1.1.1: Type: text/plain, Size: 1230 bytes --]
Boris Ostrovsky:
> On 02/07/2018 06:49 PM, Prarit Bhargava wrote:
>> The kernel panics on PV domains because native_smp_cpus_done() is
>> only called for HVM domains.
>>
>> Calculate __max_logical_packages for PV domains.
>>
>> Fixes: b4c0a7326f5d ("x86/smpboot: Fix __max_logical_packages estimate")
>> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
>> Tested-and-reported-by: Simon Gaiser <simon@invisiblethingslab.com>
>> Cc: Thomas Gleixner <tglx@linutronix.de>
>> Cc: Ingo Molnar <mingo@redhat.com>
>> Cc: "H. Peter Anvin" <hpa@zytor.com>
>> Cc: x86@kernel.org
>> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>> Cc: Juergen Gross <jgross@suse.com>
>> Cc: Dou Liyang <douly.fnst@cn.fujitsu.com>
>> Cc: Prarit Bhargava <prarit@redhat.com>
>> Cc: Kate Stewart <kstewart@linuxfoundation.org>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Cc: Andy Lutomirski <luto@kernel.org>
>> Cc: Andi Kleen <ak@linux.intel.com>
>> Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
>> Cc: xen-devel@lists.xenproject.org
>
>
> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
The fixed bug is in 4.15 so it should get into stable. It's
63e708f826bb21470155d37b103a75d8a9e25b18 upstream.
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 157 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] x86/xen: Calculate __max_logical_packages on PV domains
@ 2018-02-07 23:49 Prarit Bhargava
0 siblings, 0 replies; 12+ messages in thread
From: Prarit Bhargava @ 2018-02-07 23:49 UTC (permalink / raw)
To: linux-kernel
Cc: Prarit Bhargava, Juergen Gross, Andi Kleen, Dou Liyang,
Greg Kroah-Hartman, x86, Vitaly Kuznetsov, Ingo Molnar,
Andy Lutomirski, H. Peter Anvin, xen-devel, Thomas Gleixner,
Boris Ostrovsky, Kate Stewart
The kernel panics on PV domains because native_smp_cpus_done() is
only called for HVM domains.
Calculate __max_logical_packages for PV domains.
Fixes: b4c0a7326f5d ("x86/smpboot: Fix __max_logical_packages estimate")
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Tested-and-reported-by: Simon Gaiser <simon@invisiblethingslab.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Dou Liyang <douly.fnst@cn.fujitsu.com>
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: xen-devel@lists.xenproject.org
---
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(-)
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
index 461f53d27708..a4189762b266 100644
--- a/arch/x86/include/asm/smp.h
+++ b/arch/x86/include/asm/smp.h
@@ -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);
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 6f27facbaa9b..767573b7f2db 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -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);
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index 77c959cf81e7..7a43b2ae19f1 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -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;
--
2.15.0.rc0.39.g2f0e14e64
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply related [flat|nested] 12+ messages in thread
end of thread, other threads:[~2018-02-27 17:08 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-07 23:49 [PATCH] x86/xen: Calculate __max_logical_packages on PV domains Prarit Bhargava
2018-02-08 0:59 ` Boris Ostrovsky
2018-02-08 0:59 ` Boris Ostrovsky
2018-02-08 8:49 ` Juergen Gross
2018-02-13 12:29 ` Ingo Molnar
2018-02-13 12:29 ` Ingo Molnar
2018-02-08 8:49 ` Juergen Gross
2018-02-27 17:08 ` Simon Gaiser
2018-02-27 17:08 ` Simon Gaiser
2018-02-12 13:51 ` Juergen Gross
2018-02-12 13:51 ` Juergen Gross
2018-02-07 23:49 Prarit Bhargava
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.