DragonFly commits List (threaded) for 2009-05
DragonFly BSD
DragonFly commits List (threaded) for 2009-05
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: DragonFly- master sys/platform/pc32/apic mpapic.c sys/platform/pc32/isa clock.c sys/platform/pc64/isa clock.c sys/platform/vkernel/platform systimer.c sys/sys systimer.h

From: Sepherosa Ziehau <sepherosa@xxxxxxxxx>
Date: Wed, 6 May 2009 20:40:25 +0800

On Tue, May 5, 2009 at 11:47 PM, Matthew Dillon
<dillon@apollo.backplane.com> wrote:
> :
> :To be safe, we will have to do an explicit reload :)
> :
> :>
> :>    For an 8254-based wakeup you would probably want to maintain
> :>    a global cpu mask of cpu's sitting in sleep that need to be
> :>    IPId (instead of IPI'ing all of them), and interlock the updating
> :>    of the 8254's one-shot & notification cpumask with the same spinlock
> :>    the 8254 code uses now (clock_lock()).
> :
> :Would it necessary to use clock_lock()?  I think if the mask is only
> :set/clear in acpi_idle, atomic operation should be enough.
> :
> :--
> :Live Free or Die
>    I think you would need to use some sort of spin lock to avoid
>    races against the checking & loading of a new 8254 timer value and
>    the servicing of a 8254 interrupt at the same time, but I have not
>    looked at the code closely.

I think its pretty safe, using critical section and atomic set mask
before loading the timer (the mask is always set no matter whether
timer is really reloaded or not), so the race against timer0_running
will not happen.

Best Regards,

Live Free or Die

[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]