@@ -179,6 +179,16 @@ extern int sched_rr_timeslice;
*/
#define RUNTIME_INF ((u64)~0ULL)
+/*
+ * val is a period of time which composed by CFS part and RT part from CPU's
+ * point of view.
+ * This macro provide its approximate proportion of CFS part by remove the
+ * preempted time by RT.
+ */
+#define CFS_PROPORTION(task, val) \
+ (div64_ul(task_rq(task)->cfs.avg.util_avg * val, \
+ task_rq(task)->cfs.avg.util_avg + task_rq(task)->avg_rt.util_avg + 1)) \
+
static inline int idle_policy(int policy)
{
return policy == SCHED_IDLE;