mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	sched: fix goto retry in pick_next_task_rt()
looking at it one more time: (1) it looks to me that there is no need to call sched_rt_ratio_exceeded() from pick_next_rt_entity() - [ for CONFIG_FAIR_GROUP_SCHED ] queues with rt_rq->rt_throttled are not within this 'tree-like hierarchy' (or whatever we should call it :-) - there is also no need to re-check 'rt_rq->rt_time > ratio' at this point as 'rt_rq->rt_time' couldn't have been increased since the last call to update_curr_rt() (which obviously calls sched_rt_ratio_esceeded()) well, it might be that 'ratio' for this rt_rq has been re-configured (and the period over which this rt_rq was active has not yet been finished)... but I don't think we should really take this into account. (2) now pick_next_rt_entity() must never return NULL, so let's change pick_next_task_rt() accordingly. Signed-off-by: Dmitry Adamushko <dmitry.adamushko@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
		
							parent
							
								
									e118adef23
								
							
						
					
					
						commit
						326587b840
					
				
					 1 changed files with 2 additions and 7 deletions
				
			
		| 
						 | 
					@ -476,15 +476,12 @@ static struct sched_rt_entity *pick_next_rt_entity(struct rq *rq,
 | 
				
			||||||
	struct list_head *queue;
 | 
						struct list_head *queue;
 | 
				
			||||||
	int idx;
 | 
						int idx;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (sched_rt_ratio_exceeded(rt_rq))
 | 
					 | 
				
			||||||
		goto out;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	idx = sched_find_first_bit(array->bitmap);
 | 
						idx = sched_find_first_bit(array->bitmap);
 | 
				
			||||||
	BUG_ON(idx >= MAX_RT_PRIO);
 | 
						BUG_ON(idx >= MAX_RT_PRIO);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	queue = array->queue + idx;
 | 
						queue = array->queue + idx;
 | 
				
			||||||
	next = list_entry(queue->next, struct sched_rt_entity, run_list);
 | 
						next = list_entry(queue->next, struct sched_rt_entity, run_list);
 | 
				
			||||||
 out:
 | 
					
 | 
				
			||||||
	return next;
 | 
						return next;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -494,7 +491,6 @@ static struct task_struct *pick_next_task_rt(struct rq *rq)
 | 
				
			||||||
	struct task_struct *p;
 | 
						struct task_struct *p;
 | 
				
			||||||
	struct rt_rq *rt_rq;
 | 
						struct rt_rq *rt_rq;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 retry:
 | 
					 | 
				
			||||||
	rt_rq = &rq->rt;
 | 
						rt_rq = &rq->rt;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (unlikely(!rt_rq->rt_nr_running))
 | 
						if (unlikely(!rt_rq->rt_nr_running))
 | 
				
			||||||
| 
						 | 
					@ -505,8 +501,7 @@ static struct task_struct *pick_next_task_rt(struct rq *rq)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	do {
 | 
						do {
 | 
				
			||||||
		rt_se = pick_next_rt_entity(rq, rt_rq);
 | 
							rt_se = pick_next_rt_entity(rq, rt_rq);
 | 
				
			||||||
		if (unlikely(!rt_se))
 | 
							BUG_ON(!rt_se);
 | 
				
			||||||
			goto retry;
 | 
					 | 
				
			||||||
		rt_rq = group_rt_rq(rt_se);
 | 
							rt_rq = group_rt_rq(rt_se);
 | 
				
			||||||
	} while (rt_rq);
 | 
						} while (rt_rq);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue