Re: [PATCH] sched: Avoid unnecessarily moving highest priority task move_tasks()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 25, 2006 at 12:30:00PM +1000, Peter Williams wrote:
> Siddha, Suresh B wrote:
> > And we also need to initialize busiest_best_prio_seen inside this check.
> > (like in my patch)
> > 	if (busiest->expired->nr_active) {
> 
> Why?  It's already initialized.  If the current running task has 
> prio==busiest_best_prio then we know that can_migrate_task() will 
> prevent it from being moved so it's safe to move any other tasks we meet 
> with that priority.
> > And we need to reset busiest_best_prio_seen to '0' whenever we finished
> > the checking of expired list (and move onto active list) and there are
> > no best prio tasks on expired list..
> 
> No we don't.  Once we've skipped one it's OK to move any others that we 
> find.  We'll never move more than one as a result of overriding the skip 
> anyhow .

Ok.

> 
> > 
> >>> @@ -2072,6 +2067,13 @@ static int move_tasks(runqueue_t *this_r
> >>>  	if (busiest->expired->nr_active) {
> >>>  		array = busiest->expired;
> >>>  		dst_array = this_rq->expired;
> >>> +		/*
> >>> +		 * We already have one or more busiest best prio tasks on
> >>> +		 * active list.
> >> This is a pretty bold assertion.  How do we know that this is true.
> > 
> > That comment refers to when 'busiest_best_prio_seen' is initialized to '1'.
> > Comment needs to be fixed.
> 
> But you initialized it to zero.

That comment refers to the assignment code below it..

Anyhow, now that we are going with fixes to your patch, this is a moot point.

thanks,
suresh
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux