sleep/wake-up timeout issue
I have a unexpected issue that related in sleep/wake-up timeout for task, while device driver develop.
my code use kernel function 'wait_for_
I expected this function 'wait_for_
so result of have additional test, the additionally delayed time is different, but the result is the same.
additionally delayed time range was random in 1ms ~ 11seconds.
this issue occur in kernel function 'msleep(255 * 1000)' too... because schedule_timeout() used in 'wait_for_
※A additionally delayed time occurs even if a different number is entered like 1ms or 1seconds..
I think it "additionally delayed time" was mean that wake-up task but time to task racing until active run in cpu. am i guessing right? or not am i doing something wrong?
If my thoughts are right, How do I get the correct time?
Below is the sample code I tested.
struct completion cmp;
static long g_jiffies = 0;
static int _open(struct inode *inode, struct file *file)
{
init_
g_jiffies = 0;
return 0;
}
static ssize_t _read(struct file *filp, char __user *buffer, size_t count, loff_t *ppos)
{
long sch = 0;
reinit_
printk(
g_jiffies = jiffies;
sch = wait_for_
//msleep(255 * 1000)
printk(
return 0;
}
result dmesg :
[목 1월 6 13:05:30 2022] start checking
[목 1월 6 13:09:52 2022] delay time = 261808
Question information
- Language:
- English Edit question
- Status:
- Open
- For:
- Ubuntu Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask hyukmin kwon for more information if necessary.