>>Could we do something like this:
>>
>>#define ACPI_ALLOCATE(a)      kmalloc((a),
>(in_atomic())?GFP_ATOMIC:GFP_KERNEL)
>>#define ACPI_ALLOCATE_ZEROED(a)       kzalloc((a),
>(in_atomic())?GFP_ATOMIC:GFP_KERNEL)
>
>The question is if we allocate with interrupts off
>only on resume, or during normal operation.
>
>If it is only during resume, then I think we should
>be using the exact same mechanism that we use
>during boot, It must also apply to semaphores,
>not just kmalloc.

To clarify...

kernel/sched.c

void __might_sleep(...) {
   if (.... & (system_state == SYSTEM_RUNNING)...)
        printk(KERN_ERROR "BUG: sleeping in fuction called from invalid
context...
        ...
        dump_stack
}

When we boot the system system_state == SYSTEM_BOOTING
allocations do not sleep, they succeed, and thus the sleep
check is disabled.

It is likely we should do the same thing, or an analogous thing,
on resume from suspend.

-Len
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to