Skip to content
Commit 3066bc4e authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
Browse files

sched: move task_util() to sched.h



The same task_util() inline function is defined in fair.c and rt.c.
Move it to a common header file.

While at it, make sure that this function works for 32 bit also.
Previously,

util = ((u64)demand)<<10/sched_ravg_window

This division of two 64 bit quantities gives a linker error on 32
bit system. The same result can be achieved without type casting
the demand to 64 bit and without losing precision by making it

util = demand/(sched_ravg_window>>10).

Change-Id: Iffc2b6b484fbcdac8d6f9739f96798a8d8e035c5
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent d98d9ee8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment