following this post I have implemented in my kernel module:
static int val = 1;
static char thread_name[128] = "my thread name";
in the init:
thread1 = kthread_run(thread_fn, &val, thread_name);
and this is the function
int thread_fn(void *data)
{
unsigned long j0,j1;
int delay = 60*HZ;
j0 = jiffies;
j1 = j0 + delay;
printk(KERN_INFO "here");
while (time_before(jiffies, j1))
schedule();
return 1;
}
Why does this execute only 1 time ?