lkml.org 
[lkml]   [2008]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectCan any one tell me why cond_resched in do_select?
Hi, everyone.
I have a question regarding to select system call's code. In
do_select() function, after check each fd in the set, do_select() call
cond_resched(). That line, according to my view, is to reduce the
system freeze time when do the busy querying. But before the call,
when entering into the big loop, do_select call
set_current_state(TASK_INTERRUPTIBLE). Then, if the reschedule really
taken up, the current process will not return unless it catch a
signal, or one of already registered fd send an event.
I've tried in UML. If I replace the cond_resched() into schedule(),
when sys_select() called, the process halt just like I've said.
I don't think there is a bug because this code exist so long time and
no really bad thing happened. I just want to know that, since no
schedule() allowed here, can we delete the useless line?
Thank you.


\
 
 \ /
  Last update: 2008-01-23 20:05    [W:0.035 / U:0.760 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site