[PATCH] OsdSynch.c modernization

John Baldwin jhb at freebsd.org
Fri Sep 21 14:24:20 PDT 2007


On Tuesday 18 September 2007 03:16:07 pm Jung-uk Kim wrote:
> I have rewritten sys/dev/acpica/Osd/OsdSynch.c to match the modern 
> ACPI-CA and -CURRENT:
> 
> http://people.freebsd.org/~jkim/acpica/OsdSynch.diff

Why do you use a loop around tsleep() rather than just use sx_xlock() (which 
will block) for the WAIT_FOREVER case when waiting on a semaphore?

Why don't you just use a spin mutex for the spin lock?  That is a far better 
fit than the sx lock stuff you are doing.  Manually doing spinlock_enter() 
(wrongly btw, you should use critical_enter(), not sched_pin() otherwise you 
can be preempted) just to avoid the assertion failure is just going to result 
in obscure hangs.  Does ACPI-CA want to malloc() while holding an ACPI spin 
lock or something?

-- 
John Baldwin


More information about the freebsd-acpi mailing list