diff options
author | Hennadiy Leontyev <leontyev@jupiter-cs.cs.unc.edu> | 2007-04-12 12:00:00 -0400 |
---|---|---|
committer | Hennadiy Leontyev <leontyev@jupiter-cs.cs.unc.edu> | 2007-04-12 12:00:00 -0400 |
commit | 781a7fee3f3ad699cc32a5cebbb67ed1c392f2dd (patch) | |
tree | c4a25f14e1bba1a6c39a81c4128bf5c78000db71 /include | |
parent | 5637daed062ac00ab1b2a672ebeb662c2f05fb98 (diff) |
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/pfair_math.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/linux/pfair_math.h b/include/linux/pfair_math.h index 6eef12433c..dab1778f0b 100644 --- a/include/linux/pfair_math.h +++ b/include/linux/pfair_math.h | |||
@@ -22,7 +22,7 @@ static inline quantum_t FLOOR(quantum_t a, unsigned long b) | |||
22 | static inline quantum_t CEIL(quantum_t a, unsigned long b) | 22 | static inline quantum_t CEIL(quantum_t a, unsigned long b) |
23 | { | 23 | { |
24 | quantum_t t = FLOOR(a, b); | 24 | quantum_t t = FLOOR(a, b); |
25 | return (quantum_t)((t * b == a)?t:(t + 1)); | 25 | return (quantum_t)((t * b == a) ? t : (t + 1)); |
26 | } | 26 | } |
27 | 27 | ||
28 | 28 | ||
@@ -60,7 +60,7 @@ static inline int b_bit(struct task_struct *t) | |||
60 | quantum_t e = get_exec_cost(t); | 60 | quantum_t e = get_exec_cost(t); |
61 | quantum_t p = get_rt_period(t); | 61 | quantum_t p = get_rt_period(t); |
62 | return CEIL((get_passed_quanta(t) + 1) * p, e)- | 62 | return CEIL((get_passed_quanta(t) + 1) * p, e)- |
63 | FLOOR((get_passed_quanta(t) + 1)* p, e); | 63 | FLOOR((get_passed_quanta(t) + 1) * p, e); |
64 | } | 64 | } |
65 | /* | 65 | /* |
66 | * Group deadline | 66 | * Group deadline |
@@ -69,7 +69,9 @@ static inline quantum_t group_deadline(struct task_struct * t) | |||
69 | { | 69 | { |
70 | quantum_t p = get_rt_period(t); | 70 | quantum_t p = get_rt_period(t); |
71 | quantum_t e = get_exec_cost(t); | 71 | quantum_t e = get_exec_cost(t); |
72 | return CEIL(CEIL(CEIL((get_passed_quanta(t)+1)*p, e)*(p-e), p)*p, p-e); | 72 | quantum_t stage1 = CEIL((get_passed_quanta(t) + 1) * p, e); |
73 | quantum_t stage2 = CEIL(stage1 * (p - e), p); | ||
74 | return CEIL(stage2 * p, p - e); | ||
73 | } | 75 | } |
74 | 76 | ||
75 | #endif /* __UNC_PFAIR_MATH_H__ */ | 77 | #endif /* __UNC_PFAIR_MATH_H__ */ |