Messages in this thread | | | Date | Fri, 25 Jun 2010 19:58:49 +0800 | Subject | Re: [RFC][PATCH] irq_work | From | huang ying <> |
| |
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/
| |