archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <>
To: Andrew Volkov <>
Subject: Re: PROBLEM: possible proceses leak
Date: Mon, 8 Dec 2003 11:08:27 -0800 (PST)	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Mon, 8 Dec 2003, Andrew Volkov wrote:
> In all kernels (up to 2.6-test11) next sequence of code
> in __down/__down_interruptible function
> (arch/i386/kernel/semaphore.c) may cause processes or threads leaking.

Nope. Quite the reverse, in fact. Having the "state" setting above the
wait-queue is usually a good idea, since it means that there are less
races to worry about.

> |-----tsk->state = TASK_UNINTERRUPTIBLE;		<----- BUG:
> |          -- If "do_schedule" from kernel/schedule will calling
> |              at this point, due to expire of time slice,
> |              then current task will removed from run_queue,
> | 		   but doesn't added to any waiting queue, and hence
> |	         will never run again. --


Kernel preemption is special, and it will preempt the process WITHOUT
CHANGING the state of it. See the PREEMPT_ACTIVE test in schedule(). The
process will still be left on the run-queue, and it will be run again,
even if it is marked sleeping.


  parent reply	other threads:[~2003-12-08 19:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-08 18:01 PROBLEM: possible proceses leak Andrew Volkov
2003-12-08 18:25 ` William Lee Irwin III
2003-12-08 19:08 ` Linus Torvalds [this message]
2003-12-08 18:45 Andrew Volkov
2003-12-08 18:51 ` William Lee Irwin III
2003-12-08 19:09   ` Linus Torvalds
2003-12-08 19:23     ` William Lee Irwin III
2003-12-08 19:34 Andrew Volkov

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:

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

  git send-email \ \ \ \ \

* 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;
as well as URLs for NNTP newsgroup(s).