kernel - Add workaround for improper yield in ACPI path
* For now add a workaround for an improper yield that can occur indirectly
via the ACPI path. The problem is that the ACPI contrib code can hold
a spinlock across a kmalloc() call.
* The ACPI code, in particular AcpiOsAcquireLock(), uses a spin lock. At
the same time it MUST use a spinlock because it might be called from
the idle thread. But it also appears that the code might call kmalloc()
while holding a spinlock.
The kmalloc path ACPI calls is with M_INTWAIT, which reduces the chance
that kmalloc might try to block. However, kmalloc is used to execute
staged kfrees which can create a sequence:
kmalloc -> kmem_slab_free -> (vm system) ->
vm_object_page_remove_callback -> lwkt_user_yield().