re-inline sched functions
Ingo Molnar wrote on Friday, March 11, 2005 1:32 AM
Quoted 7 lines
Review
Quoted 2 lines
(quoted diff) +1
-1-static unsigned int task_timeslice(task_t *p) +static inline unsigned int task_timeslice(task_t *p)the patch looks good except this one - could you try to undo it and re-measure?
task_timeslice()is not used in any true fastpath, if it makes any difference then the performance difference must be some other artifact.
Chen, Kenneth W wrote on Friday, March 11, 2005 10:40 AM
Quoted 1 line
OK, I'll re-measure. Yeah, I agree that this function is not in the fastpath.
Ingo is right, re-measured on our benchmark setup and did not see any difference whether task_timeslice is inlined or not. So if people want to take inline keyword out for that function, we won't complain :-)
Quoted 9 lines · Chen, Kenneth W
Ingo Molnar wrote on Friday, March 11, 2005 1:32 AM
Quoted 7 lines
Review
Quoted 2 lines
(quoted diff) +1
-1-static unsigned int task_timeslice(task_t *p) +static inline unsigned int task_timeslice(task_t *p)the patch looks good except this one - could you try to undo it and re-measure?
task_timeslice()is not used in any true fastpath, if it makes any difference then the performance difference must be some other artifact.
Quoted 7 lines
Chen, Kenneth W wrote on Friday, March 11, 2005 10:40 AM
Quoted 1 line
OK, I'll re-measure. Yeah, I agree that this function is not in the fastpath.
Ingo is right, re-measured on our benchmark setup and did not see any difference whether
task_timesliceis inlined or not. So if people want to take inline keyword out for that function, we won't complain :-)
uninline task_timeslice() - reduces code footprint noticeably, and it's slowpath code.
sched.c renamed from sched.c.orig +1 -1
@@ -166,7 +166,7 @@#define SCALE_PRIO (x, prio) \ max(x * (MAX_PRIO - prio) / (MAX_USER_PRIO/2), MIN_TIMESLICE) -static inline unsigned int task_timeslice (task_t *p) +static unsigned int task_timeslice (task_t *p) {if (p->static_prio <NICE_TO_PRIO (0 ))return SCALE_PRIO (DEF_TIMESLICE *4 , p->static_prio);