public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable for CPU offlining prevention
@ 2015-05-21 16:21 Vitaly Kuznetsov
  2015-05-21 16:21 ` [PATCH v2 1/2] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable Vitaly Kuznetsov
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Vitaly Kuznetsov @ 2015-05-21 16:21 UTC (permalink / raw)
  To: devel
  Cc: K. Y. Srinivasan, Haiyang Zhang, linux-kernel, Dexuan Cui,
	Ingo Molnar, Paul E. McKenney, Rafael J. Wysocki, Peter Zijlstra,
	Thomas Gleixner, Radim Krčmář

Changes since v1:
- Make cpu_hotplug_disabled a counter [Radim Krčmář]

Export cpu_hotplug_enable/cpu_hotplug_disable functions from cpu.c and use
them instead of altering smp_ops.cpu_disable in Hyper-V vmbus module.

Vitaly Kuznetsov (2):
  cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable
  Drivers: hv: vmbus: use cpu_hotplug_enable/disable

 Documentation/power/suspend-and-cpuhotplug.txt |  6 ++--
 drivers/hv/vmbus_drv.c                         | 38 +++-----------------------
 kernel/cpu.c                                   | 13 +++++----
 3 files changed, 15 insertions(+), 42 deletions(-)

-- 
1.9.3


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 1/2] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable
  2015-05-21 16:21 [PATCH v2 0/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable for CPU offlining prevention Vitaly Kuznetsov
@ 2015-05-21 16:21 ` Vitaly Kuznetsov
  2015-05-21 16:21 ` [PATCH v2 2/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable Vitaly Kuznetsov
  2015-05-26 23:29 ` [PATCH v2 0/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable for CPU offlining prevention KY Srinivasan
  2 siblings, 0 replies; 9+ messages in thread
From: Vitaly Kuznetsov @ 2015-05-21 16:21 UTC (permalink / raw)
  To: devel
  Cc: K. Y. Srinivasan, Haiyang Zhang, linux-kernel, Dexuan Cui,
	Ingo Molnar, Paul E. McKenney, Rafael J. Wysocki, Peter Zijlstra,
	Thomas Gleixner, Radim Krčmář

Loaded Hyper-V module will use these functions to disable CPU hotplug
under certain circumstances. Convert cpu_hotplug_disabled to a counter
(protected by cpu_add_remove_lock) to support e.g. disable -> disable ->
enable call sequences.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
 Documentation/power/suspend-and-cpuhotplug.txt |  6 +++---
 kernel/cpu.c                                   | 13 ++++++++-----
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/Documentation/power/suspend-and-cpuhotplug.txt b/Documentation/power/suspend-and-cpuhotplug.txt
index 2850df3..2fc9095 100644
--- a/Documentation/power/suspend-and-cpuhotplug.txt
+++ b/Documentation/power/suspend-and-cpuhotplug.txt
@@ -72,7 +72,7 @@ More details follow:
                                         |
                                         v
                            Disable regular cpu hotplug
-                        by setting cpu_hotplug_disabled=1
+                        by increasing cpu_hotplug_disabled
                                         |
                                         v
                             Release cpu_add_remove_lock
@@ -89,7 +89,7 @@ Resuming back is likewise, with the counterparts being (in the order of
 execution during resume):
 * enable_nonboot_cpus() which involves:
    |  Acquire cpu_add_remove_lock
-   |  Reset cpu_hotplug_disabled to 0, thereby enabling regular cpu hotplug
+   |  Decrease cpu_hotplug_disabled, thereby enabling regular cpu hotplug
    |  Call _cpu_up() [for all those cpus in the frozen_cpus mask, in a loop]
    |  Release cpu_add_remove_lock
    v
@@ -120,7 +120,7 @@ after the entire cycle is complete (i.e., suspend + resume).
                            Acquire cpu_add_remove_lock
                                         |
                                         v
-                          If cpu_hotplug_disabled is 1
+                          If cpu_hotplug_disabled > 0
                                 return gracefully
                                         |
                                         |
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 94bbe46..8f35ee6 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -190,17 +190,19 @@ void cpu_hotplug_done(void)
 void cpu_hotplug_disable(void)
 {
 	cpu_maps_update_begin();
-	cpu_hotplug_disabled = 1;
+	cpu_hotplug_disabled++;
 	cpu_maps_update_done();
 }
+EXPORT_SYMBOL_GPL(cpu_hotplug_disable);
 
 void cpu_hotplug_enable(void)
 {
 	cpu_maps_update_begin();
-	cpu_hotplug_disabled = 0;
+	if (cpu_hotplug_disabled)
+		cpu_hotplug_disabled--;
 	cpu_maps_update_done();
 }
-
+EXPORT_SYMBOL_GPL(cpu_hotplug_enable);
 #endif	/* CONFIG_HOTPLUG_CPU */
 
 /* Need to know about CPUs going up/down? */
@@ -600,7 +602,7 @@ int disable_nonboot_cpus(void)
 	if (!error) {
 		BUG_ON(num_online_cpus() > 1);
 		/* Make sure the CPUs won't be enabled by someone else */
-		cpu_hotplug_disabled = 1;
+		cpu_hotplug_disabled++;
 	} else {
 		pr_err("Non-boot CPUs are not disabled\n");
 	}
@@ -622,7 +624,8 @@ void __ref enable_nonboot_cpus(void)
 
 	/* Allow everyone to use the CPU hotplug again */
 	cpu_maps_update_begin();
-	cpu_hotplug_disabled = 0;
+	if (cpu_hotplug_disabled)
+		cpu_hotplug_disabled--;
 	if (cpumask_empty(frozen_cpus))
 		goto out;
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 2/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable
  2015-05-21 16:21 [PATCH v2 0/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable for CPU offlining prevention Vitaly Kuznetsov
  2015-05-21 16:21 ` [PATCH v2 1/2] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable Vitaly Kuznetsov
@ 2015-05-21 16:21 ` Vitaly Kuznetsov
  2015-05-29 16:41   ` KY Srinivasan
  2015-05-26 23:29 ` [PATCH v2 0/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable for CPU offlining prevention KY Srinivasan
  2 siblings, 1 reply; 9+ messages in thread
From: Vitaly Kuznetsov @ 2015-05-21 16:21 UTC (permalink / raw)
  To: devel
  Cc: K. Y. Srinivasan, Haiyang Zhang, linux-kernel, Dexuan Cui,
	Ingo Molnar, Paul E. McKenney, Rafael J. Wysocki, Peter Zijlstra,
	Thomas Gleixner, Radim Krčmář

Commit e513229b4c38 ("Drivers: hv: vmbus: prevent cpu offlining on newer
hypervisors") was altering smp_ops.cpu_disable to prevent CPU offlining.
We can bo better by using cpu_hotplug_enable/disable functions instead of
such hard-coding.

Reported-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
 drivers/hv/vmbus_drv.c | 38 ++++----------------------------------
 1 file changed, 4 insertions(+), 34 deletions(-)

diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index c85235e..e916ba2 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -763,38 +763,6 @@ static void vmbus_isr(void)
 	}
 }
 
-#ifdef CONFIG_HOTPLUG_CPU
-static int hyperv_cpu_disable(void)
-{
-	return -ENOSYS;
-}
-
-static void hv_cpu_hotplug_quirk(bool vmbus_loaded)
-{
-	static void *previous_cpu_disable;
-
-	/*
-	 * Offlining a CPU when running on newer hypervisors (WS2012R2, Win8,
-	 * ...) is not supported at this moment as channel interrupts are
-	 * distributed across all of them.
-	 */
-
-	if ((vmbus_proto_version == VERSION_WS2008) ||
-	    (vmbus_proto_version == VERSION_WIN7))
-		return;
-
-	if (vmbus_loaded) {
-		previous_cpu_disable = smp_ops.cpu_disable;
-		smp_ops.cpu_disable = hyperv_cpu_disable;
-		pr_notice("CPU offlining is not supported by hypervisor\n");
-	} else if (previous_cpu_disable)
-		smp_ops.cpu_disable = previous_cpu_disable;
-}
-#else
-static void hv_cpu_hotplug_quirk(bool vmbus_loaded)
-{
-}
-#endif
 
 /*
  * vmbus_bus_init -Main vmbus driver initialization routine.
@@ -836,7 +804,8 @@ static int vmbus_bus_init(int irq)
 	if (ret)
 		goto err_alloc;
 
-	hv_cpu_hotplug_quirk(true);
+	if (vmbus_proto_version > VERSION_WIN7)
+		cpu_hotplug_disable();
 
 	/*
 	 * Only register if the crash MSRs are available
@@ -1103,7 +1072,8 @@ static void __exit vmbus_exit(void)
 	for_each_online_cpu(cpu)
 		smp_call_function_single(cpu, hv_synic_cleanup, NULL, 1);
 	acpi_bus_unregister_driver(&vmbus_acpi_driver);
-	hv_cpu_hotplug_quirk(false);
+	if (vmbus_proto_version > VERSION_WIN7)
+		cpu_hotplug_enable();
 	vmbus_disconnect();
 }
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* RE: [PATCH v2 0/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable for CPU offlining prevention
  2015-05-21 16:21 [PATCH v2 0/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable for CPU offlining prevention Vitaly Kuznetsov
  2015-05-21 16:21 ` [PATCH v2 1/2] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable Vitaly Kuznetsov
  2015-05-21 16:21 ` [PATCH v2 2/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable Vitaly Kuznetsov
@ 2015-05-26 23:29 ` KY Srinivasan
  2015-05-27  9:14   ` Vitaly Kuznetsov
  2 siblings, 1 reply; 9+ messages in thread
From: KY Srinivasan @ 2015-05-26 23:29 UTC (permalink / raw)
  To: Vitaly Kuznetsov, devel@linuxdriverproject.org
  Cc: Haiyang Zhang, linux-kernel@vger.kernel.org, Dexuan Cui,
	Ingo Molnar, Paul E. McKenney, Rafael J. Wysocki, Peter Zijlstra,
	Thomas Gleixner, Radim Krčmář

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1425 bytes --]



> -----Original Message-----
> From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com]
> Sent: Thursday, May 21, 2015 9:22 AM
> To: devel@linuxdriverproject.org
> Cc: KY Srinivasan; Haiyang Zhang; linux-kernel@vger.kernel.org; Dexuan Cui;
> Ingo Molnar; Paul E. McKenney; Rafael J. Wysocki; Peter Zijlstra; Thomas
> Gleixner; Radim Krčmář
> Subject: [PATCH v2 0/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable
> for CPU offlining prevention
> 
> Changes since v1:
> - Make cpu_hotplug_disabled a counter [Radim Krčmář]
> 
> Export cpu_hotplug_enable/cpu_hotplug_disable functions from cpu.c and
> use
> them instead of altering smp_ops.cpu_disable in Hyper-V vmbus module.
> 
> Vitaly Kuznetsov (2):
>   cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable
>   Drivers: hv: vmbus: use cpu_hotplug_enable/disable

Vitaly,

Since there is a cross tree dependency here, could you resubmit the vmbus patch
after the CPU hotplug patch has been committed. 

Regards, 

K. Y
> 
>  Documentation/power/suspend-and-cpuhotplug.txt |  6 ++--
>  drivers/hv/vmbus_drv.c                         | 38 +++-----------------------
>  kernel/cpu.c                                   | 13 +++++----
>  3 files changed, 15 insertions(+), 42 deletions(-)
> 
> --
> 1.9.3

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 0/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable for CPU offlining prevention
  2015-05-26 23:29 ` [PATCH v2 0/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable for CPU offlining prevention KY Srinivasan
@ 2015-05-27  9:14   ` Vitaly Kuznetsov
  2015-05-27 14:37     ` KY Srinivasan
  0 siblings, 1 reply; 9+ messages in thread
From: Vitaly Kuznetsov @ 2015-05-27  9:14 UTC (permalink / raw)
  To: KY Srinivasan
  Cc: devel@linuxdriverproject.org, Haiyang Zhang,
	linux-kernel@vger.kernel.org, Dexuan Cui, Ingo Molnar,
	Paul E. McKenney, Rafael J. Wysocki, Peter Zijlstra,
	Thomas Gleixner, Radim Krčmář

KY Srinivasan <kys@microsoft.com> writes:

>> -----Original Message-----
>> From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com]
>> Sent: Thursday, May 21, 2015 9:22 AM
>> To: devel@linuxdriverproject.org
>> Cc: KY Srinivasan; Haiyang Zhang; linux-kernel@vger.kernel.org; Dexuan Cui;
>> Ingo Molnar; Paul E. McKenney; Rafael J. Wysocki; Peter Zijlstra; Thomas
>> Gleixner; Radim Krčmář
>> Subject: [PATCH v2 0/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable
>> for CPU offlining prevention
>> 
>> Changes since v1:
>> - Make cpu_hotplug_disabled a counter [Radim Krčmář]
>> 
>> Export cpu_hotplug_enable/cpu_hotplug_disable functions from cpu.c and
>> use
>> them instead of altering smp_ops.cpu_disable in Hyper-V vmbus module.
>> 
>> Vitaly Kuznetsov (2):
>>   cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable
>>   Drivers: hv: vmbus: use cpu_hotplug_enable/disable
>
> Vitaly,
>
> Since there is a cross tree dependency here, could you resubmit the vmbus patch
> after the CPU hotplug patch has been committed. 

I'm afraid it won't be committed without the second patch as without a
single user of cpu_hotplug_enable/cpu_hotplug_disable (among modules)
this patch doesn't make much sense. I would rather expect both of them
to go through Greg's tree but with proper sign-offs/reviewed-bys. And
of course this decision is up to tree maintainers, I'll resubmit the
vmbus patch in case CPU hotplug patch gets committed separately.

Thanks,

>
> Regards, 
>
> K. Y
>> 
>>  Documentation/power/suspend-and-cpuhotplug.txt |  6 ++--
>>  drivers/hv/vmbus_drv.c                         | 38 +++-----------------------
>>  kernel/cpu.c                                   | 13 +++++----
>>  3 files changed, 15 insertions(+), 42 deletions(-)
>> 
>> --
>> 1.9.3

-- 
  Vitaly

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH v2 0/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable for CPU offlining prevention
  2015-05-27  9:14   ` Vitaly Kuznetsov
@ 2015-05-27 14:37     ` KY Srinivasan
  2015-05-27 15:06       ` Greg KH
  0 siblings, 1 reply; 9+ messages in thread
From: KY Srinivasan @ 2015-05-27 14:37 UTC (permalink / raw)
  To: Vitaly Kuznetsov
  Cc: devel@linuxdriverproject.org, Haiyang Zhang,
	linux-kernel@vger.kernel.org, Dexuan Cui, Ingo Molnar,
	Paul E. McKenney, Rafael J. Wysocki, Peter Zijlstra,
	Thomas Gleixner, Radim Krčmář

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2964 bytes --]



> -----Original Message-----
> From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com]
> Sent: Wednesday, May 27, 2015 2:15 AM
> To: KY Srinivasan
> Cc: devel@linuxdriverproject.org; Haiyang Zhang; linux-
> kernel@vger.kernel.org; Dexuan Cui; Ingo Molnar; Paul E. McKenney; Rafael
> J. Wysocki; Peter Zijlstra; Thomas Gleixner; Radim Krčmář
> Subject: Re: [PATCH v2 0/2] Drivers: hv: vmbus: use
> cpu_hotplug_enable/disable for CPU offlining prevention
> 
> KY Srinivasan <kys@microsoft.com> writes:
> 
> >> -----Original Message-----
> >> From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com]
> >> Sent: Thursday, May 21, 2015 9:22 AM
> >> To: devel@linuxdriverproject.org
> >> Cc: KY Srinivasan; Haiyang Zhang; linux-kernel@vger.kernel.org; Dexuan
> Cui;
> >> Ingo Molnar; Paul E. McKenney; Rafael J. Wysocki; Peter Zijlstra; Thomas
> >> Gleixner; Radim Krčmář
> >> Subject: [PATCH v2 0/2] Drivers: hv: vmbus: use
> cpu_hotplug_enable/disable
> >> for CPU offlining prevention
> >>
> >> Changes since v1:
> >> - Make cpu_hotplug_disabled a counter [Radim Krčmář]
> >>
> >> Export cpu_hotplug_enable/cpu_hotplug_disable functions from cpu.c
> and
> >> use
> >> them instead of altering smp_ops.cpu_disable in Hyper-V vmbus module.
> >>
> >> Vitaly Kuznetsov (2):
> >>   cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable
> >>   Drivers: hv: vmbus: use cpu_hotplug_enable/disable
> >
> > Vitaly,
> >
> > Since there is a cross tree dependency here, could you resubmit the vmbus
> patch
> > after the CPU hotplug patch has been committed.
> 
> I'm afraid it won't be committed without the second patch as without a
> single user of cpu_hotplug_enable/cpu_hotplug_disable (among modules)
> this patch doesn't make much sense. I would rather expect both of them
> to go through Greg's tree but with proper sign-offs/reviewed-bys. And
> of course this decision is up to tree maintainers, I'll resubmit the
> vmbus patch in case CPU hotplug patch gets committed separately.

I had asked if Greg could take both the patches and I have not heard from him yet and I
assumed that he would not. This has happened to me before and I have done just that -
show the need by sending patches that would use the functionality and get them into
the tree in the correct order. Greg, please let us know how you want to handle this; I have a 
bunch of patches that I am sitting not knowing how Vitaly's patches will be merged.

Regards,

K. Y 
> 
> Thanks,
> 
> >
> > Regards,
> >
> > K. Y
> >>
> >>  Documentation/power/suspend-and-cpuhotplug.txt |  6 ++--
> >>  drivers/hv/vmbus_drv.c                         | 38 +++-----------------------
> >>  kernel/cpu.c                                   | 13 +++++----
> >>  3 files changed, 15 insertions(+), 42 deletions(-)
> >>
> >> --
> >> 1.9.3
> 
> --
>   Vitaly
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 0/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable for CPU offlining prevention
  2015-05-27 14:37     ` KY Srinivasan
@ 2015-05-27 15:06       ` Greg KH
  2015-05-27 16:26         ` KY Srinivasan
  0 siblings, 1 reply; 9+ messages in thread
From: Greg KH @ 2015-05-27 15:06 UTC (permalink / raw)
  To: KY Srinivasan
  Cc: Vitaly Kuznetsov, Radim Krčmář, Peter Zijlstra,
	Haiyang Zhang, Rafael J. Wysocki, linux-kernel@vger.kernel.org,
	devel@linuxdriverproject.org, Thomas Gleixner, Paul E. McKenney,
	Ingo Molnar

On Wed, May 27, 2015 at 02:37:14PM +0000, KY Srinivasan wrote:
> 
> 
> > -----Original Message-----
> > From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com]
> > Sent: Wednesday, May 27, 2015 2:15 AM
> > To: KY Srinivasan
> > Cc: devel@linuxdriverproject.org; Haiyang Zhang; linux-
> > kernel@vger.kernel.org; Dexuan Cui; Ingo Molnar; Paul E. McKenney; Rafael
> > J. Wysocki; Peter Zijlstra; Thomas Gleixner; Radim Krčmář
> > Subject: Re: [PATCH v2 0/2] Drivers: hv: vmbus: use
> > cpu_hotplug_enable/disable for CPU offlining prevention
> > 
> > KY Srinivasan <kys@microsoft.com> writes:
> > 
> > >> -----Original Message-----
> > >> From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com]
> > >> Sent: Thursday, May 21, 2015 9:22 AM
> > >> To: devel@linuxdriverproject.org
> > >> Cc: KY Srinivasan; Haiyang Zhang; linux-kernel@vger.kernel.org; Dexuan
> > Cui;
> > >> Ingo Molnar; Paul E. McKenney; Rafael J. Wysocki; Peter Zijlstra; Thomas
> > >> Gleixner; Radim Krčmář
> > >> Subject: [PATCH v2 0/2] Drivers: hv: vmbus: use
> > cpu_hotplug_enable/disable
> > >> for CPU offlining prevention
> > >>
> > >> Changes since v1:
> > >> - Make cpu_hotplug_disabled a counter [Radim Krčmář]
> > >>
> > >> Export cpu_hotplug_enable/cpu_hotplug_disable functions from cpu.c
> > and
> > >> use
> > >> them instead of altering smp_ops.cpu_disable in Hyper-V vmbus module.
> > >>
> > >> Vitaly Kuznetsov (2):
> > >>   cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable
> > >>   Drivers: hv: vmbus: use cpu_hotplug_enable/disable
> > >
> > > Vitaly,
> > >
> > > Since there is a cross tree dependency here, could you resubmit the vmbus
> > patch
> > > after the CPU hotplug patch has been committed.
> > 
> > I'm afraid it won't be committed without the second patch as without a
> > single user of cpu_hotplug_enable/cpu_hotplug_disable (among modules)
> > this patch doesn't make much sense. I would rather expect both of them
> > to go through Greg's tree but with proper sign-offs/reviewed-bys. And
> > of course this decision is up to tree maintainers, I'll resubmit the
> > vmbus patch in case CPU hotplug patch gets committed separately.
> 
> I had asked if Greg could take both the patches and I have not heard from him yet and I
> assumed that he would not.

Don't you love it when people ask you to do things, yet never even cc:
you on an email and still expect you to magically notice and respond to
them?

{sigh}

You got lucky here, I happened to notice this email, but I have no email
from you to me where you asked me to do anything.

As I told you before, you need to repackage up patches you want to have
applied and send them to me, that's the job of a subsystem maintainer,
you can't just "expect" someone else to magically notice them and apply
them for you.

greg k-h

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH v2 0/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable for CPU offlining prevention
  2015-05-27 15:06       ` Greg KH
@ 2015-05-27 16:26         ` KY Srinivasan
  0 siblings, 0 replies; 9+ messages in thread
From: KY Srinivasan @ 2015-05-27 16:26 UTC (permalink / raw)
  To: Greg KH
  Cc: Vitaly Kuznetsov, Radim Krčmář, Peter Zijlstra,
	Haiyang Zhang, Rafael J. Wysocki, linux-kernel@vger.kernel.org,
	devel@linuxdriverproject.org, Thomas Gleixner, Paul E. McKenney,
	Ingo Molnar

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 3997 bytes --]



> -----Original Message-----
> From: Greg KH [mailto:gregkh@linuxfoundation.org]
> Sent: Wednesday, May 27, 2015 8:06 AM
> To: KY Srinivasan
> Cc: Vitaly Kuznetsov; Radim Krčmář; Peter Zijlstra; Haiyang Zhang; Rafael J.
> Wysocki; linux-kernel@vger.kernel.org; devel@linuxdriverproject.org;
> Thomas Gleixner; Paul E. McKenney; Ingo Molnar
> Subject: Re: [PATCH v2 0/2] Drivers: hv: vmbus: use
> cpu_hotplug_enable/disable for CPU offlining prevention
> 
> On Wed, May 27, 2015 at 02:37:14PM +0000, KY Srinivasan wrote:
> >
> >
> > > -----Original Message-----
> > > From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com]
> > > Sent: Wednesday, May 27, 2015 2:15 AM
> > > To: KY Srinivasan
> > > Cc: devel@linuxdriverproject.org; Haiyang Zhang; linux-
> > > kernel@vger.kernel.org; Dexuan Cui; Ingo Molnar; Paul E. McKenney;
> Rafael
> > > J. Wysocki; Peter Zijlstra; Thomas Gleixner; Radim Krčmář
> > > Subject: Re: [PATCH v2 0/2] Drivers: hv: vmbus: use
> > > cpu_hotplug_enable/disable for CPU offlining prevention
> > >
> > > KY Srinivasan <kys@microsoft.com> writes:
> > >
> > > >> -----Original Message-----
> > > >> From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com]
> > > >> Sent: Thursday, May 21, 2015 9:22 AM
> > > >> To: devel@linuxdriverproject.org
> > > >> Cc: KY Srinivasan; Haiyang Zhang; linux-kernel@vger.kernel.org;
> Dexuan
> > > Cui;
> > > >> Ingo Molnar; Paul E. McKenney; Rafael J. Wysocki; Peter Zijlstra;
> Thomas
> > > >> Gleixner; Radim Krčmář
> > > >> Subject: [PATCH v2 0/2] Drivers: hv: vmbus: use
> > > cpu_hotplug_enable/disable
> > > >> for CPU offlining prevention
> > > >>
> > > >> Changes since v1:
> > > >> - Make cpu_hotplug_disabled a counter [Radim Krčmář]
> > > >>
> > > >> Export cpu_hotplug_enable/cpu_hotplug_disable functions from
> cpu.c
> > > and
> > > >> use
> > > >> them instead of altering smp_ops.cpu_disable in Hyper-V vmbus
> module.
> > > >>
> > > >> Vitaly Kuznetsov (2):
> > > >>   cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable
> > > >>   Drivers: hv: vmbus: use cpu_hotplug_enable/disable
> > > >
> > > > Vitaly,
> > > >
> > > > Since there is a cross tree dependency here, could you resubmit the
> vmbus
> > > patch
> > > > after the CPU hotplug patch has been committed.
> > >
> > > I'm afraid it won't be committed without the second patch as without a
> > > single user of cpu_hotplug_enable/cpu_hotplug_disable (among
> modules)
> > > this patch doesn't make much sense. I would rather expect both of them
> > > to go through Greg's tree but with proper sign-offs/reviewed-bys. And
> > > of course this decision is up to tree maintainers, I'll resubmit the
> > > vmbus patch in case CPU hotplug patch gets committed separately.
> >
> > I had asked if Greg could take both the patches and I have not heard from
> him yet and I
> > assumed that he would not.
> 
> Don't you love it when people ask you to do things, yet never even cc:
> you on an email and still expect you to magically notice and respond to
> them?

Greg,

When I send patches, you are always on the "to" list and I was just responding to Vitaly's email
(assuming that you were on the "to" list - my bad). Sorry about that.
> 
> {sigh}
> 
> You got lucky here, I happened to notice this email, but I have no email
> from you to me where you asked me to do anything.
> 
> As I told you before, you need to repackage up patches you want to have
> applied and send them to me, that's the job of a subsystem maintainer,
> you can't just "expect" someone else to magically notice them and apply
> them for you.

The issue is not one of packaging. Vitaly has two patches in this series each of which
needs to go through a different tree. I wanted to know if you can take both patches
through your tree. In any case, I will repackage and send them to you.
 
Thank you,

K. Y 
> 
> greg k-h
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH v2 2/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable
  2015-05-21 16:21 ` [PATCH v2 2/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable Vitaly Kuznetsov
@ 2015-05-29 16:41   ` KY Srinivasan
  0 siblings, 0 replies; 9+ messages in thread
From: KY Srinivasan @ 2015-05-29 16:41 UTC (permalink / raw)
  To: Vitaly Kuznetsov, devel@linuxdriverproject.org
  Cc: Haiyang Zhang, linux-kernel@vger.kernel.org, Dexuan Cui,
	Ingo Molnar, Paul E. McKenney, Rafael J. Wysocki, Peter Zijlstra,
	Thomas Gleixner, Radim Krčmář

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2969 bytes --]



> -----Original Message-----
> From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com]
> Sent: Thursday, May 21, 2015 9:22 AM
> To: devel@linuxdriverproject.org
> Cc: KY Srinivasan; Haiyang Zhang; linux-kernel@vger.kernel.org; Dexuan Cui;
> Ingo Molnar; Paul E. McKenney; Rafael J. Wysocki; Peter Zijlstra; Thomas
> Gleixner; Radim Krčmář
> Subject: [PATCH v2 2/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable
> 
> Commit e513229b4c38 ("Drivers: hv: vmbus: prevent cpu offlining on newer
> hypervisors") was altering smp_ops.cpu_disable to prevent CPU offlining.
> We can bo better by using cpu_hotplug_enable/disable functions instead of
> such hard-coding.
> 
> Reported-by: Radim Krčmář <rkrcmar@redhat.com>
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>

This patch does not apply. Vitaly, could you rebase this on Greg's tree and re-submit.

Regards,

K. Y


> ---
>  drivers/hv/vmbus_drv.c | 38 ++++----------------------------------
>  1 file changed, 4 insertions(+), 34 deletions(-)
> 
> diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
> index c85235e..e916ba2 100644
> --- a/drivers/hv/vmbus_drv.c
> +++ b/drivers/hv/vmbus_drv.c
> @@ -763,38 +763,6 @@ static void vmbus_isr(void)
>  	}
>  }
> 
> -#ifdef CONFIG_HOTPLUG_CPU
> -static int hyperv_cpu_disable(void)
> -{
> -	return -ENOSYS;
> -}
> -
> -static void hv_cpu_hotplug_quirk(bool vmbus_loaded)
> -{
> -	static void *previous_cpu_disable;
> -
> -	/*
> -	 * Offlining a CPU when running on newer hypervisors (WS2012R2,
> Win8,
> -	 * ...) is not supported at this moment as channel interrupts are
> -	 * distributed across all of them.
> -	 */
> -
> -	if ((vmbus_proto_version == VERSION_WS2008) ||
> -	    (vmbus_proto_version == VERSION_WIN7))
> -		return;
> -
> -	if (vmbus_loaded) {
> -		previous_cpu_disable = smp_ops.cpu_disable;
> -		smp_ops.cpu_disable = hyperv_cpu_disable;
> -		pr_notice("CPU offlining is not supported by hypervisor\n");
> -	} else if (previous_cpu_disable)
> -		smp_ops.cpu_disable = previous_cpu_disable;
> -}
> -#else
> -static void hv_cpu_hotplug_quirk(bool vmbus_loaded)
> -{
> -}
> -#endif
> 
>  /*
>   * vmbus_bus_init -Main vmbus driver initialization routine.
> @@ -836,7 +804,8 @@ static int vmbus_bus_init(int irq)
>  	if (ret)
>  		goto err_alloc;
> 
> -	hv_cpu_hotplug_quirk(true);
> +	if (vmbus_proto_version > VERSION_WIN7)
> +		cpu_hotplug_disable();
> 
>  	/*
>  	 * Only register if the crash MSRs are available
> @@ -1103,7 +1072,8 @@ static void __exit vmbus_exit(void)
>  	for_each_online_cpu(cpu)
>  		smp_call_function_single(cpu, hv_synic_cleanup, NULL, 1);
>  	acpi_bus_unregister_driver(&vmbus_acpi_driver);
> -	hv_cpu_hotplug_quirk(false);
> +	if (vmbus_proto_version > VERSION_WIN7)
> +		cpu_hotplug_enable();
>  	vmbus_disconnect();
>  }
> 
> --
> 1.9.3

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-05-29 16:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-21 16:21 [PATCH v2 0/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable for CPU offlining prevention Vitaly Kuznetsov
2015-05-21 16:21 ` [PATCH v2 1/2] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable Vitaly Kuznetsov
2015-05-21 16:21 ` [PATCH v2 2/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable Vitaly Kuznetsov
2015-05-29 16:41   ` KY Srinivasan
2015-05-26 23:29 ` [PATCH v2 0/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable for CPU offlining prevention KY Srinivasan
2015-05-27  9:14   ` Vitaly Kuznetsov
2015-05-27 14:37     ` KY Srinivasan
2015-05-27 15:06       ` Greg KH
2015-05-27 16:26         ` KY Srinivasan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox