lkml.org 
[lkml]   [2009]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: the select system call's implementation may have some bug in preempt kernel mode
On Fri, 9 Oct 2009, wu Jianfeng wrote:
> A process may sleep for ever when he call select system call.
> In detail, if the process was scheduled out just at the point it set
> its state to TASK_INTERRUPTIBLE.
>
> The events that may cause the process to be scheduled out is(in
> preempt kernel) :
> 1) time interrupt and the process's time slice is exhausted.
> 2) an interrupt accured, and wake up another process with high priority.

Right, but that does not cause the task to be scheduled out for ever.

> set_current_state(TASK_INTERRUPTIBLE); ######## here set the
> interrupt to TASK_INTERRUPTIBLE state
>
> ########### if the process was schedued out here, it
> will can never been waken up .
> ########### Because the process wasn't attached to any
> file's waitqueue at this point yet

When the task is scheduled out at that point, it is not
deactivated. It is preempted, which means it stays on the run queue
despite of the TASK_INTERRUPTIBLE state and is scheduled back in later
on.

Thanks,

tglx


\
 
 \ /
  Last update: 2009-10-09 09:05    [W:0.042 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site