lkml.org 
[lkml]   [2002]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectbug/code cleanup for O(1)-K3
In the K3 version of the O(1) scheduler for 2.4.17 there is
either a bug or an opportunity for some code cleanup. At
the beginning of the load_balance() routine we set the local
variable 'nr_running' and use this variable to calculate the
value of 'imbalance'. After this the variable is not used,
even though we go to the trouble of passing it to
double_lock_balance() so that it can be possibly be recomputed.
Note the code:

imbalance = (max_load - nr_running) / 2;

/* It needs an at least ~25% imbalance to trigger balancing. */
if (!idle && (imbalance < (max_load + 3)/4))
return;

nr_running = double_lock_balance(this_rq, busiest, this_cpu, idle, nr_running);
/*
* Make sure nothing changed since we checked the
* runqueue length.
*/
if (busiest->nr_running <= this_rq->nr_running + 1)
goto out_unlock;


In the last if statement above, I suspect we want to compare
'busiest->nr_running' to the local variable nr_running (as was
done in previous versions of the code). If this is not the
case, then we can simplify double_lock_balance() and make it
return a void.

P.S. I've only been working with the 2.4.17 version of the patch,
but I assume the code is the same in other versions.
--
Mike
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:24    [W:1.157 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site