lkml.org 
[lkml]   [2013]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject__refrigerator() && saved task->state
Sorry for noise, but I am totally confused.

Could you please remind why __refrigerator() saves/restores
task->state?

I can see only one reason: set_freezable() kernel threads which
check kthread_should_stop() and do try_to_freeze() by hand.

But does this save/restore actually help?

For example kauditd_thread() looks obviously racy exactly because
try_to_freeze() can return in TASK_INTERRUPTIBLE state after
wake_up(kauditd_wait) was already called, we can miss an event.

At first glance it would be better to simply kill this logic? If
it was called with ->state != 0, the caller is going to schedule()
and it probably executes the wait_event-like code, in this case
it would me more safe to pretend the task got a spurious wakeup?

(as for kauditd_thread() in particular, it looks wrong in any
case, even kthread_should_stop() check doesn't look right, it
needs kthread_freezable_should_stop() afaics).

But I guess I missed something else...

Oleg.



\
 
 \ /
  Last update: 2013-11-13 20:41    [W:0.055 / U:2.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site