git: kernel - Add workaround for improper yield in ACPI path

Matthew Dillon dillon at
Mon Aug 8 10:54:09 PDT 2016

commit fbe960762198e27378a857bfa91c5d82e625aa3b
Author: Matthew Dillon <dillon at>
Date:   Mon Aug 8 10:46:35 2016 -0700

    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().

Summary of changes:
 sys/kern/lwkt_thread.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

DragonFly BSD source repository

More information about the Commits mailing list