/* task_rq_lock - lock the runqueue a given task resides on and disable interrupts. Note the ordering: we can safely lookup the task_rq without explicitly disabling preemption.  */
static struct rq* task_rq_lock(struct task_struct *p, unsigned long *flags) __acquires(rq -> lock)
/* task_rq_lock - lock the runqueue a given task resides on and disable interrupts. Note the ordering: we can safely lookup the task_rq without explicitly disabling preemption.  */
static struct rq* task_rq_lock(struct task_struct *p, unsigned long *flags) __acquires(rq -> lock)
{
	struct rq *rq;
	for (;;) {
		local_irq_save(*flags);
		rq = task_rq(p);
		raw_spin_lock(&rq->lock);
		if (likely(rq == task_rq(p)))
			return rq;
		raw_spin_unlock_irqrestore(&rq->lock, *flags);
	}
}