Re: lockless acpi-safe/acpi-safe24

看板DFBSD_submit作者時間16年前 (2009/05/27 04:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
:Hi, : :Following patch git rid of the clock spinlock used in acpi-safe/acpi-safe24: :http://leaf.dragonflybsd.org/~sephe/0001-acpi-timer-Percpu-last_count-and-time_base-mai.patch : :Please test/review. I have tested the patch w/ acpi-safe24. : :Best Regards, :sephe I think we might still need the critical section to avoid interrupt races. If acpi_timer_get_timecount24() and friends are re-entered by an interrupt we could end up with acpi_timer_base[cpu] getting bumped twice. We could probably avoid the critical section by having an interlock count to prevent the reentered call in the interrupt from bumping acpi_timer_base[], but critical sections are so cheap on DFly we might as well just use a critical section. I am also a bit worried about the acpi_timer_base[] for individual cpu's getting out of sync with each other and creating a real mess. e.g. if a cpu is stopped by the debugger or otherwise does not refresh the base by polling the counter. Finally we might also want to change those static array declarations to an array of structure for acpi_timer_base and acpi_last_counter, and cache-aligning the elements. I think the getting-out-of-sync problem between the cpus could be a show-stopper, though. -Matt Matthew Dillon <dillon@backplane.com>
文章代碼(AID): #1A74g400 (DFBSD_submit)
文章代碼(AID): #1A74g400 (DFBSD_submit)