Re: [PATCH] rtmutex: multiple candidate owners without unrelatedboosting

From: Steven Rostedt
Date: Tue Dec 14 2010 - 18:16:56 EST


On Tue, 2010-12-14 at 17:04 +0800, Lai Jiangshan wrote:

> /* Release the task */
> raw_spin_unlock_irqrestore(&task->pi_lock, flags);
> + if (!rt_mutex_owner(lock)) {
> + /*
> + * the lock is free and has waiters, set the top waiter
> + * as a new candidate owner when it is not set.
> + */
> + if (top_waiter != rt_mutex_top_waiter(lock)) {
> + top_waiter = rt_mutex_top_waiter(lock);
> + top_waiter->cand_seq = lock->cand_seq;

Shouldn't this be:

top_waiter->cand_seq = ++lock->cand_seq;

?

-- Steve

> + if (!top_waiter->cand_owner) {
> + top_waiter->cand_owner = 1;
> + wake_up_process(top_waiter->task);
> + }
> + }
> + raw_spin_unlock(&lock->wait_lock);
> + goto out_put_task;
> + }
> put_task_struct(task);
>
> /* Grab the next task */
> @@ -296,78 +303,16 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
> }
>


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/