Re: [PATCH RFC] irq_work: Warn if there's still work on cpu_down

2012-11-15 Thread Steven Rostedt
On Thu, 2012-11-15 at 19:12 +0100, Frederic Weisbecker wrote:
> 2012/11/15 Steven Rostedt :
> > If we are in nohz and there's still irq_work to be done when the idle
> > task is about to go offline. Give a nasty warning.
> >
> > Signed-off-by: Steven Rostedt 
> >
> > Index: linux-rt.git/kernel/irq_work.c
> > ===
> > --- linux-rt.git.orig/kernel/irq_work.c
> > +++ linux-rt.git/kernel/irq_work.c
> > @@ -103,6 +103,9 @@ bool irq_work_needs_cpu(void)
> > if (llist_empty(this_list))
> > return false;
> >
> > +   /* All work should have been flushed before going offline */
> > +   WARN_ON_ONCE(cpu_is_offline(smp_processor_id()));
> 
> Should we return false in that case? I don't know what can happen if
> we wait for one more tick while the CPU is offline and apic is
> deactivated.
> 

We can just let it go and find out :-)

Heck, they get the warning, if the system crashes shortly afterwards,
they know why.

-- Steve

> > +
> > return true;
> >  }
> >
> >
> >


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH RFC] irq_work: Warn if there's still work on cpu_down

2012-11-15 Thread Frederic Weisbecker
2012/11/15 Steven Rostedt :
> If we are in nohz and there's still irq_work to be done when the idle
> task is about to go offline. Give a nasty warning.
>
> Signed-off-by: Steven Rostedt 
>
> Index: linux-rt.git/kernel/irq_work.c
> ===
> --- linux-rt.git.orig/kernel/irq_work.c
> +++ linux-rt.git/kernel/irq_work.c
> @@ -103,6 +103,9 @@ bool irq_work_needs_cpu(void)
> if (llist_empty(this_list))
> return false;
>
> +   /* All work should have been flushed before going offline */
> +   WARN_ON_ONCE(cpu_is_offline(smp_processor_id()));

Should we return false in that case? I don't know what can happen if
we wait for one more tick while the CPU is offline and apic is
deactivated.

> +
> return true;
>  }
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH RFC] irq_work: Warn if there's still work on cpu_down

2012-11-15 Thread Frederic Weisbecker
2012/11/15 Steven Rostedt rost...@goodmis.org:
 If we are in nohz and there's still irq_work to be done when the idle
 task is about to go offline. Give a nasty warning.

 Signed-off-by: Steven Rostedt rost...@goodmis.org

 Index: linux-rt.git/kernel/irq_work.c
 ===
 --- linux-rt.git.orig/kernel/irq_work.c
 +++ linux-rt.git/kernel/irq_work.c
 @@ -103,6 +103,9 @@ bool irq_work_needs_cpu(void)
 if (llist_empty(this_list))
 return false;

 +   /* All work should have been flushed before going offline */
 +   WARN_ON_ONCE(cpu_is_offline(smp_processor_id()));

Should we return false in that case? I don't know what can happen if
we wait for one more tick while the CPU is offline and apic is
deactivated.

 +
 return true;
  }



--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH RFC] irq_work: Warn if there's still work on cpu_down

2012-11-15 Thread Steven Rostedt
On Thu, 2012-11-15 at 19:12 +0100, Frederic Weisbecker wrote:
 2012/11/15 Steven Rostedt rost...@goodmis.org:
  If we are in nohz and there's still irq_work to be done when the idle
  task is about to go offline. Give a nasty warning.
 
  Signed-off-by: Steven Rostedt rost...@goodmis.org
 
  Index: linux-rt.git/kernel/irq_work.c
  ===
  --- linux-rt.git.orig/kernel/irq_work.c
  +++ linux-rt.git/kernel/irq_work.c
  @@ -103,6 +103,9 @@ bool irq_work_needs_cpu(void)
  if (llist_empty(this_list))
  return false;
 
  +   /* All work should have been flushed before going offline */
  +   WARN_ON_ONCE(cpu_is_offline(smp_processor_id()));
 
 Should we return false in that case? I don't know what can happen if
 we wait for one more tick while the CPU is offline and apic is
 deactivated.
 

We can just let it go and find out :-)

Heck, they get the warning, if the system crashes shortly afterwards,
they know why.

-- Steve

  +
  return true;
   }
 
 
 


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/