lkml.org 
[lkml]   [2012]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] sched: Accelerate "pick_next_entity" under special condition
On 01/30/2012 11:25 AM, Cong Wang wrote:

> On 01/30/2012 11:18 AM, Michael Wang wrote:
>> But the sched.o under ./arch/x86/kernel/cpu/ still not change...
>> I think I may checking the wrong file, because this patch is for fair.c.
>>
>> And the fair.o changed after apply the patch, the size is a little
>> bigger, and the gcc generated code changed.
>>
>> But I still don't know what can we get from this result? Bigger size is
>> caused by additional code, but these additional code will help to step
>> over some unnecessary code under special condition, looks like some
>> balance between size and performance...
>
> As your patch reduces the conditionals from 24 to 14, so it is possible
> that it also reduces the size of the code too. This is Ingo's point.
>


I think the number reduce because we can ignore some condition in
special case after applied the patch, but all the old code are still
needed, the compiled code should like:

old:

check condition 1
process condition 1
check condition 2
process condition 2
check condition 3
process condition 3
return

new:

check condition 3
process condition 3
jump to label //we can step over some code here
check condition 2
process condition 2
jump to label
check condition 1
process condition 1
label:return

We can do this change because the priority is 3 > 2 > 1.

So while the code is running and the condition 3 matched, the cpu don't
need to run the code "check condition 2" and "check condition 1".

But those code is still needed, and we can see the "jump to label" will
be the additional code which is the reason of bigger size.

Regards,
Michael Wang

> You need to check the diff to see why gcc actually generates bigger code.
> --
> 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: 2012-01-30 06:49    [W:1.361 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site