Re: Possible kernel lock in semaphore's __down()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Oleg Nesterov
Date: Thursday, August 30, 2007 - 2:12 am

(just in case Peter's explanation was too concise)

On 08/30, Peter Zijlstra wrote:
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
please see below,


No, ret_from_intr() still can schedule(). Actually it does preempt_schedule_irq()
which sets PREEMPT_ACTIVE.

And, as Peter explained,


this is OK, because in this case schedule() doesn't remove the task from
run queue even if its state is TASK_UNINTERRUPTIBLE,

		if (prev->state && !(preempt_count() & PREEMPT_ACTIVE)) {
			...
			deactivate_task();
		}

note the "!(preempt_count() & PREEMPT_ACTIVE))" check. So the task is still
runnable, we don't need to wake it, it will get CPU eventually.

Oleg.

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Possible kernel lock in semaphore's __down(), Aleksandar Dezelin, (Wed Aug 29, 2:52 pm)
Re: Possible kernel lock in semaphore's __down(), Peter Zijlstra, (Thu Aug 30, 12:16 am)
Re: Possible kernel lock in semaphore's __down(), Oleg Nesterov, (Thu Aug 30, 2:12 am)