Messages in this thread | | | Date | Wed, 5 Jan 2011 19:46:44 +0100 | From | Oleg Nesterov <> | Subject | Re: [RFC][PATCH 11/18] sched: Add p->pi_lock to task_rq_lock() |
| |
On 01/04, Peter Zijlstra wrote: > > This makes task_rq_lock() acquire both locks, and have > __task_rq_lock() validate that p->pi_lock is held.
... and kills task_is_waking(), good ;)
So TASK_WAKING is only means "do not try to wakeup", this greatly simplifies things.
One purely cosmetic nit,
> @@ -4902,8 +4898,7 @@ static int __sched_setscheduler(struct t > > check_class_changed(rq, p, prev_class, oldprio, running); > } > - __task_rq_unlock(rq); > - raw_spin_unlock_irqrestore(&p->pi_lock, flags); > + task_rq_unlock(rq, p, &flags);
__sched_setscheduler() has a couple more instances of
__task_rq_unlock(rq); raw_spin_unlock_irqrestore(&p->pi_lock, flags); return EXXX;
above.
> @@ -5691,8 +5685,7 @@ int set_cpus_allowed_ptr(struct task_str > return 0; > } > out: > - __task_rq_unlock(rq); > - raw_spin_unlock_irqrestore(&p->pi_lock, flags); > + task_rq_unlock(rq, p, &flags);
the same.
Hmm, and normalize_rt_tasks(), it could just do task_rq_lock/task_rq_unlock. And why it does read_lock_irqsave(tasklist), btw? _irqsave looks unneeded.
Oleg.
| |