lkml.org 
[lkml]   [2018]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] kernel/hung_task.c: disable on suspend
Date
"Rafael J. Wysocki" <rjw@rjwysocki.net> writes:

> On Thursday, September 13, 2018 6:08:51 PM CEST Vitaly Kuznetsov wrote:
...

>> +static int hungtask_pm_notify(struct notifier_block *self,
>> + unsigned long action, void *hcpu)
>> +{
>> + switch (action) {
>> + case PM_SUSPEND_PREPARE:
>> + case PM_HIBERNATION_PREPARE:
>> + hung_detector_suspended = true;
>> + break;
>> + case PM_POST_SUSPEND:
>> + case PM_POST_HIBERNATION:
>> + hung_detector_suspended = false;
>> + break;
>> + default:
>> + break;
>> + }
>> + return NOTIFY_OK;
>> +}
>> +
>> /*
>> * kthread which checks for tasks stuck in D state
>> */
>> @@ -261,7 +282,8 @@ static int watchdog(void *dummy)
>> interval = min_t(unsigned long, interval, timeout);
>> t = hung_timeout_jiffies(hung_last_checked, interval);
>
> Since you are adding the notifier anyway, what about designing it to make
> the thread wait on _PREPARE until the notifier kicks it again on exit
> fron suspend/hibernation?
>

We can either park the kthread (kthread_park/unpark) or make it go away
completely by doing kthread_stop/kthread_run(). I'm leaning toward
parking, what do you think?

--
Vitaly

\
 
 \ /
  Last update: 2018-09-14 16:21    [W:0.096 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site