I write simple code to test the function of tasklet.
When I don't do tasklet_kill, the kernel will be hang after the insmod command is using. Since there is no log, I have no idea what happens.
The following is my code.
void work_fcn(unsigned long a)
{
printk("this is tasklet work function\n");
}
void tasklet_test(void)
{
struct tasklet_struct task;
tasklet_init(&task, work_fcn, 0);
tasklet_schedule(&task);
//if I don't do the following line, then kernel hang
tasklet_kill(&task);
}
static int __init hello_init(void)
{
tasklet_test();
return 0;
}
module_init(hello_init);
Thanks.