mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: wu Jianfeng <stormplayer@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: the select system call's implementation may have some bug in preempt kernel mode
Date: Fri, 9 Oct 2009 09:02:37 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.00.0910090849400.9428@localhost.localdomain> (raw)
In-Reply-To: <a5b3ea7b0910082250o659d4fd3l8f319fd6bde24f3d@mail.gmail.com>

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

  reply	other threads:[~2009-10-09  7:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <a5b3ea7b0910082242s6ce8275dr7f962ce526e55cd2@mail.gmail.com>
2009-10-09  5:50 ` wu Jianfeng
2009-10-09  7:02   ` Thomas Gleixner [this message]
2009-10-09  7:11     ` wu Jianfeng
2009-10-09  7:22       ` Thomas Gleixner

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=alpine.LFD.2.00.0910090849400.9428@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stormplayer@gmail.com \
    /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®