[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTimiq2K6v_OhCajiktj6HzqikMZRuc8p4PK6SPjq@mail.gmail.com>
Date: Fri, 25 Jun 2010 19:58:49 +0800
From: huang ying <huang.ying.caritas@...il.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Huang Ying <ying.huang@...el.com>, Ingo Molnar <mingo@...e.hu>,
hpa@...or.com,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andi Kleen <andi@...stfloor.org>
Subject: Re: [RFC][PATCH] irq_work
On Fri, Jun 25, 2010 at 5:30 PM, Peter Zijlstra <peterz@...radead.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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists