[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87d0tg88l3.fsf@vitty.brq.redhat.com>
Date: Fri, 14 Sep 2018 16:19:52 +0200
From: Vitaly Kuznetsov <vkuznets@...hat.com>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>
Cc: linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Dmitry Vyukov <dvyukov@...gle.com>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Oleg Nesterov <oleg@...hat.com>
Subject: Re: [PATCH] kernel/hung_task.c: disable on suspend
"Rafael J. Wysocki" <rjw@...ysocki.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
Powered by blists - more mailing lists