其他分享
首页 > 其他分享> > Hung-watchdog

Hung-watchdog

作者:互联网

static int watchdog(void *dummy)
{
    unsigned long hung_last_checked = jiffies;

    set_user_nice(current, 0);

    for ( ; ; )
    {
            unsigned long timeout = sysctl_hung_task_timeout_secs;
            unsigned long interval = sysctl_hung_task_check_interval_secs;

            interval = min_t(unsigned long, interval, timeout);
            t = hung_timeout_jiffies(hung_last_checked, interval);
            if (t <= 0)
            {
                   if (!atomic_xchg(&reset_hung_task, 0) &&!hung_detector_suspended)
                           check_hung_uninterruptible_tasks(timeout);
                  hung_last_checked = jiffies;
                   continue;
            }
            schedule_timeout_interruptible(t);
    }

    return 0;
}

标签:checked,interval,unsigned,long,hung,timeout,Hung,watchdog
来源: https://www.cnblogs.com/longbowchi/p/14825136.html