lkml.org 
[lkml]   [2011]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.



\
 
 \ /
  Last update: 2011-01-05 19:57    [W:0.278 / U:5.836 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site