Messages in this thread | ![/](/images/icornerl.gif) | | Date | Mon, 8 Dec 2003 11:08:27 -0800 (PST) | From | Linus Torvalds <> | Subject | Re: PROBLEM: possible proceses leak |
| |
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. --
No.
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.
Linus - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| ![\](/images/icornerr.gif) |