xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] xen/events/fifo: Add missing hotplug notifier transition
       [not found] <1457686822-39117-1-git-send-email-anna-maria@linutronix.de>
@ 2016-03-11 10:53 ` David Vrabel
       [not found] ` <56E2A3B6.2060208@citrix.com>
  1 sibling, 0 replies; 3+ messages in thread
From: David Vrabel @ 2016-03-11 10:53 UTC (permalink / raw)
  To: Anna-Maria Gleixner, linux-kernel
  Cc: xen-devel, Boris Ostrovsky, David Vrabel, rt

On 11/03/16 09:00, Anna-Maria Gleixner wrote:
> The evtchn_fifo_cpu_notification() hotplug callback lacks handling of
> the CPU_UP_CANCELED case. That means, if CPU_UP_PREPARE fails, the
> handle of the fifo events is not dropped.
> 
> Add handling for CPU_UP_CANCELED transition to drop the fifo events
> handle.

__evtchn_fifo_handle_events() does not releases resources, it processes
any pending events for this CPU.

This patch would only be necessary if a CPU in CPU_UP_CANCELED state may
have had unmasked interrupts.  If so you would need:


case CPU_UP_CANCELED:
          if (per_cpu(cpu_control_block, cpu))
              __evtchn_fifo_handle_events(cpu, true);
          break;

To handle the case where the control block allocation or initialization
failed during CPU_UP_PREPARE.

David

> 
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Cc: David Vrabel <david.vrabel@citrix.com>
> Cc: xen-devel@lists.xenproject.org
> Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
> ---
>  drivers/xen/events/events_fifo.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> --- a/drivers/xen/events/events_fifo.c
> +++ b/drivers/xen/events/events_fifo.c
> @@ -432,6 +432,7 @@ static int evtchn_fifo_cpu_notification(
>  			ret = evtchn_fifo_alloc_control_block(cpu);
>  		break;
>  	case CPU_DEAD:
> +	case CPU_UP_CANCELED:
>  		__evtchn_fifo_handle_events(cpu, true);
>  		break;
>  	default:
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH] xen/events/fifo: Add missing hotplug notifier transition
       [not found] ` <56E2A3B6.2060208@citrix.com>
@ 2016-03-11 11:26   ` Anna-Maria Gleixner
  0 siblings, 0 replies; 3+ messages in thread
From: Anna-Maria Gleixner @ 2016-03-11 11:26 UTC (permalink / raw)
  To: David Vrabel; +Cc: xen-devel, Boris Ostrovsky, linux-kernel, rt

On Fri, 11 Mar 2016, David Vrabel wrote:

> On 11/03/16 09:00, Anna-Maria Gleixner wrote:
> > The evtchn_fifo_cpu_notification() hotplug callback lacks handling of
> > the CPU_UP_CANCELED case. That means, if CPU_UP_PREPARE fails, the
> > handle of the fifo events is not dropped.
> > 
> > Add handling for CPU_UP_CANCELED transition to drop the fifo events
> > handle.
> 
> __evtchn_fifo_handle_events() does not releases resources, it processes
> any pending events for this CPU.
> 
> This patch would only be necessary if a CPU in CPU_UP_CANCELED state may
> have had unmasked interrupts.  If so you would need:

Thanks for the explanation

> case CPU_UP_CANCELED:
>           if (per_cpu(cpu_control_block, cpu))
>               __evtchn_fifo_handle_events(cpu, true);
>           break;
> 
> To handle the case where the control block allocation or initialization
> failed during CPU_UP_PREPARE.

This would not be necessary, because if the CPU_UP_PREPARE of this
notifier fails, the CPU_UP_CANCELLED of this notifier will not be
invoked.

Anna-Maria

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* [PATCH] xen/events/fifo: Add missing hotplug notifier transition
@ 2016-03-11  9:00 Anna-Maria Gleixner
  0 siblings, 0 replies; 3+ messages in thread
From: Anna-Maria Gleixner @ 2016-03-11  9:00 UTC (permalink / raw)
  To: linux-kernel
  Cc: David Vrabel, xen-devel, Boris Ostrovsky, Anna-Maria Gleixner, rt

The evtchn_fifo_cpu_notification() hotplug callback lacks handling of
the CPU_UP_CANCELED case. That means, if CPU_UP_PREPARE fails, the
handle of the fifo events is not dropped.

Add handling for CPU_UP_CANCELED transition to drop the fifo events
handle.

Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: xen-devel@lists.xenproject.org
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
---
 drivers/xen/events/events_fifo.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/xen/events/events_fifo.c
+++ b/drivers/xen/events/events_fifo.c
@@ -432,6 +432,7 @@ static int evtchn_fifo_cpu_notification(
 			ret = evtchn_fifo_alloc_control_block(cpu);
 		break;
 	case CPU_DEAD:
+	case CPU_UP_CANCELED:
 		__evtchn_fifo_handle_events(cpu, true);
 		break;
 	default:

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

end of thread, other threads:[~2016-03-11 11:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1457686822-39117-1-git-send-email-anna-maria@linutronix.de>
2016-03-11 10:53 ` [PATCH] xen/events/fifo: Add missing hotplug notifier transition David Vrabel
     [not found] ` <56E2A3B6.2060208@citrix.com>
2016-03-11 11:26   ` Anna-Maria Gleixner
2016-03-11  9:00 Anna-Maria Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).