lkml.org 
[lkml]   [2008]   [Sep]   [30]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateTue, 30 Sep 2008 09:01:58 +0200
FromIngo Molnar <>
SubjectRe: [PATCH] sched: minor optimizations in wake_affine and select_task_rq_fair
* Chris Friesen <cfriesen@nortel.com> wrote:

> Amit K. Arora wrote:
>> Hello,
>>
>> Please consider this patch. It makes a few minor changes to
>> sched_fair.c.
>>
>>
>> sched: Minor optimizations in wake_affine and select_task_rq_fair
>>
>> This patch does following:
>> o Reduces the number of arguments to wake_affine().
>
> At what point is it cheaper to pass items as args rather than 
> recalculating them?  If reducing the number of args is desirable, what 
> about removing the "this_cpu" and "prev_cpu" args and recalculating 
> them in wake_affine()?

it's usually not worth it, especially if it leads to duplicated 
calculations (and code) like:

+       unsigned int imbalance = 100 + (this_sd->imbalance_pct - 100) / 2;

gcc will optimize it away because it's all static functions, but still.

'size kernel/sched.o' should be a good guideline: if the .o's text 
section gets smaller due to a patch it usually gets faster as well.

	Ingo


\
 
 \ /
  Last update: 2008-09-30 09:05    [from the cache]
©2003-2008