Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Sep 2007 17:15:17 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-acpi@freebsd.org
Cc:        freebsd-current@freebsd.org, Jung-uk Kim <jkim@freebsd.org>
Subject:   Re: [PATCH] OsdSynch.c modernization
Message-ID:  <200709211715.17940.jhb@freebsd.org>
In-Reply-To: <200709181516.11207.jkim@FreeBSD.org>
References:  <200709181516.11207.jkim@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200709211715.17940.jhb>