lkml.org 
[lkml]   [2010]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC][PATCH] irq_work
From
On Fri, Jun 25, 2010 at 5:30 PM, Peter Zijlstra <peterz@infradead.org> wrote:
>> > You can always miss an NMI since it can always happen before the
>> > callback gets done, and allowing another enqueue before the callback is
>> > complete is asking for trouble.
>>
>> If we move entry->next = NULL before entry->func(entry), we will not
>> miss the NMI. Can you show how to miss it in this way?
>
> <NMI>
>  ...
>  irq_work_queue(&my_work, func);
>  ...
> <EOI>
> <IPI>
>  irq_work_run()
>
>  <NMI>
>    irq_work_queue(&my_work, func); <FAIL>
>  <EOI>
>
>   my_func.next = NULL;

entry->func() should follows here. You can collect all information
(maybe some data in a ring buffer) from NMI handler in entry->func().
But if you place entry->NULL after entry->func(), you will really lose
a NMI notification and the information from NMI handler.

> <EOI>

> Really not that hard. Now imagine wrapping irq_work in some state and
> you reusing the state while the function is still running..

So I suggest to use another flag to signify the function is running to
distinguish.

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

\
 
 \ /
  Last update: 2010-06-25 14:01    [W:0.168 / U:1.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site