Re: [PATCH] OsdSynch.c modernization

From: John Baldwin <jhb_at_freebsd.org>
Date: Fri, 21 Sep 2007 17:15:17 -0400
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
Received on Fri Sep 21 2007 - 19:40:27 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:18 UTC