Re: vfree in timerfunciton causes kernel crash

From: William Lee Irwin III
Date: Fri Apr 16 2004 - 11:24:50 EST

On Fri, Apr 16, 2004 at 06:10:50PM +0200, Mikkel Christiansen wrote:
> Idea: a module allocates memory (vmalloc) for userspace program which
> then craches.
> Due to lack of activity timer is expires and free's the unused memory
> (vfree).
> (see tc_core.c later in this mail for details)
> Problem: when timer expires and vfree is called then kernel crashes -
> or rather freezes silently.
> Can anyone explain why this happens? a kernel bug?
> Cheers
> Mikkel
> kernel 2.6.5

Use schedule_work() to do this from process context. It's a programming
error (specifically a deadlock) to vfree() from interrupt context or with
interrupts disabled.

-- wli
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at