mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Wang Nan" <wn.at.lkml@gmail.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Can any one tell me why cond_resched in do_select?
Date: Thu, 24 Jan 2008 03:01:53 +0800	[thread overview]
Message-ID: <14344f930801231101w3906aeaey88034e0fa8fa3f36@mail.gmail.com> (raw)

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.

             reply	other threads:[~2008-01-23 19:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-23 19:01 Wang Nan [this message]
2008-01-27  6:00 ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14344f930801231101w3906aeaey88034e0fa8fa3f36@mail.gmail.com \
    --to=wn.at.lkml@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®