lkml.org 
[lkml]   [2015]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Possible lock-less list race in scheduler_ipi()
On Fri, 6 Mar 2015 19:39:44 +0000 (UTC)
Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote:

ask concurrently with the llist iteration within sched_ttwu_pending().
>
> AFAIU, ttwu_queue_remote() is called from ttwu_queue() without holding
> the rq lock. So I'm wondering what prevents corruption of the wake_list
> in this situation.

I guess if it is on the wake_list, then the task's state is already
RUNNING. Any other task can switch a task's state to RUNNING but only
the task itself can switch it back to something else. If the task is on
the wake_list, it's state is already RUNNING, but it has not run yet.
That means any other wakeup will jump to the "goto out" and skip over
the ttwu_queue() call.

-- Steve


\
 
 \ /
  Last update: 2015-03-06 21:41    [W:0.053 / U:0.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site